SQL Results Screen

jstevens
GoldLounger
Posts: 2628
Joined: 26 Jan 2010, 16:31
Location: Southern California

SQL Results Screen

Post by jstevens »

Is it possible to clear the query results screen using code with each increment of a counter? The code below works fine but generates multiple result screens. I would only like to see one result screen at a time.

I'm using this code in a SQL Server Management Studio query.

Code: Select all

DECLARE @Counter INT, @MaxId INT,
        @FileName [varchar](max)

SELECT @Counter = min(Id) , @MaxId = max(Id)
FROM #TempTable

WHILE(@Counter IS NOT NULL
      AND @Counter <= @MaxId)
BEGIN
   SELECT @FileName = FileName
   FROM Data3 WHERE Id = @Counter

If (Select Count(*) from Data3 Where Filename = @FileName) > 1 
			Select * from Data3 Where Filename = @FileName

   SET @Counter  = @Counter  + 1        
END
Regards,
John

User avatar
HansV
Administrator
Posts: 78487
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SQL Results Screen

Post by HansV »

As far as I know there is no code command for that.
Best wishes,
Hans

jstevens
GoldLounger
Posts: 2628
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: SQL Results Screen

Post by jstevens »

Hans,

Thanks for responding.
Regards,
John