April 5, 2014 at 3:10 pm
Comments posted to this topic are about the item Syntax Validation
April 6, 2014 at 5:44 pm
This was removed by the editor as SPAM
April 6, 2014 at 8:34 pm
Nice question Shanjan. Thanks. +1
April 6, 2014 at 9:39 pm
April 6, 2014 at 10:59 pm
Easy One! thanks.
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
April 7, 2014 at 12:09 am
April 7, 2014 at 12:31 am
Interesting question, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
April 7, 2014 at 12:33 am
SET NOEXEC might find syntax errors but it doesn't find all errors. I copied a piece of code that included a "RANK... PARTITION BY [invalid column]" - I changed everything except the column I was partitioning by (which was actually a mistake on my part). "SET NOEXEC ON" is happy with this but when you actually execute the code, it will fail.
So, as far as I am concerned, the only way to actually check the syntax of your code is to run it in a development environment which is how I answered this question.
April 7, 2014 at 1:19 am
happycat59 (4/7/2014)
SET NOEXEC might find syntax errors but it doesn't find all errors. I copied a piece of code that included a "RANK... PARTITION BY [invalid column]" - I changed everything except the column I was partitioning by (which was actually a mistake on my part). "SET NOEXEC ON" is happy with this but when you actually execute the code, it will fail.So, as far as I am concerned, the only way to actually check the syntax of your code is to run it in a development environment which is how I answered this question.
I get it right, but I agree with you "run it in a development environment".
I think that the right answers are both "run it in a development environment" and "SET NOEXEC ON" (fifty/fifty).
😀
April 7, 2014 at 2:27 am
Carlo Romagnano (4/7/2014)
happycat59 (4/7/2014)
SET NOEXEC might find syntax errors but it doesn't find all errors. I copied a piece of code that included a "RANK... PARTITION BY [invalid column]" - I changed everything except the column I was partitioning by (which was actually a mistake on my part). "SET NOEXEC ON" is happy with this but when you actually execute the code, it will fail.So, as far as I am concerned, the only way to actually check the syntax of your code is to run it in a development environment which is how I answered this question.
I get it right, but I agree with you "run it in a development environment".
I think that the right answers are both "run it in a development environment" and "SET NOEXEC ON" (fifty/fifty).
😀
Dev can be different from prod, just because it's dev.
April 7, 2014 at 2:36 am
Despite popular opinion (see above) there's no "easy" answer to this. NOEXEC is good but it won't find everything and there is the risk that you might miss one somewhere.
I prefer the "test as much as you can" approach. If Dev is vastly different from Prod then that's an issue which should be addressed.
April 7, 2014 at 2:55 am
kupy (4/7/2014)
Carlo Romagnano (4/7/2014)
happycat59 (4/7/2014)
SET NOEXEC might find syntax errors but it doesn't find all errors. I copied a piece of code that included a "RANK... PARTITION BY [invalid column]" - I changed everything except the column I was partitioning by (which was actually a mistake on my part). "SET NOEXEC ON" is happy with this but when you actually execute the code, it will fail.So, as far as I am concerned, the only way to actually check the syntax of your code is to run it in a development environment which is how I answered this question.
I get it right, but I agree with you "run it in a development environment".
I think that the right answers are both "run it in a development environment" and "SET NOEXEC ON" (fifty/fifty).
😀
Dev can be different from prod, just because it's dev.
Sorry, I want to say "run it in a TEST environment".
April 7, 2014 at 3:05 am
The surest way of validating the syntax is always running it on a test server. NOEXEC and other alternatives will not be able to catch all syntax exceptions.
Thanks & Regards,
Nakul Vachhrajani.
http://nakulvachhrajani.com
Follow me on
Twitter: @sqltwins
April 7, 2014 at 3:40 am
Richard Warr (4/7/2014)
Despite popular opinion (see above) there's no "easy" answer to this. NOEXEC is good but it won't find everything and there is the risk that you might miss one somewhere.I prefer the "test as much as you can" approach. If Dev is vastly different from Prod then that's an issue which should be addressed.
Agreed.. this was my thinking and hence why I got it wrong.
April 7, 2014 at 5:55 am
Can someone explain how adding a NOEXEC statement and then having to remember to remove it again afterwards is "easier" than just pressing Ctrl-F5 in SSMS?
In a question like this "None of the above" covers a lot of ground.
Viewing 15 posts - 1 through 15 (of 34 total)
You must be logged in to reply to this topic. Login to reply