Red Gate forums :: View topic - Formatting issue with dropping foreign keys in output script
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK 10
SQL Comparison SDK 10 forum

Formatting issue with dropping foreign keys in output script

Search in SQL Comparison SDK 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
clamk123



Joined: 01 Apr 2012
Posts: 28

PostPosted: Thu Apr 19, 2012 5:24 pm    Post subject: Formatting issue with dropping foreign keys in output script Reply with quote

There's a slight bug when generating an output script in the case of foreign keys which affects formatting (and in our case, parsing the script).

When generating a comparison script between tables with foreign keys, you get the below sample results.

GO
PRINT N'Dropping foreign keys from [dbo].[tblTable2]'
GO
ALTER TABLE [dbo].[tblTable2] DROP CONSTRAINT[FK_NamedId]
GO
PRINT N'Dropping constraints from [dbo].[tblTable]'
GO
ALTER TABLE [dbo].[tblTable] DROP CONSTRAINT [df]
GO
PRINT N'Dropping constraints from [dbo].[tblTable3]'
GO
ALTER TABLE [dbo].[tblTable3] DROP CONSTRAINT [df_tblTable2_value]
GO

If you look closely, you can see that DROP CONSTRAINT [...] has a space between CONSTRAINT and the bracketed object name. When it generates the script for foreign keys, it does not have a space, and CONSTRAINT and the '[' are next to each other. This doesn't prevent the script from running, but does interefere with our parsing routines that occur on the generated script which is expecting to find a space between them. If this could be resolved that would be appreciated.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1116
Location: My desk.

PostPosted: Mon Apr 23, 2012 1:05 pm    Post subject: Reply with quote

Thanks for pointing this out. I've logged a bug, reference SC-5727 to get it looked at.

I can't make any promise of timescale, however if it's a simple fix it may be possible to get done quite quickly.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group