March 28, 2019 at 9:58 pm
Comments posted to this topic are about the item Dynamic SQL calls
March 29, 2019 at 12:21 am
Nice, easy question to end the week on, thanks, Steve
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
March 29, 2019 at 2:13 am
Good question, thanks Steve.
...
March 29, 2019 at 8:20 am
Considering how much dynamic SQL I write where I work, this was a very easy question. I use sp_executesql extensively in my code where I need to run dynamic SQL.
March 29, 2019 at 11:42 am
It seems to me the second answer could be correct as well. If the DECLARE statement included a value for @CustomerKey then the query won't error. So, if the second DECLARE statement was changed to:
DECLARE @params NVARCHAR(1000) = '@CustomerKey int = 101';
Then the query wouldn't error out and would return rows if there were rows containing a customer key of 101.
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy