Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Management Studio: Fatal Scripting Error

883 views
Skip to first unread message

Dr. Network

unread,
Apr 3, 2006, 3:28:04 PM4/3/06
to
I'm trying to add more than one view to my database in a script. While the view in my scripts are different than the example below, it illustrates the problem. Essentially, when I try to add more than one view, I'm getting a parsing error on the word "GO". The script works OK in SQL 2000 Query Analyzer but fails in Management Studio. I've installed the SQL 2005 Service Pack 1 CTP on my Windows XP SP2 workstation. When I run only the top or bottom portion of the view, the respective view script parses and runs.
 
Here is the script:

CREATE view [dbo].[Object_View] as

select * from sysobjects where name = 'sysobjects'

GO

CREATE view [dbo].[Column_View] as

select * from table_detail where name = 'syscolumns'

GO

Here is the error:

A fatal scripting error occurred.

Incorrect syntax was encountered while parsing GO.

Dr. Network

unread,
Apr 3, 2006, 4:00:28 PM4/3/06
to
I found the problem. I was using an old script that had been set up for both Oracle and SQL Server to generate the views from metadata. The scripts were generating a CHAR(13) for carriage return without a CHAR(10) for line feed. This caused an error in Management Studio - but curiously not in Query Analyzer.
 
Is anybody else finding little idiosyncrasies in this that make Query Analyzer look still good? There are some things I really like in Management Studio but things like this drive me crazy. I really don't like that I can't script the DROP and PERMISSIONS when I script an object - at least I haven't found the configuration yet.
 
Chuck Hawkins

Dr. Network

unread,
Apr 3, 2006, 4:06:28 PM4/3/06
to
This was addressed in Bug ID FDBK44155.
 
Chuck Hawkins

zoz...@gmail.com

unread,
Mar 24, 2014, 7:44:48 AM3/24/14
to
i solved this problem by :

1- from sql management studio choose file
2- choose save as
3- from the button save --> choose save with encoding
4- click yes then change the line encoding to windows (CR LF)

i hope this help
0 new messages