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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 openrowset and openquery

Author  Topic 

mvssrikanth1
Starting Member

4 Posts

Posted - 2007-11-29 : 09:24:37
recently i have to import a textfile to sql server 2005.
The text file has 28 columns separated by a tab and has a comma as a part of data(for eg.1,500$).when i used openquery,openrowset functions,
data is imported to a new table but i have only two columns .by default,
these functions are are taking comma as a field separator and thus i got two column table.i can use bulk insert but i have to create the table in sql server(to which data is to be imported) prior to data transfer.my task is to create a table on the fly.
with open query and openrowset new table is created on the fly but the above problem exists.how to change the default field terminator of open query and openrow set functions?
can any one help me ?
thanks in advance,

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2007-11-29 : 20:55:02
Have you tried a format file?
http://msdn2.microsoft.com/en-us/library/ms178129.aspx
Go to Top of Page
   

- Advertisement -