July 16, 2009 at 7:38 am
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
July 31, 2009 at 1:00 pm
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