trying update Sql table form a DataTable
via a Stored procedure i wanted to avoid multiple round trips on every row insert as i already have
a DataTable
ready,
using Table-valued parameters i can efficiently pass a whole table to SQL Server.
problem is that i need to update another table with the passed table
this is the original Row By Row insert
ALTER PROC [dbo].[InsertNewFILES]
@FileId int, @DriveL nchar(1), @PathToFolder nvarchar(300), @ContainingFolder nvarchar (100), @CurFileName nvarchar(100), @fileExt nchar(10), @fileSize int, @created smalldatetime
AS BEGIN
insert into [FileLookUps] output inserted.FileID, inserted.FName, @DriveL, @Filepath, @FolderName, @FileExt, @FileSize, @created into [HddFolderFiles]
values(@CurFileName,'')
so in the row by row version above [HddFolderFiles] accepts all Row-columns and [FileLookUps] takes inserted.FileID+Fname
Columns
as the idea was to pass a table but how can i achieve same with a whole table is passed... is this doable ?