Showing posts with label management. Show all posts
Showing posts with label management. Show all posts

Friday, March 23, 2012

Generating sql scripts

Hi,
Please guide me in generating sql scripts for table, with the drop
statements in it, from the management studio of sql 2005, Currently only
create statement is generating, and drop statement is not there in it.
Rupesh Mondal.
Make sure you have updated Management Studio till SP2 and configure this (Tools, Options,
Scripting).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Rupesh Mondal" <RupeshMondal@.discussions.microsoft.com> wrote in message
news:D3D0A2E4-87F3-432A-8614-3C146FB95243@.microsoft.com...
> Hi,
> Please guide me in generating sql scripts for table, with the drop
> statements in it, from the management studio of sql 2005, Currently only
> create statement is generating, and drop statement is not there in it.
> Rupesh Mondal.
|||But Mr.Tobor which option to set true in the scripting option, inorder to get
the drop statement in it, before the create statement.Please reply me ASAP
Rupesh Mondal.
"Tibor Karaszi" wrote:

> Make sure you have updated Management Studio till SP2 and configure this (Tools, Options,
> Scripting).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Rupesh Mondal" <RupeshMondal@.discussions.microsoft.com> wrote in message
> news:D3D0A2E4-87F3-432A-8614-3C146FB95243@.microsoft.com...
>
>

Generating sql scripts

Hi,
Please guide me in generating sql scripts for table, with the drop
statements in it, from the management studio of sql 2005, Currently only
create statement is generating, and drop statement is not there in it.
Rupesh Mondal.Make sure you have updated Management Studio till SP2 and configure this (Tools, Options,
Scripting).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Rupesh Mondal" <RupeshMondal@.discussions.microsoft.com> wrote in message
news:D3D0A2E4-87F3-432A-8614-3C146FB95243@.microsoft.com...
> Hi,
> Please guide me in generating sql scripts for table, with the drop
> statements in it, from the management studio of sql 2005, Currently only
> create statement is generating, and drop statement is not there in it.
> Rupesh Mondal.|||But Mr.Tobor which option to set true in the scripting option, inorder to get
the drop statement in it, before the create statement.Please reply me ASAP
Rupesh Mondal.
"Tibor Karaszi" wrote:
> Make sure you have updated Management Studio till SP2 and configure this (Tools, Options,
> Scripting).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Rupesh Mondal" <RupeshMondal@.discussions.microsoft.com> wrote in message
> news:D3D0A2E4-87F3-432A-8614-3C146FB95243@.microsoft.com...
> > Hi,
> >
> > Please guide me in generating sql scripts for table, with the drop
> > statements in it, from the management studio of sql 2005, Currently only
> > create statement is generating, and drop statement is not there in it.
> >
> > Rupesh Mondal.
>
>|||Oops, by error. I was certain this option was there but it seems it isn't. The closest one I can
find is the "Include IF NOT EXIST clause" which is a bit different.
I think this option is available at the SMO level, but that would require you to code your own
generate script application.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Rupesh Mondal" <RupeshMondal@.discussions.microsoft.com> wrote in message
news:FBD71B40-7CB5-49C5-B9E8-6DD298E4385D@.microsoft.com...
> But Mr.Tobor which option to set true in the scripting option, inorder to get
> the drop statement in it, before the create statement.Please reply me ASAP
> Rupesh Mondal.
> "Tibor Karaszi" wrote:
>> Make sure you have updated Management Studio till SP2 and configure this (Tools, Options,
>> Scripting).
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Rupesh Mondal" <RupeshMondal@.discussions.microsoft.com> wrote in message
>> news:D3D0A2E4-87F3-432A-8614-3C146FB95243@.microsoft.com...
>> > Hi,
>> >
>> > Please guide me in generating sql scripts for table, with the drop
>> > statements in it, from the management studio of sql 2005, Currently only
>> > create statement is generating, and drop statement is not there in it.
>> >
>> > Rupesh Mondal.
>>|||here's an open source app that will generate scripts - it would be a
starting point for you if you go that route:
http://www.codeplex.com/scriptdb
On Apr 19, 12:59 am, "Tibor Karaszi"
<tibor_please.no.email_kara...@.hotmail.nomail.com> wrote:
> Oops, by error. I was certain this option was there but it seems it isn't. The closest one I can
> find is the "Include IF NOT EXIST clause" which is a bit different.
> I think this option is available at the SMO level, but that would require you to code your owngeneratescriptapplication.
> --
> Tibor Karaszi,SQLServer MVPhttp://www.karaszi.com/sqlserver/default.asphttp://sqlblog.com/blogs/tibor_karaszi
> "Rupesh Mondal" <RupeshMon...@.discussions.microsoft.com> wrote in message
> news:FBD71B40-7CB5-49C5-B9E8-6DD298E4385D@.microsoft.com...
> > But Mr.Tobor which option to set true in the scripting option, inorder to get
> > the drop statement in it, before the create statement.Please reply me ASAP
> > Rupesh Mondal.
> > "Tibor Karaszi" wrote:
> >> Make sure you have updated Management Studio till SP2 and configure this (Tools, Options,
> >> Scripting).
> >> --
> >> Tibor Karaszi,SQLServer MVP
> >>http://www.karaszi.com/sqlserver/default.asp
> >>http://sqlblog.com/blogs/tibor_karaszi
> >> "Rupesh Mondal" <RupeshMon...@.discussions.microsoft.com> wrote in message
> >>news:D3D0A2E4-87F3-432A-8614-3C146FB95243@.microsoft.com...
> >> > Hi,
> >> > Please guide me in generatingsqlscripts for table, with the drop
> >> > statements in it, from the management studio ofsql2005, Currently only
> >> > create statement is generating, and drop statement is not there in it.
> >> > Rupesh Mondal.

Generating scripts, tables, views, procedures, roles...

Hi...

I'm trying to generate scripts in SQL Server Management Studio 2005.

When I choose 'Script all objects' I get an error when I try to execute it. When I generate the scripts in single files, only tables in one file, only views in one file etc. etc., the execution is succeded.

1) Why do I get an error when I try to execute the script containing tables, views, procedures in one file....?

2) I get an error in the view-file where one column is 'invalid' but I can see it in the view. A generated script should execute succesfully when it is generated one second ago on the same database and so on... Right?

Thanks....

Which exact error do you get ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

sorry, I cant reproduce the errors because my workbuddy has the day off...

But I remember it was one of the views with 2 columns in it, which caused the error: 'Invalid item on view...'

And the sequense in the script is wrong. For example I can see that the script are trying to create a view before the table is created?

|||

You may find that the Database Publishing Wizard offers you more functionality.

Database Publishing Wizard
http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en

|||Thomas, did you find a solution to your problem?

I have the same problem and Database Publishing Wizard does not work any better.

The CREATE VIEW is placed before the dependant tables in the script.

This ONLY happens when I'm trying to script a SQL Server 2005 Express db.

I run the script wizard in SQL Server Management Studio 2005.

SQL Server 2005 Express: 9.0.3042
SQL Server 2005: 9.0.1399

Thanks
Jonas
|||

Did you use the switch "create dependent objects" ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Yes I did.

I've now updated to sp2 (9.0.3042) on the SQL Server 2005 too - no difference. Except that the default value of "create dependant objects" in the script wizard is now false.

I can not include any image of the properties selected, but all are default exept the dependant switch which is true.

The final report start with:

Generate Script Progress

- Determining objects in database '....MDF' that will be scripted. (Success)

- dbo.AllDataView (Success)

- dbo.FindNewRawData (Success)

Which also shows that a View is created first of all objects.

Thanks

Jonas

Generating scripts, tables, views, procedures, roles...

Hi...

I'm trying to generate scripts in SQL Server Management Studio 2005.

When I choose 'Script all objects' I get an error when I try to execute it. When I generate the scripts in single files, only tables in one file, only views in one file etc. etc., the execution is succeded.

1) Why do I get an error when I try to execute the script containing tables, views, procedures in one file....?

2) I get an error in the view-file where one column is 'invalid' but I can see it in the view. A generated script should execute succesfully when it is generated one second ago on the same database and so on... Right?

Thanks....

Which exact error do you get ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

sorry, I cant reproduce the errors because my workbuddy has the day off...

But I remember it was one of the views with 2 columns in it, which caused the error: 'Invalid item on view...'

And the sequense in the script is wrong. For example I can see that the script are trying to create a view before the table is created?

|||

You may find that the Database Publishing Wizard offers you more functionality.

Database Publishing Wizard
http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en

|||Thomas, did you find a solution to your problem?

I have the same problem and Database Publishing Wizard does not work any better.

The CREATE VIEW is placed before the dependant tables in the script.

This ONLY happens when I'm trying to script a SQL Server 2005 Express db.

I run the script wizard in SQL Server Management Studio 2005.

SQL Server 2005 Express: 9.0.3042
SQL Server 2005: 9.0.1399

Thanks
Jonas
|||

Did you use the switch "create dependent objects" ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Yes I did.

I've now updated to sp2 (9.0.3042) on the SQL Server 2005 too - no difference. Except that the default value of "create dependant objects" in the script wizard is now false.

I can not include any image of the properties selected, but all are default exept the dependant switch which is true.

The final report start with:

Generate Script Progress

- Determining objects in database '....MDF' that will be scripted. (Success)

- dbo.AllDataView (Success)

- dbo.FindNewRawData (Success)

Which also shows that a View is created first of all objects.

Thanks

Jonas

Generating scripts, tables, views, procedures, roles...

Hi...

I'm trying to generate scripts in SQL Server Management Studio 2005.

When I choose 'Script all objects' I get an error when I try to execute it. When I generate the scripts in single files, only tables in one file, only views in one file etc. etc., the execution is succeded.

1) Why do I get an error when I try to execute the script containing tables, views, procedures in one file....?

2) I get an error in the view-file where one column is 'invalid' but I can see it in the view. A generated script should execute succesfully when it is generated one second ago on the same database and so on... Right?

Thanks....

Which exact error do you get ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

sorry, I cant reproduce the errors because my workbuddy has the day off...

But I remember it was one of the views with 2 columns in it, which caused the error: 'Invalid item on view...'

And the sequense in the script is wrong. For example I can see that the script are trying to create a view before the table is created?

|||

You may find that the Database Publishing Wizard offers you more functionality.

Database Publishing Wizard
http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en

|||Thomas, did you find a solution to your problem?

I have the same problem and Database Publishing Wizard does not work any better.

The CREATE VIEW is placed before the dependant tables in the script.

This ONLY happens when I'm trying to script a SQL Server 2005 Express db.

I run the script wizard in SQL Server Management Studio 2005.

SQL Server 2005 Express: 9.0.3042
SQL Server 2005: 9.0.1399

Thanks
Jonas
|||

Did you use the switch "create dependent objects" ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Yes I did.

I've now updated to sp2 (9.0.3042) on the SQL Server 2005 too - no difference. Except that the default value of "create dependant objects" in the script wizard is now false.

I can not include any image of the properties selected, but all are default exept the dependant switch which is true.

The final report start with:

Generate Script Progress

- Determining objects in database '....MDF' that will be scripted. (Success)

- dbo.AllDataView (Success)

- dbo.FindNewRawData (Success)

Which also shows that a View is created first of all objects.

Thanks

Jonas

Generating scripts in Management Studio

I'm using Management Studio to manage and interface with our Sql
Server 2000 servers. One thing that doesn't (to me) appear to work as
well is the object scripting. I know they deprecated things from EM
2000, that are now back in via SP2, but I'm not finding the useful
tools I previously enjoyed.
One thing I am having problems with is that the scripting behavior
performs AWFULLY. When I simply want to script an object (trigger,
table, etc.) to a new query editor window (like I previously could in
QA), it may take upwards of 30 seconds before what ends up being a
very short script is output to the query window. Why?
Unrelated to scripting, if my DB has a substantial number of stored
procs, it takes a LONG time for the list to appear. In EM / QA, it
would appear instantly.
Also, we used to be able to easily generate DROP statements at the top
of every script (table, trigger, proc, view, function, etc.). The only
way I see to do this, now, is to use the script wizard on the
database. If I want to quickly generate a single script, I don't want
to use a freaking wizard. Grrrr...
Finally, how can I get my table scripts to stop generating column-
level permissions? If an account has full access to a table, I really
don't care about the column-by-column access. I'm wondering if 'script
object level permissions' is adding to the LONG time it takes to
generate a script.
If anyone has tips on how to optimize the production of scripts,
please share. At this point, I kind of wish I had stayed with EM /
QA...
Ryan
> One thing I am having problems with is that the scripting behavior
> performs AWFULLY. When I simply want to script an object (trigger,
> table, etc.) to a new query editor window (like I previously could in
> QA), it may take upwards of 30 seconds before what ends up being a
> very short script is output to the query window. Why?
Object scripting in general is a poor performer. But I have only really
noticed this when scripting a lot of objects. For single objects this seems
to be pretty quick. To be honest though, my habit for most code-based
objects is to right-click, modify rather than script as > ... less clicks.
When I need to generate scripts for many objects, I don't use EM or SSMS at
all... I use SQL Compare from red-gate (there are other similarly capable
tools, e.g. Apex SQL diff, and a free one from Quest). Just compare your
database against an empty database and you will get a set of objects you can
script or nor script using checkboxes.
It is extremely fast and the only issue I've ever had is trying to create an
indexed view and stored procedure referencing it in the wrong order. My
solution to not running into that issue has been to script views/tables
first, then procedures/functions. A lot of other options are there too,
such as temporarily disabling DDL triggers.

> Unrelated to scripting, if my DB has a substantial number of stored
> procs, it takes a LONG time for the list to appear. In EM / QA, it
> would appear instantly.
As a test, I have a server in our data center with 400+ databases. Each
database has 354 stored procedures. Over a VPN I can repeatedly pick any
random database and expand the stored procedure list in about a second. And
this is a production system (so it's not just a set of empty databases with
no activity).
If you're not talking about stored procedure counts that are higher by an
order of magnitude or more, this may be a machine resource issue. Perhaps
in EM/QA this list would have appeared even faster for me. :-)
Aaron Bertrand
SQL Server MVP
|||Could your complaints be related to the INITIAL attempt to perform
something - in which case it is just all the frickin' .NET crap having to be
loaded/initialized.
TheSQLGuru
President
Indicium Resources, Inc.
"herlihyboy" <ryan.parmenter@.gmail.com> wrote in message
news:1184946663.951045.202120@.g4g2000hsf.googlegro ups.com...
> I'm using Management Studio to manage and interface with our Sql
> Server 2000 servers. One thing that doesn't (to me) appear to work as
> well is the object scripting. I know they deprecated things from EM
> 2000, that are now back in via SP2, but I'm not finding the useful
> tools I previously enjoyed.
> One thing I am having problems with is that the scripting behavior
> performs AWFULLY. When I simply want to script an object (trigger,
> table, etc.) to a new query editor window (like I previously could in
> QA), it may take upwards of 30 seconds before what ends up being a
> very short script is output to the query window. Why?
> Unrelated to scripting, if my DB has a substantial number of stored
> procs, it takes a LONG time for the list to appear. In EM / QA, it
> would appear instantly.
> Also, we used to be able to easily generate DROP statements at the top
> of every script (table, trigger, proc, view, function, etc.). The only
> way I see to do this, now, is to use the script wizard on the
> database. If I want to quickly generate a single script, I don't want
> to use a freaking wizard. Grrrr...
> Finally, how can I get my table scripts to stop generating column-
> level permissions? If an account has full access to a table, I really
> don't care about the column-by-column access. I'm wondering if 'script
> object level permissions' is adding to the LONG time it takes to
> generate a script.
> If anyone has tips on how to optimize the production of scripts,
> please share. At this point, I kind of wish I had stayed with EM /
> QA...
> Ryan
>
|||Probably not, I was scripting 300+ SPs and was watching the progress in the
script dialog to script them one by one, it was like molasses on a cold day.
Roman
Roman Rehak
http://sqlblog.com/blogs/roman_rehak
"TheSQLGuru" <kgboles@.earthlink.net> wrote in message
news:esXxMKvyHHA.2172@.TK2MSFTNGP06.phx.gbl...
> Could your complaints be related to the INITIAL attempt to perform
> something - in which case it is just all the frickin' .NET crap having to
> be loaded/initialized.
> --
> TheSQLGuru
> President
> Indicium Resources, Inc.
> "herlihyboy" <ryan.parmenter@.gmail.com> wrote in message
> news:1184946663.951045.202120@.g4g2000hsf.googlegro ups.com...
>

Generating scripts in Management Studio

I'm using Management Studio to manage and interface with our Sql
Server 2000 servers. One thing that doesn't (to me) appear to work as
well is the object scripting. I know they deprecated things from EM
2000, that are now back in via SP2, but I'm not finding the useful
tools I previously enjoyed.
One thing I am having problems with is that the scripting behavior
performs AWFULLY. When I simply want to script an object (trigger,
table, etc.) to a new query editor window (like I previously could in
QA), it may take upwards of 30 seconds before what ends up being a
very short script is output to the query window. Why?
Unrelated to scripting, if my DB has a substantial number of stored
procs, it takes a LONG time for the list to appear. In EM / QA, it
would appear instantly.
Also, we used to be able to easily generate DROP statements at the top
of every script (table, trigger, proc, view, function, etc.). The only
way I see to do this, now, is to use the script wizard on the
database. If I want to quickly generate a single script, I don't want
to use a freaking wizard. Grrrr...
Finally, how can I get my table scripts to stop generating column-
level permissions? If an account has full access to a table, I really
don't care about the column-by-column access. I'm wondering if 'script
object level permissions' is adding to the LONG time it takes to
generate a script.
If anyone has tips on how to optimize the production of scripts,
please share. At this point, I kind of wish I had stayed with EM /
QA...
Ryan> One thing I am having problems with is that the scripting behavior
> performs AWFULLY. When I simply want to script an object (trigger,
> table, etc.) to a new query editor window (like I previously could in
> QA), it may take upwards of 30 seconds before what ends up being a
> very short script is output to the query window. Why?
Object scripting in general is a poor performer. But I have only really
noticed this when scripting a lot of objects. For single objects this seems
to be pretty quick. To be honest though, my habit for most code-based
objects is to right-click, modify rather than script as > ... less clicks.
When I need to generate scripts for many objects, I don't use EM or SSMS at
all... I use SQL Compare from red-gate (there are other similarly capable
tools, e.g. Apex SQL diff, and a free one from Quest). Just compare your
database against an empty database and you will get a set of objects you can
script or nor script using checkboxes.
It is extremely fast and the only issue I've ever had is trying to create an
indexed view and stored procedure referencing it in the wrong order. My
solution to not running into that issue has been to script views/tables
first, then procedures/functions. A lot of other options are there too,
such as temporarily disabling DDL triggers.
> Unrelated to scripting, if my DB has a substantial number of stored
> procs, it takes a LONG time for the list to appear. In EM / QA, it
> would appear instantly.
As a test, I have a server in our data center with 400+ databases. Each
database has 354 stored procedures. Over a VPN I can repeatedly pick any
random database and expand the stored procedure list in about a second. And
this is a production system (so it's not just a set of empty databases with
no activity).
If you're not talking about stored procedure counts that are higher by an
order of magnitude or more, this may be a machine resource issue. Perhaps
in EM/QA this list would have appeared even faster for me. :-)
--
Aaron Bertrand
SQL Server MVP|||Could your complaints be related to the INITIAL attempt to perform
something - in which case it is just all the frickin' .NET crap having to be
loaded/initialized.
--
TheSQLGuru
President
Indicium Resources, Inc.
"herlihyboy" <ryan.parmenter@.gmail.com> wrote in message
news:1184946663.951045.202120@.g4g2000hsf.googlegroups.com...
> I'm using Management Studio to manage and interface with our Sql
> Server 2000 servers. One thing that doesn't (to me) appear to work as
> well is the object scripting. I know they deprecated things from EM
> 2000, that are now back in via SP2, but I'm not finding the useful
> tools I previously enjoyed.
> One thing I am having problems with is that the scripting behavior
> performs AWFULLY. When I simply want to script an object (trigger,
> table, etc.) to a new query editor window (like I previously could in
> QA), it may take upwards of 30 seconds before what ends up being a
> very short script is output to the query window. Why?
> Unrelated to scripting, if my DB has a substantial number of stored
> procs, it takes a LONG time for the list to appear. In EM / QA, it
> would appear instantly.
> Also, we used to be able to easily generate DROP statements at the top
> of every script (table, trigger, proc, view, function, etc.). The only
> way I see to do this, now, is to use the script wizard on the
> database. If I want to quickly generate a single script, I don't want
> to use a freaking wizard. Grrrr...
> Finally, how can I get my table scripts to stop generating column-
> level permissions? If an account has full access to a table, I really
> don't care about the column-by-column access. I'm wondering if 'script
> object level permissions' is adding to the LONG time it takes to
> generate a script.
> If anyone has tips on how to optimize the production of scripts,
> please share. At this point, I kind of wish I had stayed with EM /
> QA...
> Ryan
>|||Probably not, I was scripting 300+ SPs and was watching the progress in the
script dialog to script them one by one, it was like molasses on a cold day.
Roman
--
Roman Rehak
http://sqlblog.com/blogs/roman_rehak
"TheSQLGuru" <kgboles@.earthlink.net> wrote in message
news:esXxMKvyHHA.2172@.TK2MSFTNGP06.phx.gbl...
> Could your complaints be related to the INITIAL attempt to perform
> something - in which case it is just all the frickin' .NET crap having to
> be loaded/initialized.
> --
> TheSQLGuru
> President
> Indicium Resources, Inc.
> "herlihyboy" <ryan.parmenter@.gmail.com> wrote in message
> news:1184946663.951045.202120@.g4g2000hsf.googlegroups.com...
>> I'm using Management Studio to manage and interface with our Sql
>> Server 2000 servers. One thing that doesn't (to me) appear to work as
>> well is the object scripting. I know they deprecated things from EM
>> 2000, that are now back in via SP2, but I'm not finding the useful
>> tools I previously enjoyed.
>> One thing I am having problems with is that the scripting behavior
>> performs AWFULLY. When I simply want to script an object (trigger,
>> table, etc.) to a new query editor window (like I previously could in
>> QA), it may take upwards of 30 seconds before what ends up being a
>> very short script is output to the query window. Why?
>> Unrelated to scripting, if my DB has a substantial number of stored
>> procs, it takes a LONG time for the list to appear. In EM / QA, it
>> would appear instantly.
>> Also, we used to be able to easily generate DROP statements at the top
>> of every script (table, trigger, proc, view, function, etc.). The only
>> way I see to do this, now, is to use the script wizard on the
>> database. If I want to quickly generate a single script, I don't want
>> to use a freaking wizard. Grrrr...
>> Finally, how can I get my table scripts to stop generating column-
>> level permissions? If an account has full access to a table, I really
>> don't care about the column-by-column access. I'm wondering if 'script
>> object level permissions' is adding to the LONG time it takes to
>> generate a script.
>> If anyone has tips on how to optimize the production of scripts,
>> please share. At this point, I kind of wish I had stayed with EM /
>> QA...
>> Ryan
>

Generating scripts in Management Studio

I'm using Management Studio to manage and interface with our Sql
Server 2000 servers. One thing that doesn't (to me) appear to work as
well is the object scripting. I know they deprecated things from EM
2000, that are now back in via SP2, but I'm not finding the useful
tools I previously enjoyed.
One thing I am having problems with is that the scripting behavior
performs AWFULLY. When I simply want to script an object (trigger,
table, etc.) to a new query editor window (like I previously could in
QA), it may take upwards of 30 seconds before what ends up being a
very short script is output to the query window. Why?
Unrelated to scripting, if my DB has a substantial number of stored
procs, it takes a LONG time for the list to appear. In EM / QA, it
would appear instantly.
Also, we used to be able to easily generate DROP statements at the top
of every script (table, trigger, proc, view, function, etc.). The only
way I see to do this, now, is to use the script wizard on the
database. If I want to quickly generate a single script, I don't want
to use a freaking wizard. Grrrr...
Finally, how can I get my table scripts to stop generating column-
level permissions? If an account has full access to a table, I really
don't care about the column-by-column access. I'm wondering if 'script
object level permissions' is adding to the LONG time it takes to
generate a script.
If anyone has tips on how to optimize the production of scripts,
please share. At this point, I kind of wish I had stayed with EM /
QA...
Ryan> One thing I am having problems with is that the scripting behavior
> performs AWFULLY. When I simply want to script an object (trigger,
> table, etc.) to a new query editor window (like I previously could in
> QA), it may take upwards of 30 seconds before what ends up being a
> very short script is output to the query window. Why?
Object scripting in general is a poor performer. But I have only really
noticed this when scripting a lot of objects. For single objects this seems
to be pretty quick. To be honest though, my habit for most code-based
objects is to right-click, modify rather than script as > ... less clicks.
When I need to generate scripts for many objects, I don't use EM or SSMS at
all... I use SQL Compare from red-gate (there are other similarly capable
tools, e.g. Apex SQL diff, and a free one from Quest). Just compare your
database against an empty database and you will get a set of objects you can
script or nor script using checkboxes.
It is extremely fast and the only issue I've ever had is trying to create an
indexed view and stored procedure referencing it in the wrong order. My
solution to not running into that issue has been to script views/tables
first, then procedures/functions. A lot of other options are there too,
such as temporarily disabling DDL triggers.

> Unrelated to scripting, if my DB has a substantial number of stored
> procs, it takes a LONG time for the list to appear. In EM / QA, it
> would appear instantly.
As a test, I have a server in our data center with 400+ databases. Each
database has 354 stored procedures. Over a VPN I can repeatedly pick any
random database and expand the stored procedure list in about a second. And
this is a production system (so it's not just a set of empty databases with
no activity).
If you're not talking about stored procedure counts that are higher by an
order of magnitude or more, this may be a machine resource issue. Perhaps
in EM/QA this list would have appeared even faster for me. :-)
Aaron Bertrand
SQL Server MVP|||Could your complaints be related to the INITIAL attempt to perform
something - in which case it is just all the frickin' .NET crap having to be
loaded/initialized.
TheSQLGuru
President
Indicium Resources, Inc.
"herlihyboy" <ryan.parmenter@.gmail.com> wrote in message
news:1184946663.951045.202120@.g4g2000hsf.googlegroups.com...
> I'm using Management Studio to manage and interface with our Sql
> Server 2000 servers. One thing that doesn't (to me) appear to work as
> well is the object scripting. I know they deprecated things from EM
> 2000, that are now back in via SP2, but I'm not finding the useful
> tools I previously enjoyed.
> One thing I am having problems with is that the scripting behavior
> performs AWFULLY. When I simply want to script an object (trigger,
> table, etc.) to a new query editor window (like I previously could in
> QA), it may take upwards of 30 seconds before what ends up being a
> very short script is output to the query window. Why?
> Unrelated to scripting, if my DB has a substantial number of stored
> procs, it takes a LONG time for the list to appear. In EM / QA, it
> would appear instantly.
> Also, we used to be able to easily generate DROP statements at the top
> of every script (table, trigger, proc, view, function, etc.). The only
> way I see to do this, now, is to use the script wizard on the
> database. If I want to quickly generate a single script, I don't want
> to use a freaking wizard. Grrrr...
> Finally, how can I get my table scripts to stop generating column-
> level permissions? If an account has full access to a table, I really
> don't care about the column-by-column access. I'm wondering if 'script
> object level permissions' is adding to the LONG time it takes to
> generate a script.
> If anyone has tips on how to optimize the production of scripts,
> please share. At this point, I kind of wish I had stayed with EM /
> QA...
> Ryan
>|||Probably not, I was scripting 300+ SPs and was watching the progress in the
script dialog to script them one by one, it was like molasses on a cold day.
Roman
Roman Rehak
http://sqlblog.com/blogs/roman_rehak
"TheSQLGuru" <kgboles@.earthlink.net> wrote in message
news:esXxMKvyHHA.2172@.TK2MSFTNGP06.phx.gbl...
> Could your complaints be related to the INITIAL attempt to perform
> something - in which case it is just all the frickin' .NET crap having to
> be loaded/initialized.
> --
> TheSQLGuru
> President
> Indicium Resources, Inc.
> "herlihyboy" <ryan.parmenter@.gmail.com> wrote in message
> news:1184946663.951045.202120@.g4g2000hsf.googlegroups.com...
>

Monday, March 19, 2012

generating database scripts - VERY SLOW

Has anybody else experienced how long it takes to generate scripts from
Management Studio? I'm launching the wizard (right click database/ tasks /
generate scripts). The wizard takes me through a couple of screen to set my
options. I finally get to the window where it's processing the objects.
After 10 minutes, only 3 objects have been completed. A database with
hundreds of tables and views will take hours.
Is there any way to speed this up? Right clicking on a table or view and
generating the DDL for that one object only takes a few seconds.
It was never this slow in SQL Server 2000.The original release of SSMS was, yes, very slow. I think it is a bit
better in more recent builds, have you applied SP2 to your client tools?
"johnl" <johnl@.discussions.microsoft.com> wrote in message
news:7923D6FA-827E-4C50-85EE-64CCCEE21270@.microsoft.com...
> Has anybody else experienced how long it takes to generate scripts from
> Management Studio? I'm launching the wizard (right click database/ tasks
> /
> generate scripts). The wizard takes me through a couple of screen to set
> my
> options. I finally get to the window where it's processing the objects.
> After 10 minutes, only 3 objects have been completed. A database with
> hundreds of tables and views will take hours.
> Is there any way to speed this up? Right clicking on a table or view and
> generating the DDL for that one object only takes a few seconds.
> It was never this slow in SQL Server 2000.|||Not sure what version I'm at, don't know if this is SP2 or not?
Microsoft SQL Server Management Studio 9.00.3042.00|||That's SP2.
You can always find the service pack level by running
Select ServerProperty('ProductLevel')
Tom
"johnl" <johnl@.discussions.microsoft.com> wrote in message
news:C73B5E5D-5442-4619-BC54-75E697C9D733@.microsoft.com...
> Not sure what version I'm at, don't know if this is SP2 or not?
> Microsoft SQL Server Management Studio 9.00.3042.00
>|||> That's SP2.
> You can always find the service pack level by running
> Select ServerProperty('ProductLevel')
(But that doesn't tell you the version of client tools...)|||Several connect items I have reviewed seem to indicate that Microsoft thinks
they have solved this problem (or in a couple of cases, they mention some of
the issues brought up in the item, but not the speed). It is unclear after
reading them all whether they think they have fixed this in SP2 or the
typically vague "future release(s)"...
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=259838
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=125313
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=228719
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=126912
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=259838
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=262072
There are probably others; I did not perform an exhaustive search. Just
wanted to show you that you are not alone, and that some in Redmond seem to
think that it is fixed. :-)
"johnl" <johnl@.discussions.microsoft.com> wrote in message
news:C73B5E5D-5442-4619-BC54-75E697C9D733@.microsoft.com...
> Not sure what version I'm at, don't know if this is SP2 or not?
> Microsoft SQL Server Management Studio 9.00.3042.00
>|||True. Thanks for catching that.
"Aaron Bertrand [SQL Server]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eJK5jXBnIHA.1212@.TK2MSFTNGP05.phx.gbl...
>> That's SP2.
>> You can always find the service pack level by running
>> Select ServerProperty('ProductLevel')
> (But that doesn't tell you the version of client tools...)

Wednesday, March 7, 2012

Generate Scripts...

From SQL Server Management Studio, I can right click a database, select
Generate Scripts.. and then navigate through a wizard to script my database
objects.
Is it possible to schedule such an activity? I'd like to set up a schedule
to script all my database objects on a regular basis
tia
Terry Holland
Well, you could grab the script it runs using Profiler, and then create a
job that runs the same script.
Or you could just archive backups of the database at the same interval,
assuming size / disk space is not an issue.
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Terry Holland" <MSDNNospam248@.nospam.nospam> wrote in message
news:BBDE32F9-FC8F-48CE-9072-AF0BF23F23A0@.microsoft.com...
> From SQL Server Management Studio, I can right click a database, select
> Generate Scripts.. and then navigate through a wizard to script my
> database
> objects.
> Is it possible to schedule such an activity? I'd like to set up a
> schedule
> to script all my database objects on a regular basis
> tia
> Terry Holland
|||Hello,
You will have to use SQL DMO object using sp_OA* extended stored procedures.
Take a look into below URL for details.
http://www.databasejournal.com/features/mssql/article.php/2205291
Thanks
Hari
"Terry Holland" <MSDNNospam248@.nospam.nospam> wrote in message
news:BBDE32F9-FC8F-48CE-9072-AF0BF23F23A0@.microsoft.com...
> From SQL Server Management Studio, I can right click a database, select
> Generate Scripts.. and then navigate through a wizard to script my
> database
> objects.
> Is it possible to schedule such an activity? I'd like to set up a
> schedule
> to script all my database objects on a regular basis
> tia
> Terry Holland
|||You could also have a look here: http://www.elsasoft.org/tools.htm
there you will find a console app that will generate scripts for all
objects in any 2000 or 2005 database. it would be a simple matter to
schedule it to run every day using either Agent or a scheduled task in
windows.
On Apr 4, 6:31 am, "Hari Prasad" <hari_prasa...@.hotmail.com> wrote:[vbcol=seagreen]
> Hello,
> You will have to use SQL DMO object using sp_OA* extended stored procedures.
> Take a look into below URL for details.
> http://www.databasejournal.com/features/mssql/article.php/2205291
> Thanks
> Hari
> "Terry Holland" <MSDNNospam...@.nospam.nospam> wrote in message
> news:BBDE32F9-FC8F-48CE-9072-AF0BF23F23A0@.microsoft.com...
>
>
|||Aaron Bertrand [SQL Server MVP] (ten.xoc@.dnartreb.noraa) writes:
> Well, you could grab the script it runs using Profiler, and then create a
> job that runs the same script.
I don't think that would work, since there may be different objects from
day to day.
I would guess the best bet is to see what Integration Services can do. The
script wizard does not use SSIS, but the Copy Database Wizard do, and it
also scripts the database. (Nevermind that CDW is quite flaky.)
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

Generate Scripts option in SQL 2005 Management Studio

Did anyone even bother to test the Generate Scripts option for a database?

I changed the following options from their default setting:
"Include Descriptive Headers" = True
"Include if NOT EXISTS" = True
"Script for Server Version" = SQL Server 2000
"Script Indexes" = True

and scripted all Stored Procedures, Tables, User-defined functions, and Views

Problems:
1. Generates
IF NOT EXISTS (SELECT * FROM sys.objects ...
should be ...SELECT * FROM dbo.sysobjects ...

2. Generates
WITH (IGNORE_DUP_KEY = OFF) ...
on the indexes. That portion is incompatible with SQL 2000

3.Generates
EXEC sys.sp_addextendedproperty ...
should be EXEC dbo.sp_addextendedproperty ...

Is there a hotfix or patch to deal with these issues?

Additionally, the wizard only has options to generate Create statements or Drop statements. Where is the option to do both like the previous version had?

I hope patches and hotfixes are on their way soon.

Thanx,

Robert

Microsoft is aware of this problem and we are working on a fix.

Thanks

Grigory

|||Using SQL 2005 Management Studio, I need to script all selected SQL 2000 stored procedures sorted by the name of the stored procedure alphabetically. Using the script wizard, I select the stored procedures in the alphabetic listing, but it looks like the resulting script puts the stored procedures in some other rather random order. I used to be able to script in Enterprise Manager, but after installing SQL 2005 Management Studio with the SQL 2000 DTS Legacy addin, my Enterprise Manager will not work anymore. How may I create the alphabetic stored procedure script? Thank you.|||

I just wanted to add few more suggestions/annoyances in addition to those already mentioned regarding script generation that I have come across:

1. There could be a way to persist settings that one has chosen in the Generate Scripts dialog. IDEs are meant to boost productivity but how can this be achieved if one has to find each and every option whenever new script needs to be generated.

My suggestion: Make it possible to save script generation options. Better yet, save multiple sets of options as profiles - one to generate certain style of SQL 2000-compatible scripts, another for SQL 2005, etc. These profiles could then theoretically even be used for scripting using SMO :)

2. Is there any way to do the Generate Scripts type of thing on object level as it used to be in SQL 2000? While there are "Create To" and "Drop To" options on object level, these do not give any way to tune the scripts generation options. Its nonsence to be forced to go to the database level and start searching for the same object that I already had selected, in the wizard again!

My suggestion: Add ability to generate scripts in the same manner as the Generate Scripts task provides for single and/or multiple selected objects. The simple "Create To", "Drop To" are not enough. In my opinion SQL 2000 Enterprise Manager was much more streamlined in this sense.

I hope that fixes and additions will be available soon. Otherwise search for the tools that can create compatible scripts must begin...

Thanks

|||Hi,

Is there a patch for this problem yet?|||

Any update on this?

Also, the ability to drop and create in one step is missing even though the option descirption implies it should be avialable.

Can you provide a time frame for a solution?

Glenn

|||I noticed the same problems... Just take note that users will start to wonder... Visual Studio seems to get it right.|||

Grigoriy,

Any chance the fixes for the topics in this thread will make it into SP1?

I'm interested in the DROP/CREATE being generated together (which the GUI says is an option) and I'd like to see the one stored-procedure-per-file output come back.

Thanks.

|||

I'm not sure if I'm missing anything in the wizard, but is there an option to script all object to a seperate file as in 2000? That was phenomally useful.

|||Where did you set these scripting options? I am trying to script a large number of tables along with their non-clustered indexes. All the CREATE script gives me is the clustered index.|||

Hi Mark

If you're using SS Enterprise Manager:

Right click on a database > All Tasks > Generate SQL script... (this will open the "Generate SQL scripts" box). On the Options tab you'll find an option under Table Scripting Options called Script indexes.

For SS Management Studio:

Right click on a database > Tasks > Generate Scripts... (this will open the "Script Wizard"). Select a database > click Next > In "Choose Script Options", scroll down to the bottom where you will find the option to "Script Indexes".

Max

|||Thank you. I didn't even know there was a Generate Scripts wizard, probably because there is nothing about it in the BOL.|||

I just stumbled across this post. Thanks Max for the description of how to get at the Script Wizard.

I would also like to add my voice to the requests that the backwards compatibility issues with scripting to SQL Server 2000 be patched soon.

|||Has this stuff been fixed yet? why market it as a feature when you know it doesn't work. Now I'm screwed|||I'm just curious as to how this ever made it out of QA? I work in the dev dept of a mortgage wholesaler, building home grown .NET solutions. The kind of issues I've seen here and in other posts wouldn't make it past the first iteration. WTF?

Generate Scripts option in SQL 2005 Management Studio

Did anyone even bother to test the Generate Scripts option for a database?

I changed the following options from their default setting:
"Include Descriptive Headers" = True
"Include if NOT EXISTS" = True
"Script for Server Version" = SQL Server 2000
"Script Indexes" = True

and scripted all Stored Procedures, Tables, User-defined functions, and Views

Problems:
1. Generates
IF NOT EXISTS (SELECT * FROM sys.objects ...
should be ...SELECT * FROM dbo.sysobjects ...

2. Generates
WITH (IGNORE_DUP_KEY = OFF) ...
on the indexes. That portion is incompatible with SQL 2000

3.Generates
EXEC sys.sp_addextendedproperty ...
should be EXEC dbo.sp_addextendedproperty ...

Is there a hotfix or patch to deal with these issues?

Additionally, the wizard only has options to generate Create statements or Drop statements. Where is the option to do both like the previous version had?

I hope patches and hotfixes are on their way soon.

Thanx,

Robert

Microsoft is aware of this problem and we are working on a fix.

Thanks

Grigory

|||Using SQL 2005 Management Studio, I need to script all selected SQL 2000 stored procedures sorted by the name of the stored procedure alphabetically. Using the script wizard, I select the stored procedures in the alphabetic listing, but it looks like the resulting script puts the stored procedures in some other rather random order. I used to be able to script in Enterprise Manager, but after installing SQL 2005 Management Studio with the SQL 2000 DTS Legacy addin, my Enterprise Manager will not work anymore. How may I create the alphabetic stored procedure script? Thank you.|||

I just wanted to add few more suggestions/annoyances in addition to those already mentioned regarding script generation that I have come across:

1. There could be a way to persist settings that one has chosen in the Generate Scripts dialog. IDEs are meant to boost productivity but how can this be achieved if one has to find each and every option whenever new script needs to be generated.

My suggestion: Make it possible to save script generation options. Better yet, save multiple sets of options as profiles - one to generate certain style of SQL 2000-compatible scripts, another for SQL 2005, etc. These profiles could then theoretically even be used for scripting using SMO :)

2. Is there any way to do the Generate Scripts type of thing on object level as it used to be in SQL 2000? While there are "Create To" and "Drop To" options on object level, these do not give any way to tune the scripts generation options. Its nonsence to be forced to go to the database level and start searching for the same object that I already had selected, in the wizard again!

My suggestion: Add ability to generate scripts in the same manner as the Generate Scripts task provides for single and/or multiple selected objects. The simple "Create To", "Drop To" are not enough. In my opinion SQL 2000 Enterprise Manager was much more streamlined in this sense.

I hope that fixes and additions will be available soon. Otherwise search for the tools that can create compatible scripts must begin...

Thanks

|||Hi,

Is there a patch for this problem yet?
|||

Any update on this?

Also, the ability to drop and create in one step is missing even though the option descirption implies it should be avialable.

Can you provide a time frame for a solution?

Glenn

|||I noticed the same problems... Just take note that users will start to wonder... Visual Studio seems to get it right.|||

Grigoriy,

Any chance the fixes for the topics in this thread will make it into SP1?

I'm interested in the DROP/CREATE being generated together (which the GUI says is an option) and I'd like to see the one stored-procedure-per-file output come back.

Thanks.

|||

I'm not sure if I'm missing anything in the wizard, but is there an option to script all object to a seperate file as in 2000? That was phenomally useful.

|||Where did you set these scripting options? I am trying to script a large number of tables along with their non-clustered indexes. All the CREATE script gives me is the clustered index.|||

Hi Mark

If you're using SS Enterprise Manager:

Right click on a database > All Tasks > Generate SQL script... (this will open the "Generate SQL scripts" box). On the Options tab you'll find an option under Table Scripting Options called Script indexes.

For SS Management Studio:

Right click on a database > Tasks > Generate Scripts... (this will open the "Script Wizard"). Select a database > click Next > In "Choose Script Options", scroll down to the bottom where you will find the option to "Script Indexes".

Max

|||Thank you. I didn't even know there was a Generate Scripts wizard, probably because there is nothing about it in the BOL.|||

I just stumbled across this post. Thanks Max for the description of how to get at the Script Wizard.

I would also like to add my voice to the requests that the backwards compatibility issues with scripting to SQL Server 2000 be patched soon.

|||Has this stuff been fixed yet? why market it as a feature when you know it doesn't work. Now I'm screwed
|||I'm just curious as to how this ever made it out of QA? I work in the dev dept of a mortgage wholesaler, building home grown .NET solutions. The kind of issues I've seen here and in other posts wouldn't make it past the first iteration. WTF?

Generate Scripts option in SQL 2005 Management Studio

Did anyone even bother to test the Generate Scripts option for a database?

I changed the following options from their default setting:
"Include Descriptive Headers" = True
"Include if NOT EXISTS" = True
"Script for Server Version" = SQL Server 2000
"Script Indexes" = True

and scripted all Stored Procedures, Tables, User-defined functions, and Views

Problems:
1. Generates
IF NOT EXISTS (SELECT * FROM sys.objects ...
should be ...SELECT * FROM dbo.sysobjects ...

2. Generates
WITH (IGNORE_DUP_KEY = OFF) ...
on the indexes. That portion is incompatible with SQL 2000

3.Generates
EXEC sys.sp_addextendedproperty ...
should be EXEC dbo.sp_addextendedproperty ...

Is there a hotfix or patch to deal with these issues?

Additionally, the wizard only has options to generate Create statements or Drop statements. Where is the option to do both like the previous version had?

I hope patches and hotfixes are on their way soon.

Thanx,

Robert

Microsoft is aware of this problem and we are working on a fix.

Thanks

Grigory

|||Using SQL 2005 Management Studio, I need to script all selected SQL 2000 stored procedures sorted by the name of the stored procedure alphabetically. Using the script wizard, I select the stored procedures in the alphabetic listing, but it looks like the resulting script puts the stored procedures in some other rather random order. I used to be able to script in Enterprise Manager, but after installing SQL 2005 Management Studio with the SQL 2000 DTS Legacy addin, my Enterprise Manager will not work anymore. How may I create the alphabetic stored procedure script? Thank you.|||

I just wanted to add few more suggestions/annoyances in addition to those already mentioned regarding script generation that I have come across:

1. There could be a way to persist settings that one has chosen in the Generate Scripts dialog. IDEs are meant to boost productivity but how can this be achieved if one has to find each and every option whenever new script needs to be generated.

My suggestion: Make it possible to save script generation options. Better yet, save multiple sets of options as profiles - one to generate certain style of SQL 2000-compatible scripts, another for SQL 2005, etc. These profiles could then theoretically even be used for scripting using SMO :)

2. Is there any way to do the Generate Scripts type of thing on object level as it used to be in SQL 2000? While there are "Create To" and "Drop To" options on object level, these do not give any way to tune the scripts generation options. Its nonsence to be forced to go to the database level and start searching for the same object that I already had selected, in the wizard again!

My suggestion: Add ability to generate scripts in the same manner as the Generate Scripts task provides for single and/or multiple selected objects. The simple "Create To", "Drop To" are not enough. In my opinion SQL 2000 Enterprise Manager was much more streamlined in this sense.

I hope that fixes and additions will be available soon. Otherwise search for the tools that can create compatible scripts must begin...

Thanks

|||Hi,

Is there a patch for this problem yet?|||

Any update on this?

Also, the ability to drop and create in one step is missing even though the option descirption implies it should be avialable.

Can you provide a time frame for a solution?

Glenn

|||I noticed the same problems... Just take note that users will start to wonder... Visual Studio seems to get it right.|||

Grigoriy,

Any chance the fixes for the topics in this thread will make it into SP1?

I'm interested in the DROP/CREATE being generated together (which the GUI says is an option) and I'd like to see the one stored-procedure-per-file output come back.

Thanks.

|||

I'm not sure if I'm missing anything in the wizard, but is there an option to script all object to a seperate file as in 2000? That was phenomally useful.

|||Where did you set these scripting options? I am trying to script a large number of tables along with their non-clustered indexes. All the CREATE script gives me is the clustered index.|||

Hi Mark

If you're using SS Enterprise Manager:

Right click on a database > All Tasks > Generate SQL script... (this will open the "Generate SQL scripts" box). On the Options tab you'll find an option under Table Scripting Options called Script indexes.

For SS Management Studio:

Right click on a database > Tasks > Generate Scripts... (this will open the "Script Wizard"). Select a database > click Next > In "Choose Script Options", scroll down to the bottom where you will find the option to "Script Indexes".

Max

|||Thank you. I didn't even know there was a Generate Scripts wizard, probably because there is nothing about it in the BOL.|||

I just stumbled across this post. Thanks Max for the description of how to get at the Script Wizard.

I would also like to add my voice to the requests that the backwards compatibility issues with scripting to SQL Server 2000 be patched soon.

|||Has this stuff been fixed yet? why market it as a feature when you know it doesn't work. Now I'm screwed|||I'm just curious as to how this ever made it out of QA? I work in the dev dept of a mortgage wholesaler, building home grown .NET solutions. The kind of issues I've seen here and in other posts wouldn't make it past the first iteration. WTF?

Generate Scripts option in SQL 2005 Management Studio

Did anyone even bother to test the Generate Scripts option for a database?

I changed the following options from their default setting:
"Include Descriptive Headers" = True
"Include if NOT EXISTS" = True
"Script for Server Version" = SQL Server 2000
"Script Indexes" = True

and scripted all Stored Procedures, Tables, User-defined functions, and Views

Problems:
1. Generates
IF NOT EXISTS (SELECT * FROM sys.objects ...
should be ...SELECT * FROM dbo.sysobjects ...

2. Generates
WITH (IGNORE_DUP_KEY = OFF) ...
on the indexes. That portion is incompatible with SQL 2000

3.Generates
EXEC sys.sp_addextendedproperty ...
should be EXEC dbo.sp_addextendedproperty ...

Is there a hotfix or patch to deal with these issues?

Additionally, the wizard only has options to generate Create statements or Drop statements. Where is the option to do both like the previous version had?

I hope patches and hotfixes are on their way soon.

Thanx,

Robert

Microsoft is aware of this problem and we are working on a fix.

Thanks

Grigory

|||Using SQL 2005 Management Studio, I need to script all selected SQL 2000 stored procedures sorted by the name of the stored procedure alphabetically. Using the script wizard, I select the stored procedures in the alphabetic listing, but it looks like the resulting script puts the stored procedures in some other rather random order. I used to be able to script in Enterprise Manager, but after installing SQL 2005 Management Studio with the SQL 2000 DTS Legacy addin, my Enterprise Manager will not work anymore. How may I create the alphabetic stored procedure script? Thank you.|||

I just wanted to add few more suggestions/annoyances in addition to those already mentioned regarding script generation that I have come across:

1. There could be a way to persist settings that one has chosen in the Generate Scripts dialog. IDEs are meant to boost productivity but how can this be achieved if one has to find each and every option whenever new script needs to be generated.

My suggestion: Make it possible to save script generation options. Better yet, save multiple sets of options as profiles - one to generate certain style of SQL 2000-compatible scripts, another for SQL 2005, etc. These profiles could then theoretically even be used for scripting using SMO :)

2. Is there any way to do the Generate Scripts type of thing on object level as it used to be in SQL 2000? While there are "Create To" and "Drop To" options on object level, these do not give any way to tune the scripts generation options. Its nonsence to be forced to go to the database level and start searching for the same object that I already had selected, in the wizard again!

My suggestion: Add ability to generate scripts in the same manner as the Generate Scripts task provides for single and/or multiple selected objects. The simple "Create To", "Drop To" are not enough. In my opinion SQL 2000 Enterprise Manager was much more streamlined in this sense.

I hope that fixes and additions will be available soon. Otherwise search for the tools that can create compatible scripts must begin...

Thanks

|||Hi,

Is there a patch for this problem yet?|||

Any update on this?

Also, the ability to drop and create in one step is missing even though the option descirption implies it should be avialable.

Can you provide a time frame for a solution?

Glenn

|||I noticed the same problems... Just take note that users will start to wonder... Visual Studio seems to get it right.|||

Grigoriy,

Any chance the fixes for the topics in this thread will make it into SP1?

I'm interested in the DROP/CREATE being generated together (which the GUI says is an option) and I'd like to see the one stored-procedure-per-file output come back.

Thanks.

|||

I'm not sure if I'm missing anything in the wizard, but is there an option to script all object to a seperate file as in 2000? That was phenomally useful.

|||Where did you set these scripting options? I am trying to script a large number of tables along with their non-clustered indexes. All the CREATE script gives me is the clustered index.|||

Hi Mark

If you're using SS Enterprise Manager:

Right click on a database > All Tasks > Generate SQL script... (this will open the "Generate SQL scripts" box). On the Options tab you'll find an option under Table Scripting Options called Script indexes.

For SS Management Studio:

Right click on a database > Tasks > Generate Scripts... (this will open the "Script Wizard"). Select a database > click Next > In "Choose Script Options", scroll down to the bottom where you will find the option to "Script Indexes".

Max

|||Thank you. I didn't even know there was a Generate Scripts wizard, probably because there is nothing about it in the BOL.|||

I just stumbled across this post. Thanks Max for the description of how to get at the Script Wizard.

I would also like to add my voice to the requests that the backwards compatibility issues with scripting to SQL Server 2000 be patched soon.

|||Has this stuff been fixed yet? why market it as a feature when you know it doesn't work. Now I'm screwed|||I'm just curious as to how this ever made it out of QA? I work in the dev dept of a mortgage wholesaler, building home grown .NET solutions. The kind of issues I've seen here and in other posts wouldn't make it past the first iteration. WTF?

Generate Scripts option in SQL 2005 Management Studio

Did anyone even bother to test the Generate Scripts option for a database?

I changed the following options from their default setting:
"Include Descriptive Headers" = True
"Include if NOT EXISTS" = True
"Script for Server Version" = SQL Server 2000
"Script Indexes" = True

and scripted all Stored Procedures, Tables, User-defined functions, and Views

Problems:
1. Generates
IF NOT EXISTS (SELECT * FROM sys.objects ...
should be ...SELECT * FROM dbo.sysobjects ...

2. Generates
WITH (IGNORE_DUP_KEY = OFF) ...
on the indexes. That portion is incompatible with SQL 2000

3.Generates
EXEC sys.sp_addextendedproperty ...
should be EXEC dbo.sp_addextendedproperty ...

Is there a hotfix or patch to deal with these issues?

Additionally, the wizard only has options to generate Create statements or Drop statements. Where is the option to do both like the previous version had?

I hope patches and hotfixes are on their way soon.

Thanx,

Robert

Microsoft is aware of this problem and we are working on a fix.

Thanks

Grigory

|||Using SQL 2005 Management Studio, I need to script all selected SQL 2000 stored procedures sorted by the name of the stored procedure alphabetically. Using the script wizard, I select the stored procedures in the alphabetic listing, but it looks like the resulting script puts the stored procedures in some other rather random order. I used to be able to script in Enterprise Manager, but after installing SQL 2005 Management Studio with the SQL 2000 DTS Legacy addin, my Enterprise Manager will not work anymore. How may I create the alphabetic stored procedure script? Thank you.|||

I just wanted to add few more suggestions/annoyances in addition to those already mentioned regarding script generation that I have come across:

1. There could be a way to persist settings that one has chosen in the Generate Scripts dialog. IDEs are meant to boost productivity but how can this be achieved if one has to find each and every option whenever new script needs to be generated.

My suggestion: Make it possible to save script generation options. Better yet, save multiple sets of options as profiles - one to generate certain style of SQL 2000-compatible scripts, another for SQL 2005, etc. These profiles could then theoretically even be used for scripting using SMO :)

2. Is there any way to do the Generate Scripts type of thing on object level as it used to be in SQL 2000? While there are "Create To" and "Drop To" options on object level, these do not give any way to tune the scripts generation options. Its nonsence to be forced to go to the database level and start searching for the same object that I already had selected, in the wizard again!

My suggestion: Add ability to generate scripts in the same manner as the Generate Scripts task provides for single and/or multiple selected objects. The simple "Create To", "Drop To" are not enough. In my opinion SQL 2000 Enterprise Manager was much more streamlined in this sense.

I hope that fixes and additions will be available soon. Otherwise search for the tools that can create compatible scripts must begin...

Thanks

|||Hi,

Is there a patch for this problem yet?
|||

Any update on this?

Also, the ability to drop and create in one step is missing even though the option descirption implies it should be avialable.

Can you provide a time frame for a solution?

Glenn

|||I noticed the same problems... Just take note that users will start to wonder... Visual Studio seems to get it right.|||

Grigoriy,

Any chance the fixes for the topics in this thread will make it into SP1?

I'm interested in the DROP/CREATE being generated together (which the GUI says is an option) and I'd like to see the one stored-procedure-per-file output come back.

Thanks.

|||

I'm not sure if I'm missing anything in the wizard, but is there an option to script all object to a seperate file as in 2000? That was phenomally useful.

|||Where did you set these scripting options? I am trying to script a large number of tables along with their non-clustered indexes. All the CREATE script gives me is the clustered index.|||

Hi Mark

If you're using SS Enterprise Manager:

Right click on a database > All Tasks > Generate SQL script... (this will open the "Generate SQL scripts" box). On the Options tab you'll find an option under Table Scripting Options called Script indexes.

For SS Management Studio:

Right click on a database > Tasks > Generate Scripts... (this will open the "Script Wizard"). Select a database > click Next > In "Choose Script Options", scroll down to the bottom where you will find the option to "Script Indexes".

Max

|||Thank you. I didn't even know there was a Generate Scripts wizard, probably because there is nothing about it in the BOL.|||

I just stumbled across this post. Thanks Max for the description of how to get at the Script Wizard.

I would also like to add my voice to the requests that the backwards compatibility issues with scripting to SQL Server 2000 be patched soon.

|||Has this stuff been fixed yet? why market it as a feature when you know it doesn't work. Now I'm screwed
|||I'm just curious as to how this ever made it out of QA? I work in the dev dept of a mortgage wholesaler, building home grown .NET solutions. The kind of issues I've seen here and in other posts wouldn't make it past the first iteration. WTF?

Generate Scripts option in SQL 2005 Management Studio

Did anyone even bother to test the Generate Scripts option for a database?

I changed the following options from their default setting:
"Include Descriptive Headers" = True
"Include if NOT EXISTS" = True
"Script for Server Version" = SQL Server 2000
"Script Indexes" = True

and scripted all Stored Procedures, Tables, User-defined functions, and Views

Problems:
1. Generates
IF NOT EXISTS (SELECT * FROM sys.objects ...
should be ...SELECT * FROM dbo.sysobjects ...

2. Generates
WITH (IGNORE_DUP_KEY = OFF) ...
on the indexes. That portion is incompatible with SQL 2000

3.Generates
EXEC sys.sp_addextendedproperty ...
should be EXEC dbo.sp_addextendedproperty ...

Is there a hotfix or patch to deal with these issues?

Additionally, the wizard only has options to generate Create statements or Drop statements. Where is the option to do both like the previous version had?

I hope patches and hotfixes are on their way soon.

Thanx,

Robert

Microsoft is aware of this problem and we are working on a fix.

Thanks

Grigory

|||Using SQL 2005 Management Studio, I need to script all selected SQL 2000 stored procedures sorted by the name of the stored procedure alphabetically. Using the script wizard, I select the stored procedures in the alphabetic listing, but it looks like the resulting script puts the stored procedures in some other rather random order. I used to be able to script in Enterprise Manager, but after installing SQL 2005 Management Studio with the SQL 2000 DTS Legacy addin, my Enterprise Manager will not work anymore. How may I create the alphabetic stored procedure script? Thank you.|||

I just wanted to add few more suggestions/annoyances in addition to those already mentioned regarding script generation that I have come across:

1. There could be a way to persist settings that one has chosen in the Generate Scripts dialog. IDEs are meant to boost productivity but how can this be achieved if one has to find each and every option whenever new script needs to be generated.

My suggestion: Make it possible to save script generation options. Better yet, save multiple sets of options as profiles - one to generate certain style of SQL 2000-compatible scripts, another for SQL 2005, etc. These profiles could then theoretically even be used for scripting using SMO :)

2. Is there any way to do the Generate Scripts type of thing on object level as it used to be in SQL 2000? While there are "Create To" and "Drop To" options on object level, these do not give any way to tune the scripts generation options. Its nonsence to be forced to go to the database level and start searching for the same object that I already had selected, in the wizard again!

My suggestion: Add ability to generate scripts in the same manner as the Generate Scripts task provides for single and/or multiple selected objects. The simple "Create To", "Drop To" are not enough. In my opinion SQL 2000 Enterprise Manager was much more streamlined in this sense.

I hope that fixes and additions will be available soon. Otherwise search for the tools that can create compatible scripts must begin...

Thanks

|||Hi,

Is there a patch for this problem yet?|||

Any update on this?

Also, the ability to drop and create in one step is missing even though the option descirption implies it should be avialable.

Can you provide a time frame for a solution?

Glenn

|||I noticed the same problems... Just take note that users will start to wonder... Visual Studio seems to get it right.|||

Grigoriy,

Any chance the fixes for the topics in this thread will make it into SP1?

I'm interested in the DROP/CREATE being generated together (which the GUI says is an option) and I'd like to see the one stored-procedure-per-file output come back.

Thanks.

|||

I'm not sure if I'm missing anything in the wizard, but is there an option to script all object to a seperate file as in 2000? That was phenomally useful.

|||Where did you set these scripting options? I am trying to script a large number of tables along with their non-clustered indexes. All the CREATE script gives me is the clustered index.|||

Hi Mark

If you're using SS Enterprise Manager:

Right click on a database > All Tasks > Generate SQL script... (this will open the "Generate SQL scripts" box). On the Options tab you'll find an option under Table Scripting Options called Script indexes.

For SS Management Studio:

Right click on a database > Tasks > Generate Scripts... (this will open the "Script Wizard"). Select a database > click Next > In "Choose Script Options", scroll down to the bottom where you will find the option to "Script Indexes".

Max

|||Thank you. I didn't even know there was a Generate Scripts wizard, probably because there is nothing about it in the BOL.|||

I just stumbled across this post. Thanks Max for the description of how to get at the Script Wizard.

I would also like to add my voice to the requests that the backwards compatibility issues with scripting to SQL Server 2000 be patched soon.

|||Has this stuff been fixed yet? why market it as a feature when you know it doesn't work. Now I'm screwed|||I'm just curious as to how this ever made it out of QA? I work in the dev dept of a mortgage wholesaler, building home grown .NET solutions. The kind of issues I've seen here and in other posts wouldn't make it past the first iteration. WTF?

Generate Scripts option in SQL 2005 Management Studio

Did anyone even bother to test the Generate Scripts option for a database?

I changed the following options from their default setting:
"Include Descriptive Headers" = True
"Include if NOT EXISTS" = True
"Script for Server Version" = SQL Server 2000
"Script Indexes" = True

and scripted all Stored Procedures, Tables, User-defined functions, and Views

Problems:
1. Generates
IF NOT EXISTS (SELECT * FROM sys.objects ...
should be ...SELECT * FROM dbo.sysobjects ...

2. Generates
WITH (IGNORE_DUP_KEY = OFF) ...
on the indexes. That portion is incompatible with SQL 2000

3.Generates
EXEC sys.sp_addextendedproperty ...
should be EXEC dbo.sp_addextendedproperty ...

Is there a hotfix or patch to deal with these issues?

Additionally, the wizard only has options to generate Create statements or Drop statements. Where is the option to do both like the previous version had?

I hope patches and hotfixes are on their way soon.

Thanx,

Robert

Microsoft is aware of this problem and we are working on a fix.

Thanks

Grigory

|||Using SQL 2005 Management Studio, I need to script all selected SQL 2000 stored procedures sorted by the name of the stored procedure alphabetically. Using the script wizard, I select the stored procedures in the alphabetic listing, but it looks like the resulting script puts the stored procedures in some other rather random order. I used to be able to script in Enterprise Manager, but after installing SQL 2005 Management Studio with the SQL 2000 DTS Legacy addin, my Enterprise Manager will not work anymore. How may I create the alphabetic stored procedure script? Thank you.|||

I just wanted to add few more suggestions/annoyances in addition to those already mentioned regarding script generation that I have come across:

1. There could be a way to persist settings that one has chosen in the Generate Scripts dialog. IDEs are meant to boost productivity but how can this be achieved if one has to find each and every option whenever new script needs to be generated.

My suggestion: Make it possible to save script generation options. Better yet, save multiple sets of options as profiles - one to generate certain style of SQL 2000-compatible scripts, another for SQL 2005, etc. These profiles could then theoretically even be used for scripting using SMO :)

2. Is there any way to do the Generate Scripts type of thing on object level as it used to be in SQL 2000? While there are "Create To" and "Drop To" options on object level, these do not give any way to tune the scripts generation options. Its nonsence to be forced to go to the database level and start searching for the same object that I already had selected, in the wizard again!

My suggestion: Add ability to generate scripts in the same manner as the Generate Scripts task provides for single and/or multiple selected objects. The simple "Create To", "Drop To" are not enough. In my opinion SQL 2000 Enterprise Manager was much more streamlined in this sense.

I hope that fixes and additions will be available soon. Otherwise search for the tools that can create compatible scripts must begin...

Thanks

|||Hi,

Is there a patch for this problem yet?
|||

Any update on this?

Also, the ability to drop and create in one step is missing even though the option descirption implies it should be avialable.

Can you provide a time frame for a solution?

Glenn

|||I noticed the same problems... Just take note that users will start to wonder... Visual Studio seems to get it right.|||

Grigoriy,

Any chance the fixes for the topics in this thread will make it into SP1?

I'm interested in the DROP/CREATE being generated together (which the GUI says is an option) and I'd like to see the one stored-procedure-per-file output come back.

Thanks.

|||

I'm not sure if I'm missing anything in the wizard, but is there an option to script all object to a seperate file as in 2000? That was phenomally useful.

|||Where did you set these scripting options? I am trying to script a large number of tables along with their non-clustered indexes. All the CREATE script gives me is the clustered index.|||

Hi Mark

If you're using SS Enterprise Manager:

Right click on a database > All Tasks > Generate SQL script... (this will open the "Generate SQL scripts" box). On the Options tab you'll find an option under Table Scripting Options called Script indexes.

For SS Management Studio:

Right click on a database > Tasks > Generate Scripts... (this will open the "Script Wizard"). Select a database > click Next > In "Choose Script Options", scroll down to the bottom where you will find the option to "Script Indexes".

Max

|||Thank you. I didn't even know there was a Generate Scripts wizard, probably because there is nothing about it in the BOL.|||

I just stumbled across this post. Thanks Max for the description of how to get at the Script Wizard.

I would also like to add my voice to the requests that the backwards compatibility issues with scripting to SQL Server 2000 be patched soon.

|||Has this stuff been fixed yet? why market it as a feature when you know it doesn't work. Now I'm screwed
|||I'm just curious as to how this ever made it out of QA? I work in the dev dept of a mortgage wholesaler, building home grown .NET solutions. The kind of issues I've seen here and in other posts wouldn't make it past the first iteration. WTF?

Generate Scripts option in SQL 2005 Management Studio

Did anyone even bother to test the Generate Scripts option for a database?

I changed the following options from their default setting:
"Include Descriptive Headers" = True
"Include if NOT EXISTS" = True
"Script for Server Version" = SQL Server 2000
"Script Indexes" = True

and scripted all Stored Procedures, Tables, User-defined functions, and Views

Problems:
1. Generates
IF NOT EXISTS (SELECT * FROM sys.objects ...
should be ...SELECT * FROM dbo.sysobjects ...

2. Generates
WITH (IGNORE_DUP_KEY = OFF) ...
on the indexes. That portion is incompatible with SQL 2000

3.Generates
EXEC sys.sp_addextendedproperty ...
should be EXEC dbo.sp_addextendedproperty ...

Is there a hotfix or patch to deal with these issues?

Additionally, the wizard only has options to generate Create statements or Drop statements. Where is the option to do both like the previous version had?

I hope patches and hotfixes are on their way soon.

Thanx,

Robert

Microsoft is aware of this problem and we are working on a fix.

Thanks

Grigory

|||Using SQL 2005 Management Studio, I need to script all selected SQL 2000 stored procedures sorted by the name of the stored procedure alphabetically. Using the script wizard, I select the stored procedures in the alphabetic listing, but it looks like the resulting script puts the stored procedures in some other rather random order. I used to be able to script in Enterprise Manager, but after installing SQL 2005 Management Studio with the SQL 2000 DTS Legacy addin, my Enterprise Manager will not work anymore. How may I create the alphabetic stored procedure script? Thank you.|||

I just wanted to add few more suggestions/annoyances in addition to those already mentioned regarding script generation that I have come across:

1. There could be a way to persist settings that one has chosen in the Generate Scripts dialog. IDEs are meant to boost productivity but how can this be achieved if one has to find each and every option whenever new script needs to be generated.

My suggestion: Make it possible to save script generation options. Better yet, save multiple sets of options as profiles - one to generate certain style of SQL 2000-compatible scripts, another for SQL 2005, etc. These profiles could then theoretically even be used for scripting using SMO :)

2. Is there any way to do the Generate Scripts type of thing on object level as it used to be in SQL 2000? While there are "Create To" and "Drop To" options on object level, these do not give any way to tune the scripts generation options. Its nonsence to be forced to go to the database level and start searching for the same object that I already had selected, in the wizard again!

My suggestion: Add ability to generate scripts in the same manner as the Generate Scripts task provides for single and/or multiple selected objects. The simple "Create To", "Drop To" are not enough. In my opinion SQL 2000 Enterprise Manager was much more streamlined in this sense.

I hope that fixes and additions will be available soon. Otherwise search for the tools that can create compatible scripts must begin...

Thanks

|||Hi,

Is there a patch for this problem yet?
|||

Any update on this?

Also, the ability to drop and create in one step is missing even though the option descirption implies it should be avialable.

Can you provide a time frame for a solution?

Glenn

|||I noticed the same problems... Just take note that users will start to wonder... Visual Studio seems to get it right.|||

Grigoriy,

Any chance the fixes for the topics in this thread will make it into SP1?

I'm interested in the DROP/CREATE being generated together (which the GUI says is an option) and I'd like to see the one stored-procedure-per-file output come back.

Thanks.

|||

I'm not sure if I'm missing anything in the wizard, but is there an option to script all object to a seperate file as in 2000? That was phenomally useful.

|||Where did you set these scripting options? I am trying to script a large number of tables along with their non-clustered indexes. All the CREATE script gives me is the clustered index.|||

Hi Mark

If you're using SS Enterprise Manager:

Right click on a database > All Tasks > Generate SQL script... (this will open the "Generate SQL scripts" box). On the Options tab you'll find an option under Table Scripting Options called Script indexes.

For SS Management Studio:

Right click on a database > Tasks > Generate Scripts... (this will open the "Script Wizard"). Select a database > click Next > In "Choose Script Options", scroll down to the bottom where you will find the option to "Script Indexes".

Max

|||Thank you. I didn't even know there was a Generate Scripts wizard, probably because there is nothing about it in the BOL.|||

I just stumbled across this post. Thanks Max for the description of how to get at the Script Wizard.

I would also like to add my voice to the requests that the backwards compatibility issues with scripting to SQL Server 2000 be patched soon.

|||Has this stuff been fixed yet? why market it as a feature when you know it doesn't work. Now I'm screwed
|||I'm just curious as to how this ever made it out of QA? I work in the dev dept of a mortgage wholesaler, building home grown .NET solutions. The kind of issues I've seen here and in other posts wouldn't make it past the first iteration. WTF?

Generate Scripts option in SQL 2005 Management Studio

Did anyone even bother to test the Generate Scripts option for a database?

I changed the following options from their default setting:
"Include Descriptive Headers" = True
"Include if NOT EXISTS" = True
"Script for Server Version" = SQL Server 2000
"Script Indexes" = True

and scripted all Stored Procedures, Tables, User-defined functions, and Views

Problems:
1. Generates
IF NOT EXISTS (SELECT * FROM sys.objects ...
should be ...SELECT * FROM dbo.sysobjects ...

2. Generates
WITH (IGNORE_DUP_KEY = OFF) ...
on the indexes. That portion is incompatible with SQL 2000

3.Generates
EXEC sys.sp_addextendedproperty ...
should be EXEC dbo.sp_addextendedproperty ...

Is there a hotfix or patch to deal with these issues?

Additionally, the wizard only has options to generate Create statements or Drop statements. Where is the option to do both like the previous version had?

I hope patches and hotfixes are on their way soon.

Thanx,

Robert

Microsoft is aware of this problem and we are working on a fix.

Thanks

Grigory

|||Using SQL 2005 Management Studio, I need to script all selected SQL 2000 stored procedures sorted by the name of the stored procedure alphabetically. Using the script wizard, I select the stored procedures in the alphabetic listing, but it looks like the resulting script puts the stored procedures in some other rather random order. I used to be able to script in Enterprise Manager, but after installing SQL 2005 Management Studio with the SQL 2000 DTS Legacy addin, my Enterprise Manager will not work anymore. How may I create the alphabetic stored procedure script? Thank you.|||

I just wanted to add few more suggestions/annoyances in addition to those already mentioned regarding script generation that I have come across:

1. There could be a way to persist settings that one has chosen in the Generate Scripts dialog. IDEs are meant to boost productivity but how can this be achieved if one has to find each and every option whenever new script needs to be generated.

My suggestion: Make it possible to save script generation options. Better yet, save multiple sets of options as profiles - one to generate certain style of SQL 2000-compatible scripts, another for SQL 2005, etc. These profiles could then theoretically even be used for scripting using SMO :)

2. Is there any way to do the Generate Scripts type of thing on object level as it used to be in SQL 2000? While there are "Create To" and "Drop To" options on object level, these do not give any way to tune the scripts generation options. Its nonsence to be forced to go to the database level and start searching for the same object that I already had selected, in the wizard again!

My suggestion: Add ability to generate scripts in the same manner as the Generate Scripts task provides for single and/or multiple selected objects. The simple "Create To", "Drop To" are not enough. In my opinion SQL 2000 Enterprise Manager was much more streamlined in this sense.

I hope that fixes and additions will be available soon. Otherwise search for the tools that can create compatible scripts must begin...

Thanks

|||Hi,

Is there a patch for this problem yet?
|||

Any update on this?

Also, the ability to drop and create in one step is missing even though the option descirption implies it should be avialable.

Can you provide a time frame for a solution?

Glenn

|||I noticed the same problems... Just take note that users will start to wonder... Visual Studio seems to get it right.|||

Grigoriy,

Any chance the fixes for the topics in this thread will make it into SP1?

I'm interested in the DROP/CREATE being generated together (which the GUI says is an option) and I'd like to see the one stored-procedure-per-file output come back.

Thanks.

|||

I'm not sure if I'm missing anything in the wizard, but is there an option to script all object to a seperate file as in 2000? That was phenomally useful.

|||Where did you set these scripting options? I am trying to script a large number of tables along with their non-clustered indexes. All the CREATE script gives me is the clustered index.|||

Hi Mark

If you're using SS Enterprise Manager:

Right click on a database > All Tasks > Generate SQL script... (this will open the "Generate SQL scripts" box). On the Options tab you'll find an option under Table Scripting Options called Script indexes.

For SS Management Studio:

Right click on a database > Tasks > Generate Scripts... (this will open the "Script Wizard"). Select a database > click Next > In "Choose Script Options", scroll down to the bottom where you will find the option to "Script Indexes".

Max

|||Thank you. I didn't even know there was a Generate Scripts wizard, probably because there is nothing about it in the BOL.|||

I just stumbled across this post. Thanks Max for the description of how to get at the Script Wizard.

I would also like to add my voice to the requests that the backwards compatibility issues with scripting to SQL Server 2000 be patched soon.

|||Has this stuff been fixed yet? why market it as a feature when you know it doesn't work. Now I'm screwed
|||I'm just curious as to how this ever made it out of QA? I work in the dev dept of a mortgage wholesaler, building home grown .NET solutions. The kind of issues I've seen here and in other posts wouldn't make it past the first iteration. WTF?

Generate Scripts option in SQL 2005 Management Studio

Did anyone even bother to test the Generate Scripts option for a database?

I changed the following options from their default setting:
"Include Descriptive Headers" = True
"Include if NOT EXISTS" = True
"Script for Server Version" = SQL Server 2000
"Script Indexes" = True

and scripted all Stored Procedures, Tables, User-defined functions, and Views

Problems:
1. Generates
IF NOT EXISTS (SELECT * FROM sys.objects ...
should be ...SELECT * FROM dbo.sysobjects ...

2. Generates
WITH (IGNORE_DUP_KEY = OFF) ...
on the indexes. That portion is incompatible with SQL 2000

3.Generates
EXEC sys.sp_addextendedproperty ...
should be EXEC dbo.sp_addextendedproperty ...

Is there a hotfix or patch to deal with these issues?

Additionally, the wizard only has options to generate Create statements or Drop statements. Where is the option to do both like the previous version had?

I hope patches and hotfixes are on their way soon.

Thanx,

Robert

Microsoft is aware of this problem and we are working on a fix.

Thanks

Grigory

|||Using SQL 2005 Management Studio, I need to script all selected SQL 2000 stored procedures sorted by the name of the stored procedure alphabetically. Using the script wizard, I select the stored procedures in the alphabetic listing, but it looks like the resulting script puts the stored procedures in some other rather random order. I used to be able to script in Enterprise Manager, but after installing SQL 2005 Management Studio with the SQL 2000 DTS Legacy addin, my Enterprise Manager will not work anymore. How may I create the alphabetic stored procedure script? Thank you.|||

I just wanted to add few more suggestions/annoyances in addition to those already mentioned regarding script generation that I have come across:

1. There could be a way to persist settings that one has chosen in the Generate Scripts dialog. IDEs are meant to boost productivity but how can this be achieved if one has to find each and every option whenever new script needs to be generated.

My suggestion: Make it possible to save script generation options. Better yet, save multiple sets of options as profiles - one to generate certain style of SQL 2000-compatible scripts, another for SQL 2005, etc. These profiles could then theoretically even be used for scripting using SMO :)

2. Is there any way to do the Generate Scripts type of thing on object level as it used to be in SQL 2000? While there are "Create To" and "Drop To" options on object level, these do not give any way to tune the scripts generation options. Its nonsence to be forced to go to the database level and start searching for the same object that I already had selected, in the wizard again!

My suggestion: Add ability to generate scripts in the same manner as the Generate Scripts task provides for single and/or multiple selected objects. The simple "Create To", "Drop To" are not enough. In my opinion SQL 2000 Enterprise Manager was much more streamlined in this sense.

I hope that fixes and additions will be available soon. Otherwise search for the tools that can create compatible scripts must begin...

Thanks

|||Hi,

Is there a patch for this problem yet?|||

Any update on this?

Also, the ability to drop and create in one step is missing even though the option descirption implies it should be avialable.

Can you provide a time frame for a solution?

Glenn

|||I noticed the same problems... Just take note that users will start to wonder... Visual Studio seems to get it right.|||

Grigoriy,

Any chance the fixes for the topics in this thread will make it into SP1?

I'm interested in the DROP/CREATE being generated together (which the GUI says is an option) and I'd like to see the one stored-procedure-per-file output come back.

Thanks.

|||

I'm not sure if I'm missing anything in the wizard, but is there an option to script all object to a seperate file as in 2000? That was phenomally useful.

|||Where did you set these scripting options? I am trying to script a large number of tables along with their non-clustered indexes. All the CREATE script gives me is the clustered index.|||

Hi Mark

If you're using SS Enterprise Manager:

Right click on a database > All Tasks > Generate SQL script... (this will open the "Generate SQL scripts" box). On the Options tab you'll find an option under Table Scripting Options called Script indexes.

For SS Management Studio:

Right click on a database > Tasks > Generate Scripts... (this will open the "Script Wizard"). Select a database > click Next > In "Choose Script Options", scroll down to the bottom where you will find the option to "Script Indexes".

Max

|||Thank you. I didn't even know there was a Generate Scripts wizard, probably because there is nothing about it in the BOL.|||

I just stumbled across this post. Thanks Max for the description of how to get at the Script Wizard.

I would also like to add my voice to the requests that the backwards compatibility issues with scripting to SQL Server 2000 be patched soon.

|||Has this stuff been fixed yet? why market it as a feature when you know it doesn't work. Now I'm screwed|||I'm just curious as to how this ever made it out of QA? I work in the dev dept of a mortgage wholesaler, building home grown .NET solutions. The kind of issues I've seen here and in other posts wouldn't make it past the first iteration. WTF?