If you've spent much time in TSQL you've probably been bitten by what I can only consider a bug: the fact that the existance of a GO inside a /* comment */ block causes all sorts of mischief. Try the following in QA and watch it fail:
DECLARE @test varchar(20) SET @test = 'this is a test' /* SELECT something FROM someTable GO */ SELECT @test GO
This will invariably fail. Books Online documents this in the Remarks section with a Note: which can only be construed as acknowledged/accepted behaviour (i.e. not as a bug). To be honest, batch terminators (like GO and ;) are NOT part of TSQL, they're imposed by SQL tools of all different flavors (you won't even find GO in a BOL entry), so TSQL isn't to blame... it's the tools (QA to be exact). (But let's be honest, anything that parses and FINDS things in your comment blocks is BROKEN... calling it good with a 'remark' was kinda lame).
The good news: Yukon (Beta 1) fixes this. In fact, not only does the above statement work as anticipated, it gets a killer outline/code region around it. You can't beat that.
Comments