Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to read filename

Author  Topic 

new_tosql
Starting Member

17 Posts

Posted - 2008-03-28 : 14:56:18
HI,

I am writing data from a file in to a table and i have a field in that table for filename. How to read the file name to write in that table.

Thanks in advance.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-03-28 : 15:49:32
You can use export/import wizard for this.If you're using sql 2000 then you can see this in Enterprise manager and in 2005 you can see this in management studio.
Go to Top of Page

KenW
Constraint Violating Yak Guru

391 Posts

Posted - 2008-03-28 : 16:10:35
quote:
Originally posted by new_tosql
I am writing data from a file in to a table and i have a field in that table for filename. How to read the file name to write in that table.



How are you importing it ("writing data from a file in to a table")? Are you talking about the name of the file you're importing from, or a filename that's in the file you're importing from?
Go to Top of Page

new_tosql
Starting Member

17 Posts

Posted - 2008-03-31 : 09:34:00
Hi,

I am using bulk insert to insert the data from csv file to table. That table have a field FILENAME where i have to insert the name of the csv file.

Thanks
Go to Top of Page

KenW
Constraint Violating Yak Guru

391 Posts

Posted - 2008-04-01 : 13:44:22
I don't see the problem then. You have the filename when you execute the BULK INSERT; just insert the name of the csv file with an INSERT statement (or an UPDATE after the BULK INSERT runs).
Go to Top of Page
   

- Advertisement -