Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

is it possible to pass a table as parameter? StoredProcedure

$
0
0

having trouble with  my stored procedure  

Error message:          Must declare the table variable "@NameOfTable ".

CREATE

PROCEDURE [dbo].[UniqueRowOnly]

(@NameOfTable varchar(20))

AS

BEGIN

SELECT Paid,  

             Name,   

             Picture,    

              ID

FROM   (SELECT Paid,   

                          Name,     

                          Picture,          

                          ID,           

                          Row_number() OVER(PARTITION BY Name ORDER BY ID) rn

FROM @NameOfTable) t

WHERE  rn = 1

END


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>