How to Update Dynamic File

Posted by Jayakumars under Sql Server on 9/19/2019 | Points: 10 | Views : 314 | Status : [Member] [MVP] | Replies : 0
Hi
How to Update Dynamic Filename in Sql Server like this


--create table filenamestring
--(
--Fileid int primary key identity(1,1),
--Filenamestr nvarchar(200)
--)

--INSERT INTO filenamestring VALUES('AA.txt')
--INSERT INTO filenamestring VALUES('BB.txt')
--INSERT INTO filenamestring VALUES('CC.txt')
--INSERT INTO filenamestring VALUES('DD.txt')
--INSERT INTO filenamestring VALUES('EE.txt')

--TRUNCATE table FineTable
create table FineTable
(
finid int PRIMARY key IDENTITY(1,1),
Fcode int,
FSALID INT,
FSALFILENAME NVARCHAR(100)
)


--INSERT INTO FineTable VALUES(1001,1947,NULL)
--INSERT INTO FineTable VALUES(1002,1947,NULL)
--INSERT INTO FineTable VALUES(1003,1947,NULL)
--INSERT INTO FineTable VALUES(1004,1947,NULL)
--INSERT INTO FineTable VALUES(1005,1948,NULL)
--INSERT INTO FineTable VALUES(1006,1948,NULL)
--INSERT INTO FineTable VALUES(1007,1948,NULL)
--INSERT INTO FineTable VALUES(1008,2015,NULL)


select * from filenamestring
select * from FineTable

-- i need output like this using update Query

finid Fcode FSALID FSALFILENAME
1 1001 1947 AA.txt
2 1002 1947 BB.txt
3 1003 1947 CC.txt
4 1004 1947 DD.txt
5 1005 1948 AA.txt
6 1006 1948 BB.txt
7 1007 1948 CC.txt
8 1008 2015 AA.txt

Mark as Answer if its helpful to you

Kumaraspcode2009@gmail.com



Responses

(No response found.)

Login to post response