Feature Request - Assist Dynamic SQL

Provides intelligent code completion for SQL Server editors.

Moderators: JonathanWatts, David Atkinson, Anu Deshpande, Paul Stephenson, Michelle Taylor, Mike Upton, justin.caldicott, Aaron Law

Feature Request - Assist Dynamic SQL

Postby DavidStein » Tue Oct 02, 2012 3:46 pm

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: Select all
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 all
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'
DavidStein
 
Posts: 4
Joined: Mon Oct 01, 2012 4:32 pm

Postby Manfred.Castro » Wed Oct 03, 2012 5:53 pm

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
Manfred.Castro
 
Posts: 209
Joined: Mon Apr 23, 2012 2:49 pm


Return to SQL Prompt 5

Who is online

Users browsing this forum: No registered users and 0 guests

cron