Thursday, March 29, 2012
Get Backup Directory
What is the Standard"way of doing this
Do I have to write a C program that calls HRESULT GetBackupDirectory(SQLDMO_LPBSTR pRetVal);
Or should I install DtReg.exe on all my servers?
/* get default backup location -- by Bob Sturnfield */
--DtReg.exe can be found at http://www.tamedos.com/downloads
set nocount on
declare @.string varchar(4000),
@.regloc varchar(100),
@.BackupDirectory varchar(1000),
@.servernm varchar(30)
select @.regloc='MSSQLServer'
select @.servernm=rtrim(convert(varchar(30),SERVERPROPERTY ('servername')))
if CHARINDEX('\', @.servernm)>0
select @.regloc='Microsoft SQL Server\' + substring(@.servernm, CHARINDEX('\', @.servernm)+1, 30)
create table #DtReg( BackupDirectory varchar(4000))
select @.string='xp_cmdshell ''DtReg -ListValue "HKEY_LOCAL_MACHINE\Software\Microsoft\' +
@.regloc + '\MSSQLServer\BackupDirectory"'''
insert into #DtReg exec(@.string)
select top 1 @.BackupDirectory=substring(BackupDirectory,8,1000) from #DtReg
Where BackupDirectory like 'REG_SZ%'
if @.@.rowcount<>1
Select * from #DtReg
drop table #DtReg
print @.BackupDirectoryHave you looked at xp_regread ?
exec xp_regread 'HKEY_LOCAL_MACHINE',
'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer',
'BackupDirectory'
Value Data
------------------------
BackupDirectory C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP|||Thank you,
xp_regread -- not in books on-line
http://www.4guysfromrolla.com/webtech/101499-1.shtml
There's a little known xp procedure in the master database called xp_regread. This stored procedure accepts three parameters. The first one being the root key, next is the path to the key, and finally the key value you are looking to return.
http://www.swynk.com/friends/green/xp_reg.asp
xp_regread [@.rootkey=]'rootkey', [@.key=]'key'[, [@.value_name=]'value_name'][, [@.value=]@.value OUTPUT]
xp_regwrite [@.rootkey=]'rootkey', [@.key=]'key', [@.value_name=]'value_name', [@.type=]'type', [@.value=]'value'
http://www.sql-server-performance.com/ac_extended_stored_procedures.asp
These extended stored procedures work with SQL Server 7.0, as well as with SQL Server 2000.
This is great, I very much appreciate the response
Bob Sturnfield
/* get default backup location -- by Bob Sturnfield */
set nocount on
declare @.regloc varchar(100),
@.BackupDirectory varchar(1000)
select @.regloc=
'Software\Microsoft\MSSQLServer\MSSQLServer'
if CHARINDEX('\\', @.@.servername)>0
select @.regloc='Software\Microsoft\Microsoft SQL Server\' +
substring(@.@.servername, CHARINDEX('\', @.@.servername)+1, 30)+ '\MSSQLServer'
execute master..xp_regread @.rootkey='HKEY_LOCAL_MACHINE',
@.key=@.regloc, @.value_name='BackupDirectory',
@.value=@.BackupDirectory OUTPUT
print @.BackupDirectory
Tuesday, March 27, 2012
Gerating sql script with default
I have database that i add on there default
On the nornal script the tables are run first. Now the tables cannot be
created because they are based on the default
What i need to do to generate the script from now
Or how can i cancel the default?
need assistance imergancyI assume you are talking about a default object. You can create default
objects with:
CREATE DEFAULT <default name> AS <expression>
If you put this in your script to create the default before you create the
tables, thing should work fine.
Note that defaults created in this way are a backward compatibility feature,
and to ensure that your code will work with future versions of SQL Server,
you should declare DEFAULTs as column constraints.
Jacco Schalkwijk
SQL Server MVP
"Roy Goldhammer" <roygoldh@.hotmail.com> wrote in message
news:%23Tm4r8hKFHA.436@.TK2MSFTNGP09.phx.gbl...
> Hello there
> I have database that i add on there default
> On the nornal script the tables are run first. Now the tables cannot be
> created because they are based on the default
> What i need to do to generate the script from now
> Or how can i cancel the default?
> need assistance imergancy
>
>|||Can't you just edit the script and put the DEFAULTs at the beginning?
CREATE DEFAULT is virtually obsolete so I would go with the
recommendation in Books Online: avoid it and use Default Constraints
instead.
David Portas
SQL Server MVP
--|||Thankes
So how can i get rid of it now?
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1110974952.692560.119730@.f14g2000cwb.googlegroups.com...
> Can't you just edit the script and put the DEFAULTs at the beginning?
> CREATE DEFAULT is virtually obsolete so I would go with the
> recommendation in Books Online: avoid it and use Default Constraints
> instead.
> --
> David Portas
> SQL Server MVP
> --
>|||To get rid of the error message just put in the CREATE DEFAULT
statements. To get rid of the defaults altogether you'll have to
replace all references to sp_bindefault with an ALTER TABLE... ADD
CONSTRAINT statement instead. For example:
EXEC sp_bindefault 'default_name', 'table_name.column_name'
should become:
ALTER TABLE table_name
ADD CONSTRAINT df_constraint_name
DEFAULT (<default value> ) FOR column_name
David Portas
SQL Server MVP
--|||Thankes David
I found out another way to do this?
sp_unbinddefault 'table_name.field_name'
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1110977180.528780.196840@.f14g2000cwb.googlegroups.com...
> To get rid of the error message just put in the CREATE DEFAULT
> statements. To get rid of the defaults altogether you'll have to
> replace all references to sp_bindefault with an ALTER TABLE... ADD
> CONSTRAINT statement instead. For example:
> EXEC sp_bindefault 'default_name', 'table_name.column_name'
> should become:
> ALTER TABLE table_name
> ADD CONSTRAINT df_constraint_name
> DEFAULT (<default value> ) FOR column_name
> --
> David Portas
> SQL Server MVP
> --
>|||Be aware that sp_unbindefault will disable the functionality of the
default. Inserts that don't specify explicit values for a column will
therefore atempt to populate the column with NULL. The insert will fail
if the column is not nullable.
David Portas
SQL Server MVP
--
Monday, March 19, 2012
Generating GRANT EXECUTE Scripts
I have a set of users and roles in a database permissions for various stored
procedures. I want to script these permissions but the default scripting
options don't give me what I want. Is there any way to script permissions
without having to write:
GRANT EXECUTE ON sproc TO user/role
for each stored proc for each user myself.
DaleUse sp_helptext to check out how MS coded the sp_helplogins, sp_helpsrvrole,
sp_helpsrvrolemember, sp_helpuser, sp_helprole, sp_helprolemember, and
sp_helprotect.
I'm sure you will want some variant combination of all of these.
Best of luck.
Sincerely,
Anthony Thomas
"Dale" <Dale@.discussions.microsoft.com> wrote in message
news:CFF9A6DA-98C4-4FCD-AC63-4BB67B522299@.microsoft.com...
Hi All
I have a set of users and roles in a database permissions for various stored
procedures. I want to script these permissions but the default scripting
options don't give me what I want. Is there any way to script permissions
without having to write:
GRANT EXECUTE ON sproc TO user/role
for each stored proc for each user myself.
Dale
Generating GRANT EXECUTE Scripts
I have a set of users and roles in a database permissions for various stored
procedures. I want to script these permissions but the default scripting
options don't give me what I want. Is there any way to script permissions
without having to write:
GRANT EXECUTE ON sproc TO user/role
for each stored proc for each user myself.
Dale
Use sp_helptext to check out how MS coded the sp_helplogins, sp_helpsrvrole,
sp_helpsrvrolemember, sp_helpuser, sp_helprole, sp_helprolemember, and
sp_helprotect.
I'm sure you will want some variant combination of all of these.
Best of luck.
Sincerely,
Anthony Thomas
"Dale" <Dale@.discussions.microsoft.com> wrote in message
news:CFF9A6DA-98C4-4FCD-AC63-4BB67B522299@.microsoft.com...
Hi All
I have a set of users and roles in a database permissions for various stored
procedures. I want to script these permissions but the default scripting
options don't give me what I want. Is there any way to script permissions
without having to write:
GRANT EXECUTE ON sproc TO user/role
for each stored proc for each user myself.
Dale
Generating GRANT EXECUTE Scripts
I have a set of users and roles in a database permissions for various stored
procedures. I want to script these permissions but the default scripting
options don't give me what I want. Is there any way to script permissions
without having to write:
GRANT EXECUTE ON sproc TO user/role
for each stored proc for each user myself.
DaleUse sp_helptext to check out how MS coded the sp_helplogins, sp_helpsrvrole,
sp_helpsrvrolemember, sp_helpuser, sp_helprole, sp_helprolemember, and
sp_helprotect.
I'm sure you will want some variant combination of all of these.
Best of luck.
Sincerely,
Anthony Thomas
"Dale" <Dale@.discussions.microsoft.com> wrote in message
news:CFF9A6DA-98C4-4FCD-AC63-4BB67B522299@.microsoft.com...
Hi All
I have a set of users and roles in a database permissions for various stored
procedures. I want to script these permissions but the default scripting
options don't give me what I want. Is there any way to script permissions
without having to write:
GRANT EXECUTE ON sproc TO user/role
for each stored proc for each user myself.
Dale
Wednesday, March 7, 2012
Generate Scripts option in SQL 2005 Management Studio
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
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
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
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
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
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
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
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
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
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?