June 7, 2008 at 9:56 am
Dear Friends,
I have to retrive the data from table account & blockId where the account no. is in the " .csv " ( in this .csv file i have only one column with row terminator) file how to retrive the data from it, here is my query
select a.col1,a.col2,b.col3 from account a,
inner join blockId b
on a.acc_id=b.acc_id
where b.acc_No = 'file.csv'
Regards,
Kumar
June 7, 2008 at 12:28 pm
Use bulk insert to import the file into a table and join to it as you normally would.
As an alternative, you could Create a Linked Sever or OPENROWSET and read from the file directly.
All 3 methods are clearly described in Books Online (comes free with SQL Server).
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply