Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Call SP foreach Column in Table (without Cursor)

$
0
0
Hi,
Is there a way to call a SP for each row in a table, and to specify the value as a parameter? Like this....
Regards
Nicole
--------------------------------------------------


Create PROCEDURE [dbo].[sp_Proceed]
AS
BEGIN
   -- i want to read @Filename from Table
   DECLARE @sql NVARCHAR(4000) = 'BULK INSERT TblValues FROM ''' + @FileName
    + ''' WITH ( FIELDTERMINATOR ='','', ROWTERMINATOR =''\n'' )' ;
   EXEC(@sql) ;
END

Viewing all articles
Browse latest Browse all 23857

Trending Articles



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