Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 RE: stored procedure printing statement

Author  Topic 

kond.mohan
Posting Yak Master

213 Posts

Posted - 2011-11-07 : 05:10:55

i am executing stored procedure with select statement
at this time sp is not executing print statements
only execut select statement

i am executing stored procedure without select statement
at this time sp is executing print statements

what is scope and difference

mohan

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2011-11-07 : 05:15:41
Where are you executing the procedure from? The print statements are shown in the messages window in SSMS, whhen you have a select, thsi is shown in the results window. Change the tab (they will bith be there if there are any results) and you will see your print statements.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-07 : 06:04:54
quote:
Originally posted by kond.mohan


i am executing stored procedure with select statement
at this time sp is not executing print statements
only execut select statement

i am executing stored procedure without select statement
at this time sp is executing print statements

what is scope and difference

mohan


how have you included the print statements? is it inside if block or something?
Also where are you calling this sp from? is it in a window of sql management studio or are you calling from an application?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2011-11-07 : 06:20:29
quote:
Originally posted by visakh16

quote:
Originally posted by kond.mohan


i am executing stored procedure with select statement
at this time sp is not executing print statements
only execut select statement

i am executing stored procedure without select statement
at this time sp is executing print statements

what is scope and difference

mohan


how have you included the print statements? is it inside if block or something?
Also where are you calling this sp from? is it in a window of sql management studio or are you calling from an application?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/




I think I've already asked those questions..
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-07 : 06:28:46
quote:
Originally posted by RickD

quote:
Originally posted by visakh16

quote:
Originally posted by kond.mohan


i am executing stored procedure with select statement
at this time sp is not executing print statements
only execut select statement

i am executing stored procedure without select statement
at this time sp is executing print statements

what is scope and difference

mohan


how have you included the print statements? is it inside if block or something?
Also where are you calling this sp from? is it in a window of sql management studio or are you calling from an application?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/




I think I've already asked those questions..


Oh sorry
didnt notice it

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -