| Author |
Message |
DavidStein
Joined: 01 Oct 2012 Posts: 4
|
Posted: Tue Oct 02, 2012 3:46 pm Post subject: Feature Request - Assist Dynamic SQL |
|
|
I need to save T-SQL scripts inside a database field to be executed by a SSIS package. This is not an uncommon thing. So, if I need to insert the script into the table and the script has single quotes, it would be nice if SQLPrompt (or a different project) could handle the multiple single quote issues with that.
Basically this:
| Code: |
IF EXISTS (SELECT TOP 1 * FROM Lookup.Country WHERE CountryCode = '{{')
BEGIN
EXEC UnitTest.RaiseValidationErrors 'UPDATEBEFORE'
END
ELSE
IF NOT EXISTS (SELECT TOP 1 * FROM Lookup.Country WHERE CountryCode = '}}' AND CountryName = 'UPD')
BEGIN
EXEC UnitTest.RaiseValidationErrors 'UPDATEAFTER'
END
RETURN |
Becomes this. (I added the Select so one could run it and see the script).
| Code: |
Select
'IF EXISTS (SELECT TOP 1 * FROM Lookup.Country WHERE CountryCode = ''{{'')
BEGIN
EXEC UnitTest.RaiseValidationErrors ''UPDATEBEFORE''
END
ELSE
IF NOT EXISTS (SELECT TOP 1 * FROM Lookup.Country WHERE CountryCode = ''}}'' AND CountryName = ''UPD'')
BEGIN
EXEC UnitTest.RaiseValidationErrors ''UPDATEAFTER''
END
RETURN' |
|
|
| Back to top |
|
 |
Manfred.Castro
Joined: 23 Apr 2012 Posts: 122
|
Posted: Wed Oct 03, 2012 5:53 pm Post subject: |
|
|
You can request features for this product in our uservoice forums.
http://redgate.uservoice.com/forums/94413-sql-prompt-feature-suggestions
These forums are monitored by our developers and allow our users to request features and vote on them.
If a request recieves significant support the feature may be included in a future release. _________________ Manfred Castro
Product Support
Red Gate Software |
|
| Back to top |
|
 |
|
|
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