Hi all, im new with this SQL server and found out this new feature.
I generated DAT file in my laptop, and i wanted to load it into a table in my server. hw do i proceed with it? i googled, confuse between bulk insert and openrowset...can neone enlighten me? :D
If you bcp'd the data out then you should bulk insert (or bcp) the data in.
You should be able to use the same bcp command just change the out to in and the table/server names.
========================================== Cursors are useful if you don't know sql. DTS can be used in a similar way. Beer is not cold and it isn't fizzy.
well...i use somekind of software to generate the BCP file..so when i want to import it in..it doesnt have the feature..heheheh..i assumed i need to do it myself..so im looking for command to get it in..
You need to know the format of the file to bcp it in. On the server try create table #a(s varchar(8000)) bulk insert #a from 'c:\myfile.dat' with (fieldterminator = '^', lastrow=10) select * from #a
If it gives an error it probably means that the rows aren't crlf terminated. In which case you will have to find the terminator.maybe
If that doesn't work try using dts to look at it otherwise your favourite hex editor.
Are you sure it's not a propriatory format which you can't import?
========================================== Cursors are useful if you don't know sql. DTS can be used in a similar way. Beer is not cold and it isn't fizzy.