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 2000 Forums
 Transact-SQL (2000)
 problem with select into

Author  Topic 

unicorn
Starting Member

3 Posts

Posted - 2006-08-24 : 06:34:49
Hello

I'm using the folloing command in microsof sql server 2000 and it gives me a syntax error:


Select * From employees
into outfile 'c:/test.txt'


I also tried this one:

Select *
into outfile 'c:/test.txt'
From employees


but it gives me error either.

what's the problem? is there any other way to export the content of a table?
tahnks.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-24 : 06:43:15
Use BCP for this. All about the BCP command is to read in the Books Online. Or do a search for BCP, Export Textfile here on SQL Team.

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-24 : 09:29:52
or use DTS or Import/Export wizard

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-24 : 09:30:29
or use DTS or Import/Export wizard

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-08-24 : 09:49:02
quote:
Originally posted by madhivanan

or use DTS or Import/Export wizard

Madhivanan

Failing to plan is Planning to fail



If u do like this there may be duplicate records
or
May be the DTS fail in the 2nd time

Madhi,
U posted the same twice

Srinika
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-24 : 10:33:25
quote:

Madhi,
U posted the same twice



It is because my browser is too slow

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

unicorn
Starting Member

3 Posts

Posted - 2006-08-26 : 12:20:41
I tried this command in sql server 2000:
bcp pubs..authors out c:authors.dat - T - n - S

but it gives me the folloing error:
Unable to parse query text.
Incorrect syntax near '.'

what's the problem?
madhivanan can you please give me a sample of how to use DTS?


thanks.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-28 : 11:38:36
Try

bcp pubs..authors out "c:\authors.dat" -c -SServerName

Read about bcp in sql server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -