SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 PRINT STATEMENT
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sfjtraps
Yak Posting Veteran

65 Posts

Posted - 06/21/2013 :  14:50:13  Show Profile  Reply with Quote
I'm using a simple print statement in a stored procedure in SQL Server Express 2012, and it is my understanding that the statement is supposed to return printed text to the user. I cannot see the statement being returned, because it isn't popping up and I don't know where to look. Where should I see the what is supposed to be printed after I execute the stored procedure in SQL Management Studio?

Here is my stored procedure:
CREATE PROCEDURE pr_Names @VarPrice money
AS
BEGIN
-- The print statement returns text to the user
PRINT 'Products less than ' + CAST(@VarPrice AS varchar(10));
-- A second statement starts here
SELECT ProductName, Price FROM vw_Names
WHERE Price < @varPrice;
END
GO


Here is my execute statement:
EXECUTE pr_Names 10.00;
GO

TG
Flowing Fount of Yak Knowledge

USA
6062 Posts

Posted - 06/21/2013 :  14:53:35  Show Profile  Reply with Quote
If you are in grid mode then there are two tabs in the result pane (results and Messages).


Be One with the Optimizer
TG
Go to Top of Page

sfjtraps
Yak Posting Veteran

65 Posts

Posted - 06/21/2013 :  14:54:22  Show Profile  Reply with Quote
Thanks. I see it in Messages.
Go to Top of Page

TG
Flowing Fount of Yak Knowledge

USA
6062 Posts

Posted - 06/21/2013 :  14:58:38  Show Profile  Reply with Quote
cool - have fun

Be One with the Optimizer
TG
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000