I've written the below code to set filepath column in my table as 'F:\DataMigration\Wise\DELTA_20121008\Attachments\SR\SR_1.txt'
where SR_1 is file_name column
.txt is file_ext column from my table.
but after executing following procedure, I'm getting filepath column in table as
'F:\DataMigration\Wise\DELTA_20121008\Attachments\file_name.file_ext'
means It's treating column names as string, how i can make it as column so it will use values in that column.
alter procedure [dbo].[WISEMissingAttachmentReportGenerator]
(
@tablename varchar(255), @pathonlocal nvarchar(255)
)
as
begin
--step 1
exec dbo.proc_alter_table @tablename
--step 2
EXEC ('update '+ @tablename +
' set filepath = '''+ @pathonlocal + ' file_name'+'.'+'file_ext''')
EXEC('Select * from '+@tablename)
end
exec [dbo].[WISEMissingAttachmentReportGenerator] [WISE.Non_VP_Service_Request_Attachments_File_Check_Analysis],
N'F:\DataMigration\Wise\DELTA_20121008\Attachments\SR\'