Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft SQL Server 2005 Console Write Line

Tags:

sql-server

Is there a way to write a message to the console? I'd like to write some debug data if it's possible.

like image 433
Kevin Avatar asked Apr 14 '10 19:04

Kevin


People also ask

How do you print a line in SQL?

Usually, we use the SQL PRINT statement to print corresponding messages or track the variable values while query progress. We also use interactions or multiple loops in a query with a while or for a loop. We can also use the SQL PRINT statement to track the iteration.

How do you display text in SQL?

:Explanation: Note: You can use literal string (enclosed in single or double quotation mark) just like we use a column name in the SELECT statement. If you use the literal string with a column then it will be displayed in every row of the query results.


2 Answers

The PRINT command emits a message that may be shown in a console depending on what tool you're using:

PRINT 'Hello, world!' 

Not all clients necessarily show these messages though.

like image 52
Matti Virkkunen Avatar answered Sep 19 '22 04:09

Matti Virkkunen


You mean PRINT?

For example:

PRINT 'hello world'

like image 40
riffnl Avatar answered Sep 22 '22 04:09

riffnl