Print returns a user-defined message to the client.
The message string can be up to 8000 characters long
Example
declare @p int = 0
while @p < 10begin
print 'val ' + cast( @p as nvarchar(10))
set @p = @p + 1
end
Result:
val 0
val 1
val 2
val 3
val 4
val 5
val 6
val 7
val 8
val 9