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.
| Author |
Topic |
|
zukipower
Starting Member
10 Posts |
Posted - 2010-05-12 : 09:41:16
|
| I have a problem regarding importing of data from a file into a table in the sql database.The textfile i want to import would look like this:old spare part number;replacement code;new spare part number10621631;1;2039838901062165;1;2039801401062167;1;2038351401062172;1;03093911I've found a script as follows:COPY [ BINARY ]tbl_spr_replacement[ WITH OIDS ] FROM { 'c:\fil.txt' | stdin } [ [USING] DELIMITERS ';' ] [ WITH NULL AS 'null_string' ]it gets an error on the [ BINARY ], and im not sure if this is right syntax at all, or that SQL supports this.Do any of you have a clue on how i can import a file into a table?I really want to learn this language, so if any of you have any good tutorial links or link to a very good SQL book i could buy i would very much appreciate it. :) |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
|
|
zukipower
Starting Member
10 Posts |
Posted - 2010-05-12 : 10:29:49
|
| I'm not sure if that was MS SQL, but since it said it was wrong syntax i guess it is something else.Thank you very much for the link. It worked perfectly! :) |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-05-12 : 10:31:11
|
welcome  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|