Showing posts with label scripting. Show all posts
Showing posts with label scripting. Show all posts

Friday, March 9, 2012

Managment Studio Scripting options?

Am I missing something on options somewhere? With Enterprise Manager when you choose to script a stored procedure you had the option to say include a drop statement and security statements. In Management Studio I don't see these options. Just script a create OR a drop. Not both. I think this is a giant step backwards for the tool if it isn't present or can't be configured.Nevermind...I found it. It was in the Generate Scripts wizard off the database. Too bad this wasn't easily exposed from the context menu on specific object (like a stored procedure).|||

This seems like a lot of work to get a script with the options I want.

Why can't the IDE just drop script options in the query window like Query Analyzer did in the past?

Monday, February 20, 2012

Management Studio: Fatal Scripting Error

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.
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" <charles.hawkins@.jenzabar.net> wrote in message news:%23CIX4S1VGHA.5100@.TK2MSFTNGP11.phx.gbl...
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.
|||This was addressed in Bug ID FDBK44155.
Chuck Hawkins
"Dr. Network" <charles.hawkins@.jenzabar.net> wrote in message news:ucmK$k1VGHA.5592@.TK2MSFTNGP09.phx.gbl...
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" <charles.hawkins@.jenzabar.net> wrote in message news:%23CIX4S1VGHA.5100@.TK2MSFTNGP11.phx.gbl...
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.

Management Studio scripting options

Hi there,
Is there apossibility to set the options for script creation in SQL
Server 2005 Management Studio? I want to create a script with a drop
and create statement...
Regards
Roman
No there isn't, all you can do is one or the other at the moment. It was
somehow missed from the released version. Lots of people have complained
and I am sure it will be back in witht he next sp.
Andrew J. Kelly SQL MVP
"Roman Mellenberger" <roman.mellenberger@.info-research.ch> wrote in message
news:v9b4s1hgm6pta45ukfoh9ucnjgs8ubdl6t@.4ax.com...
> Hi there,
> Is there apossibility to set the options for script creation in SQL
> Server 2005 Management Studio? I want to create a script with a drop
> and create statement...
> Regards
> Roman
|||Perhaps Bill's utility can be useful?
http://www.sqlteam.com/item.asp?ItemID=23185
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Roman Mellenberger" <roman.mellenberger@.info-research.ch> wrote in message
news:v9b4s1hgm6pta45ukfoh9ucnjgs8ubdl6t@.4ax.com...
> Hi there,
> Is there apossibility to set the options for script creation in SQL
> Server 2005 Management Studio? I want to create a script with a drop
> and create statement...
> Regards
> Roman

Management Studio Scripting Bug?

In my install of management studio when I use the scripting wizard and get to the Choose Script Options dialog The Script Behavior drop down has only two options (Generate CREATE statements only, or Generate DROP statements only). It doesn't have the option to generate a drop followed by a create. If you read the description of the Script Behavior that is below the options you'll see that it advertises a Drop and create option. Why doesn't the dropdown have all three options? Bug or not?

Tongue TiedHello Mikewo

Thanks for posting this question.

We are aware of the misleading description, which is an error. The descriptiong will be fixed in our future release.

Unfortunately, the ability to generate drop followed by create is not supported by the Wizard. The work around is to first generated drop scripts & then generate create scripts.

Thank you,
[Venkat]
This posting is provided "AS IS" with no warranties, and confers no rights.|||Thanks for the reply Venkat. I think I will miss the ability to do the drop and create in the same script generation. Enterprise Manager's script wizard could do this. Hopefully some update in the future will put this ability back into the product.

Mikewo|||Yes, thank you for the reply.

I too would enjoy seeing that functionality back, 2 passes to accomplish 1 thing is monotonous.|||

Venkat,

And how long will we have to wait for this simplest and most useful option? I hope it will be available as a Global option, not on a database by database basis as it is now.

|||

In my opinion this is a bug. Obviously, based on the description the functionality was expected, and it is not provided.

Terry

|||

I've reported it as a bug since IMHO it is one (not working as documented). Title is:

Script Behavior in Script Wizard does not allow 3rd option

http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=605eb110-2335-4275-b440-5d299c484ebf

Add your vote on it if you think it is important to you.

|||Does that mean you will be bringing back the Crop followed by Create, or leaving it out? This is a very useful feature!|||

We consider it a bug, and we would appreciate the ability to create a drop and create statement in one pass. Additionally, it would be very useful to script ALL databases, logins, users and roles in one pass.

Kind regards

Titus

|||It seems to make perfect sense that the wizard SHOULD support the Drop/Create scenario. It's even a bit ridiculous that it doesn't! 2005 seems to be a step backward as far as the scripting wizard goes.|||

VenkatKrish wrote:

Hello Mikewo

Thanks for posting this question.

We are aware of the misleading description, which is an error. The descriptiong will be fixed in our future release.

Unfortunately, the ability to generate drop followed by create is not supported by the Wizard. The work around is to first generated drop scripts & then generate create scripts.

Thank you,
[Venkat]
This posting is provided "AS IS" with no warranties, and confers no rights.

Dear Venkat:

Thanks for the clarification. THE BUG IS NOT IN THE DESCRIPTION, THE BUG IS IN THE FUNCTIONALITY! When I push a revised batch of stored procedures to the production server, I can do it with the server on-line with scripts done via drop/create. I then have a small window of time that the system might claim a stored procedure is not present. This window is small enough to risk doing while users are in the database. This is not true if I have to do every updated SP as a mass of drops followed by a mass of creates. Then I have to take the applications off-line.

Please give us back the functionality we had soon!

Management Studio Scripting Bug?

In my install of management studio when I use the scripting wizard and get to the Choose Script Options dialog The Script Behavior drop down has only two options (Generate CREATE statements only, or Generate DROP statements only). It doesn't have the option to generate a drop followed by a create. If you read the description of the Script Behavior that is below the options you'll see that it advertises a Drop and create option. Why doesn't the dropdown have all three options? Bug or not?

Tongue TiedHello Mikewo

Thanks for posting this question.

We are aware of the misleading description, which is an error. The descriptiong will be fixed in our future release.

Unfortunately, the ability to generate drop followed by create is not supported by the Wizard. The work around is to first generated drop scripts & then generate create scripts.

Thank you,
[Venkat]
This posting is provided "AS IS" with no warranties, and confers no rights.|||Thanks for the reply Venkat. I think I will miss the ability to do the drop and create in the same script generation. Enterprise Manager's script wizard could do this. Hopefully some update in the future will put this ability back into the product.

Mikewo|||Yes, thank you for the reply.

I too would enjoy seeing that functionality back, 2 passes to accomplish 1 thing is monotonous.|||

Venkat,

And how long will we have to wait for this simplest and most useful option? I hope it will be available as a Global option, not on a database by database basis as it is now.

|||

In my opinion this is a bug. Obviously, based on the description the functionality was expected, and it is not provided.

Terry

|||

I've reported it as a bug since IMHO it is one (not working as documented). Title is:

Script Behavior in Script Wizard does not allow 3rd option

http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=605eb110-2335-4275-b440-5d299c484ebf

Add your vote on it if you think it is important to you.

|||Does that mean you will be bringing back the Crop followed by Create, or leaving it out? This is a very useful feature!|||

We consider it a bug, and we would appreciate the ability to create a drop and create statement in one pass. Additionally, it would be very useful to script ALL databases, logins, users and roles in one pass.

Kind regards

Titus

|||It seems to make perfect sense that the wizard SHOULD support the Drop/Create scenario. It's even a bit ridiculous that it doesn't! 2005 seems to be a step backward as far as the scripting wizard goes.|||

VenkatKrish wrote:

Hello Mikewo

Thanks for posting this question.

We are aware of the misleading description, which is an error. The descriptiong will be fixed in our future release.

Unfortunately, the ability to generate drop followed by create is not supported by the Wizard. The work around is to first generated drop scripts & then generate create scripts.

Thank you,
[Venkat]
This posting is provided "AS IS" with no warranties, and confers no rights.

Dear Venkat:

Thanks for the clarification. THE BUG IS NOT IN THE DESCRIPTION, THE BUG IS IN THE FUNCTIONALITY! When I push a revised batch of stored procedures to the production server, I can do it with the server on-line with scripts done via drop/create. I then have a small window of time that the system might claim a stored procedure is not present. This window is small enough to risk doing while users are in the database. This is not true if I have to do every updated SP as a mass of drops followed by a mass of creates. Then I have to take the applications off-line.

Please give us back the functionality we had soon!

Management Studio Scripting Bug?

In my install of management studio when I use the scripting wizard and get to the Choose Script Options dialog The Script Behavior drop down has only two options (Generate CREATE statements only, or Generate DROP statements only). It doesn't have the option to generate a drop followed by a create. If you read the description of the Script Behavior that is below the options you'll see that it advertises a Drop and create option. Why doesn't the dropdown have all three options? Bug or not?

Tongue TiedHello Mikewo

Thanks for posting this question.

We are aware of the misleading description, which is an error. The descriptiong will be fixed in our future release.

Unfortunately, the ability to generate drop followed by create is not supported by the Wizard. The work around is to first generated drop scripts & then generate create scripts.

Thank you,
[Venkat]
This posting is provided "AS IS" with no warranties, and confers no rights.|||Thanks for the reply Venkat. I think I will miss the ability to do the drop and create in the same script generation. Enterprise Manager's script wizard could do this. Hopefully some update in the future will put this ability back into the product.

Mikewo|||Yes, thank you for the reply.

I too would enjoy seeing that functionality back, 2 passes to accomplish 1 thing is monotonous.|||

Venkat,

And how long will we have to wait for this simplest and most useful option? I hope it will be available as a Global option, not on a database by database basis as it is now.

|||

In my opinion this is a bug. Obviously, based on the description the functionality was expected, and it is not provided.

Terry

|||

I've reported it as a bug since IMHO it is one (not working as documented). Title is:

Script Behavior in Script Wizard does not allow 3rd option

http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=605eb110-2335-4275-b440-5d299c484ebf

Add your vote on it if you think it is important to you.

|||Does that mean you will be bringing back the Crop followed by Create, or leaving it out? This is a very useful feature!|||

We consider it a bug, and we would appreciate the ability to create a drop and create statement in one pass. Additionally, it would be very useful to script ALL databases, logins, users and roles in one pass.

Kind regards

Titus

|||It seems to make perfect sense that the wizard SHOULD support the Drop/Create scenario. It's even a bit ridiculous that it doesn't! 2005 seems to be a step backward as far as the scripting wizard goes.|||

VenkatKrish wrote:

Hello Mikewo

Thanks for posting this question.

We are aware of the misleading description, which is an error. The descriptiong will be fixed in our future release.

Unfortunately, the ability to generate drop followed by create is not supported by the Wizard. The work around is to first generated drop scripts & then generate create scripts.

Thank you,
[Venkat]
This posting is provided "AS IS" with no warranties, and confers no rights.

Dear Venkat:

Thanks for the clarification. THE BUG IS NOT IN THE DESCRIPTION, THE BUG IS IN THE FUNCTIONALITY! When I push a revised batch of stored procedures to the production server, I can do it with the server on-line with scripts done via drop/create. I then have a small window of time that the system might claim a stored procedure is not present. This window is small enough to risk doing while users are in the database. This is not true if I have to do every updated SP as a mass of drops followed by a mass of creates. Then I have to take the applications off-line.

Please give us back the functionality we had soon!

Management Studio Scripting Bug?

In my install of management studio when I use the scripting wizard and get to the Choose Script Options dialog The Script Behavior drop down has only two options (Generate CREATE statements only, or Generate DROP statements only). It doesn't have the option to generate a drop followed by a create. If you read the description of the Script Behavior that is below the options you'll see that it advertises a Drop and create option. Why doesn't the dropdown have all three options? Bug or not?

Tongue TiedHello Mikewo

Thanks for posting this question.

We are aware of the misleading description, which is an error. The descriptiong will be fixed in our future release.

Unfortunately, the ability to generate drop followed by create is not supported by the Wizard. The work around is to first generated drop scripts & then generate create scripts.

Thank you,
[Venkat]
This posting is provided "AS IS" with no warranties, and confers no rights.|||Thanks for the reply Venkat. I think I will miss the ability to do the drop and create in the same script generation. Enterprise Manager's script wizard could do this. Hopefully some update in the future will put this ability back into the product.

Mikewo|||Yes, thank you for the reply.

I too would enjoy seeing that functionality back, 2 passes to accomplish 1 thing is monotonous.|||

Venkat,

And how long will we have to wait for this simplest and most useful option? I hope it will be available as a Global option, not on a database by database basis as it is now.

|||

In my opinion this is a bug. Obviously, based on the description the functionality was expected, and it is not provided.

Terry

|||

I've reported it as a bug since IMHO it is one (not working as documented). Title is:

Script Behavior in Script Wizard does not allow 3rd option

http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=605eb110-2335-4275-b440-5d299c484ebf

Add your vote on it if you think it is important to you.

|||Does that mean you will be bringing back the Crop followed by Create, or leaving it out? This is a very useful feature!|||

We consider it a bug, and we would appreciate the ability to create a drop and create statement in one pass. Additionally, it would be very useful to script ALL databases, logins, users and roles in one pass.

Kind regards

Titus

|||It seems to make perfect sense that the wizard SHOULD support the Drop/Create scenario. It's even a bit ridiculous that it doesn't! 2005 seems to be a step backward as far as the scripting wizard goes.|||

VenkatKrish wrote:

Hello Mikewo

Thanks for posting this question.

We are aware of the misleading description, which is an error. The descriptiong will be fixed in our future release.

Unfortunately, the ability to generate drop followed by create is not supported by the Wizard. The work around is to first generated drop scripts & then generate create scripts.

Thank you,
[Venkat]
This posting is provided "AS IS" with no warranties, and confers no rights.

Dear Venkat:

Thanks for the clarification. THE BUG IS NOT IN THE DESCRIPTION, THE BUG IS IN THE FUNCTIONALITY! When I push a revised batch of stored procedures to the production server, I can do it with the server on-line with scripts done via drop/create. I then have a small window of time that the system might claim a stored procedure is not present. This window is small enough to risk doing while users are in the database. This is not true if I have to do every updated SP as a mass of drops followed by a mass of creates. Then I have to take the applications off-line.

Please give us back the functionality we had soon!