How can we help you today? How can we help you today?

This post is just a suggestion for a new feature.

Converting T-SQL into its dynamic equivalence and vice versa. 
It would be nice to click on context menu and transform T-SQL statement into its dynamic equivalent. 
For example the following T-SQL statement 

DECLARE @BusinessEntityID tinyint = 101
SELECT BusinessEntityID, NationalIDNumber, JobTitle, LoginID FROM AdventureWorks2012.HumanResources.Employee WHERE BusinessEntityID = @BusinessEntityID

becomes 

DECLARE @IntVariable INT;  
DECLARE @SQLString NVARCHAR(500);  
DECLARE @ParmDefinition NVARCHAR(500);  
  

SET @SQLString =  
     N'SELECT BusinessEntityID, NationalIDNumber, JobTitle, LoginID  
       FROM AdventureWorks2012.HumanResources.Employee   
       WHERE BusinessEntityID = @BusinessEntityID';  
SET @ParmDefinition = N'@BusinessEntityID tinyint';  
SET @IntVariable = 101

EXECUTE sp_executesql @SQLString, @ParmDefinition, @BusinessEntityID = @IntVariable;


The opposite case is also extremely very useful!
I hope you understood my suggestion. :)
Best regards!
DarkoMartinovic
0

Comments

1 comment

  • dkim1999
    Hi there,

    Thank you for reaching out about SQL Prompt.

    I would highly recommend that you input a feature request into our UserVoice: https://redgate.uservoice.com/forums/94413-sql-prompt 

    The development team regularly goes through the UserVoice, and if a feature request gains enough traction, they add it into their backlog.

    Kind Regards,
    David Kim
    Product Support Engineer

    dkim1999
    0

Add comment

Please sign in to leave a comment.