Alex A
asked on
SQL Server: how to print during program execution?
Print output appears in Messages window only after all sprocs execution completes. How to see results during execution, not in the end.
Not sure I understand what you mean but I usually use GO after each proc block to execute a batch of script at a time
You can use the "print" keyword like :
declare @min int, @max int , @cmd varchar(20)
set @min =1
set @max=10000000
set @cmd='Current Value is: '
while @min <=@max
begin
print @cmd+cast(@min as varchar)
set @min=@min+1
end
declare @min int, @max int , @cmd varchar(20)
set @min =1
set @max=10000000
set @cmd='Current Value is: '
while @min <=@max
begin
print @cmd+cast(@min as varchar)
set @min=@min+1
end
you add print statements whenever required
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Good question. If it is that important to you, your best bet is to use Jim's solution of inserting into a table and polling it frequently.