SQL Query Analyzer Output Result to nul:

  • In "SQL Query Analyzer" any version, Results in Grid

    How to get make any [SELECT] not to display its results in the "Result Pane"

    a sort of [SELECT * FROM table > C:nul]

    "à la" MSDOS

    but I want the [PRINT] to display

    that is, I am only interested in the "Messages" tabs

    EDIT :

    It seems that this question is unanswered since years.

    I found a quick workaround :

    [SELECT "Name1" FROM table] produce some display, whereas

    [SELECT @dummyvar = "Name1" FROM table] doesn't

  • I'm unsure what you were trying to achieve here, but your example lead me to this interesting phenom:

    In effect, the statement:

    SELECT @dummyvar = name FROM foo

    acts like a "Select Bottom 1", with @dummyvar getting the col from last row of the table

    create table FOO (id int IDENTITY, name varchar(8))

    Insert into FOO values('top')

    Insert into FOO values('middle')

    Insert into FOO values('middle')

    Insert into FOO values('middle')

    Insert into FOO values('bottom')

    declare @dummyvar varchar(8)

    SELECT @dummyvar = name FROM foo

    SELECT @dummyvar

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply