Re: what word will stop everything after it in a SQL script?
From: Steve Kass (skass_at_drew.edu)
Date: 06/15/04
- Next message: Uri Dimant: "Re: function + text problem"
- Previous message: Steve Kass: "Re: What INDEX should be created for this VIEW ?"
- In reply to: AFN: "what word will stop everything after it in a SQL script?"
- Next in thread: Tibor Karaszi: "Re: what word will stop everything after it in a SQL script?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 15 Jun 2004 00:28:48 -0400
AFN,
Before each section you might need to run, put
/*
and after each section you might need to run, put
*/
When you highlight what you want, highlight only the code between the
comment delimiters. If you forget to highlight something, no code will
be executed, because it's all comments.
Note that you cannot include the batch separator GO inside a multi-line
comment. If any of the sections you need to execute contains GO, this
trick should still work, but instead of nothing happening if you
accidentally execute the entire script, you'll get an error about a
missing comment end mark.
Steve Kass
Drew University
AFN wrote:
>Actually, I don't know if the word "script" is correct or not, but here's my
>problem...
>
>I have a Query Analyzer script file that I keep open for lots of potential
>issues each day. I never run the whole thing. I just highlight the piece
>I need, and click play. I have about 300 statements in this file on my
>screen.
>
>The problem is when I forget to highlight something before clicking play.
>Suddenly it wants to execute everything on the screen. If I had update or
>delete statements somewhere on the screen, I'm worried it will execute them.
>It is only a developer database, but I don't want to waste time restoring
>it.
>
>Is there some keyword I can put at the top of the screen/file, so it will
>stop executing everything beneath it? I tried "stop" but that didn't work.
>I tried "use xyz" but unless xyz is a real database, it won't work either,
>and I don't want to specify a real database name. I could create a database
>name just for this purpose, but that seems wasteful if there's a keyword
>that does what I want. Is there?
>
>
>
>
- Next message: Uri Dimant: "Re: function + text problem"
- Previous message: Steve Kass: "Re: What INDEX should be created for this VIEW ?"
- In reply to: AFN: "what word will stop everything after it in a SQL script?"
- Next in thread: Tibor Karaszi: "Re: what word will stop everything after it in a SQL script?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|