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)
 Select Stored Producre for table ?

Author  Topic 

oguzkaygun
Yak Posting Veteran

53 Posts

Posted - 2012-04-02 : 14:18:29
Hello
Can you fix below stored procedure ?
ALTER PROCEDURE dbo.oncekikayit
/*
(
@parameter1 int = 5,
@parameter2 datatype OUTPUT
)
*/

@hangitable table,
@x_kod nvarchar(50)

AS
/* SET NOCOUNT ON */
SELECT TOP 1 x_kod,x_id FROM @hangitable WHERE x_kod<(SELECT x_kod FROM @hangitable WHERE x_kod=@x_kod) ORDER BY x_kod DESC
RETURN

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-04-02 : 15:46:13
You cannot use a table as a parameter the way you are attempting to do. There are a few different ways to share data in a table with a stored procedure or between stored procedures. Sommarskog's blog has a good description: http://www.sommarskog.se/share_data.html
Go to Top of Page
   

- Advertisement -