From: Sam on 3 Mar 2010 00:48 Hi, I have a stored procedure with an OUTPUT parameter. When I execute the procedure in SQL Server Mgmt Studio, am I supposed to see the OUTPUT parameter's value? I'm troubleshooting an issue and at this point I'm not sure if it's the application code or the stored procedure. When I execute the stored procedure, it does what it's supposed to do i.e. insert a new record, but I do not see the value of the output param -- unlike when I return values through a SELECT statement. Is this normal or am I supposed to see the value returned by the output param? -- Thanks, Sam
From: Tibor Karaszi on 3 Mar 2010 01:12 No, you don't see the OUT params in SSMS. You ´would have to declare a variable, assign the out params in a calling batch and then present those values (using SELECT, for instance). -- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://sqlblog.com/blogs/tibor_karaszi "Sam" <Sam(a)discussions.microsoft.com> wrote in message news:E582AD40-53A0-45D5-B199-AAF5E441D6D5(a)microsoft.com... > Hi, > > I have a stored procedure with an OUTPUT parameter. When I execute the > procedure in SQL Server Mgmt Studio, am I supposed to see the OUTPUT > parameter's value? > > I'm troubleshooting an issue and at this point I'm not sure if it's the > application code or the stored procedure. When I execute the stored > procedure, it does what it's supposed to do i.e. insert a new record, but > I > do not see the value of the output param -- unlike when I return values > through a SELECT statement. Is this normal or am I supposed to see the > value > returned by the output param? > -- > Thanks, > > Sam
From: Dan Guzman on 3 Mar 2010 07:49 > I have a stored procedure with an OUTPUT parameter. When I execute the > procedure in SQL Server Mgmt Studio, am I supposed to see the OUTPUT > parameter's value? > > I'm troubleshooting an issue and at this point I'm not sure if it's the > application code or the stored procedure. When I execute the stored > procedure, it does what it's supposed to do i.e. insert a new record, but > I > do not see the value of the output param -- unlike when I return values > through a SELECT statement. Is this normal or am I supposed to see the > value > returned by the output param? To add on to Tibor's response, you can generate a script to execute the proc from SSMS Object Explorer. Right-click on the proc and select Script Stored Procedure as-->Execute to. This will generate the needed variable declarations and EXECUTE statement. Add desired variable assignments and a SELECT or PRINT of the output values after the EXECUTE. -- Hope this helps. Dan Guzman SQL Server MVP http://weblogs.sqlteam.com/dang/
From: Tibor Karaszi on 3 Mar 2010 08:12 > To add on to Tibor's response, you can generate a script to execute the > proc from SSMS Object Explorer. Right-click on the proc and select Script > Stored Procedure as-->Execute to. This will generate the needed variable > declarations and EXECUTE statement. Add desired variable assignments and > a SELECT or PRINT of the output values after the EXECUTE. Cool. You learn something every day! :-) -- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://sqlblog.com/blogs/tibor_karaszi "Dan Guzman" <guzmanda(a)nospam-online.sbcglobal.net> wrote in message news:9E2CE806-644E-45C3-BD87-A05619036735(a)microsoft.com... >> I have a stored procedure with an OUTPUT parameter. When I execute the >> procedure in SQL Server Mgmt Studio, am I supposed to see the OUTPUT >> parameter's value? >> >> I'm troubleshooting an issue and at this point I'm not sure if it's the >> application code or the stored procedure. When I execute the stored >> procedure, it does what it's supposed to do i.e. insert a new record, but >> I >> do not see the value of the output param -- unlike when I return values >> through a SELECT statement. Is this normal or am I supposed to see the >> value >> returned by the output param? > > To add on to Tibor's response, you can generate a script to execute the > proc from SSMS Object Explorer. Right-click on the proc and select Script > Stored Procedure as-->Execute to. This will generate the needed variable > declarations and EXECUTE statement. Add desired variable assignments and > a SELECT or PRINT of the output values after the EXECUTE. > > -- > Hope this helps. > > Dan Guzman > SQL Server MVP > http://weblogs.sqlteam.com/dang/ > >
From: Uri Dimant on 3 Mar 2010 08:50
Yep, I faced that problem when Intelisence's cache was not cleared and it did not recognized my new created stored procedure but did run it by EXECUTE ....:-))) "Tibor Karaszi" <tibor_please.no.email_karaszi(a)hotmail.nomail.com> wrote in message news:OKKftLtuKHA.3896(a)TK2MSFTNGP02.phx.gbl... >> To add on to Tibor's response, you can generate a script to execute the >> proc from SSMS Object Explorer. Right-click on the proc and select >> Script Stored Procedure as-->Execute to. This will generate the needed >> variable declarations and EXECUTE statement. Add desired variable >> assignments and a SELECT or PRINT of the output values after the EXECUTE. > > Cool. You learn something every day! :-) > > -- > Tibor Karaszi, SQL Server MVP > http://www.karaszi.com/sqlserver/default.asp > http://sqlblog.com/blogs/tibor_karaszi > > > > "Dan Guzman" <guzmanda(a)nospam-online.sbcglobal.net> wrote in message > news:9E2CE806-644E-45C3-BD87-A05619036735(a)microsoft.com... >>> I have a stored procedure with an OUTPUT parameter. When I execute the >>> procedure in SQL Server Mgmt Studio, am I supposed to see the OUTPUT >>> parameter's value? >>> >>> I'm troubleshooting an issue and at this point I'm not sure if it's the >>> application code or the stored procedure. When I execute the stored >>> procedure, it does what it's supposed to do i.e. insert a new record, >>> but I >>> do not see the value of the output param -- unlike when I return values >>> through a SELECT statement. Is this normal or am I supposed to see the >>> value >>> returned by the output param? >> >> To add on to Tibor's response, you can generate a script to execute the >> proc from SSMS Object Explorer. Right-click on the proc and select >> Script Stored Procedure as-->Execute to. This will generate the needed >> variable declarations and EXECUTE statement. Add desired variable >> assignments and a SELECT or PRINT of the output values after the EXECUTE. >> >> -- >> Hope this helps. >> >> Dan Guzman >> SQL Server MVP >> http://weblogs.sqlteam.com/dang/ >> >> |