Red Gate forums :: View topic - Feature Request - Assist Dynamic SQL
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Prompt 5
SQL Prompt 5 forum

Feature Request - Assist Dynamic SQL

Search in SQL Prompt 5 forum
Post new topic   Reply to topic
Jump to:  
Author Message
DavidStein



Joined: 01 Oct 2012
Posts: 4

PostPosted: Tue Oct 02, 2012 3:46 pm    Post subject: Feature Request - Assist Dynamic SQL Reply with quote

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
View user's profile Send private message
Manfred.Castro



Joined: 23 Apr 2012
Posts: 209

PostPosted: Wed Oct 03, 2012 5:53 pm    Post subject: Reply with quote

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
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