Scripting error between versions
rbennet8
Posts: 74
I have a SQL 2005 SP2 server on which I loaded my database which has SQL 2000 compatibility level of 80. I ran the packager 5 and selected SQL 2000 for the script option. As long as I build the new database on the SQL 2005 server everything works great. However, if I try to build a new database on a SQL 2000 SP4 server, it fails. The reason is in the scripting for extended properties, the 'SCHEMA' Is left in the script. Please see the two examples:
This is from the saved SQL script using Packager 5 on a SQL 2005 server and scripting the database for SQL 2000
PRINT N'Creating extended properties'
GO
sp_addextendedproperty N'MS_Description', N'The id assigned to this row', 'SCHEMA', N'dbo', 'TABLE', N'action', 'COLUMN', N'action_id'
GO
This is from the saved SQL script using Packager 5 on a SQL 2000 server and scripting the same database as above.
PRINT N'Creating extended properties'
GO
sp_addextendedproperty N'MS_Description', N'The id assigned to this row', 'USER', N'dbo', 'TABLE', N'action', 'COLUMN', N'action_id'
GO
This is from the saved SQL script using Packager 5 on a SQL 2005 server and scripting the database for SQL 2000
PRINT N'Creating extended properties'
GO
sp_addextendedproperty N'MS_Description', N'The id assigned to this row', 'SCHEMA', N'dbo', 'TABLE', N'action', 'COLUMN', N'action_id'
GO
This is from the saved SQL script using Packager 5 on a SQL 2000 server and scripting the same database as above.
PRINT N'Creating extended properties'
GO
sp_addextendedproperty N'MS_Description', N'The id assigned to this row', 'USER', N'dbo', 'TABLE', N'action', 'COLUMN', N'action_id'
GO
Comments
Unfortunately there is no workaround at this time.
You mean, in the package 'advanced' options, setting the compatibility mode to SQL Server 2000? I don't think that has any effect except to actually execute a command to set the db_options to compatibility mode.
I double theck this on Monday.
Would be a good option. THe script wizard in Mgt Studio 2005 allows you to do this.
That would be useful. Packager stores static scripts internally, though, and that makes it difficult to modify them. It's much easier to create the script withe the correct syntax to begin with. Packager can create packages that will run on SQL 2000 or SQL 2005, but you can't run a database package so it will work with both, unfortunately. You would need to create two different packages, one for SQL 2000 and another one for SQL 2005.