Check for Existence of Lookup Data

Compares and synchronizes SQL database content.

Check for Existence of Lookup Data

Postby todtrexler » Fri Nov 22, 2013 7:14 pm

I am automating a lot of our processes using SQL Compare, SQL Data Compare, and SQL Source Control (amongst other tools,) and have found a feature that I would really like to see in SQL Compare. I don't think it IS available, and if not am wondering if there are plans for it to be a future feature.

Namely, when I am using Data Compare to script inserts to lookup tables, I would love to be able to specify that the script should check for the existence of the data, by key field, before attempting an insert.

For example, the data scripts include statements like these:
INSERT INTO [staging].[SysImportExceptionTypes] ([Id], [Description], [SysImportExceptionSeverity_Id]) VALUES (11, N'SQL code not available For Import', 3)

And I am currently modifying these by hand to look like this:
IF NOT EXISTS (SELECT * FROM [staging].[SysImportExceptionTypes] WHERE ID = 11) INSERT INTO [staging].[SysImportExceptionTypes] ([Id], [Description], [SysImportExceptionSeverity_Id]) VALUES (11, N'SQL code not available For Import', 3)

Is that something that I can get the tool to do without this manual intervention? If not, any chance of it being in a future release?
Posts: 4
Joined: Fri Nov 22, 2013 12:05 am

Postby Manfred.Castro » Fri Nov 22, 2013 8:53 pm

Unfortunately the tool does not currently have this capability.
There is an existing feature request you may want to vote for. ... ta-compare
These forums are actively monitored by our development team and allow our users to request features and vote on them.
If a feature receives a significant amount of votes or is deemed to have merit development may include the feature in a future release.
Manfred Castro
Product Support
Red Gate Software
Posts: 209
Joined: Mon Apr 23, 2012 1:49 pm

Return to SQL Data Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests