Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to bypass lines in query window?
Message
 
 
To
10/08/2011 15:01:37
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01520522
Message ID:
01520633
Views:
61
>>>>Hi,
>>>>
>>>>Is there a IF .F. syntax that I can use in a query window to bypass some lines (temporarily). In VFP I would use IF .F. ENDIF. Is there a way to do the same in SQL Server query window?
>>>>
>>>>TIA.
>>>
>>>And remember you can highlight just the lines you want to run and press F5
>>>(obviously only a good solution for contiguous code )
>>
>>I didn't know that. Thank you.
>
>One handy use for that is if you have half a dozen queries you run regularly to test something. You can throw them all in one sql and then bring that up to run portions when you want, kind of like we do with the VFP comman window, running blocks of code from history.
>
>Less cumbersome than storing each query off in its own sql file.

I do sort of the same thing, just a little differently. I keep separate queries in the format "(operation) (table)". For example, "Select DebtorEmails.sql" or "Insert GreatBrownsTeams.sql". (A little joke there just for you). Many of these procedures, particularly the Selects, have alternative Where clauses commented out with the "--" comment delimiter. A month into any project I have many of the saved queries I will use over and over on that project.

Tangentially related, here is a useful free SQL utility I like ---

http://www.red-gate.com/products/sql-development/sql-search/

It won't change your life but it will make it a little easier.
Previous
Reply
Map
View

Click here to load this message in the networking platform