Monday, March 19, 2012

Asking

At Ms Access, I can export data to text or excel with only to write:
SELECT * INTO TD in 'C:' [Text;]
From TS
Now, Can SQL Server 2000 do like this? IF can, How is its syntax?Bpk,
Here is an example to work with:
EXEC master..xp_cmdshell 'osql -E -dPubs -Q"select * from
authors" -o"C:\authors.txt"'
You can also use BCP (out) and DTS.
HTH
Jerry
"Bpk. Adi Wira Kusuma" <adi_wira_kusuma@.yahoo.com.sg> wrote in message
news:ulzUGe2xFHA.2652@.TK2MSFTNGP14.phx.gbl...
> At Ms Access, I can export data to text or excel with only to write:
> SELECT * INTO TD in 'C:' [Text;]
> From TS
> Now, Can SQL Server 2000 do like this? IF can, How is its syntax?
>|||This will work for the publisher table in the Pubs DB
exec master..xp_cmdshell 'bcp pubs.dbo.publishers out "c:\files.txt" -S
{YourServerNameHere} -T -t "," -c'
or just from the command line bcp pubs.dbo.publishers out "c:\files.txt" -S
{YourServerNameHere} -T -t "," -c
http://sqlservercode.blogspot.com/
"Bpk. Adi Wira Kusuma" wrote:

> At Ms Access, I can export data to text or excel with only to write:
> SELECT * INTO TD in 'C:' [Text;]
> From TS
> Now, Can SQL Server 2000 do like this? IF can, How is its syntax?
>
>

No comments:

Post a Comment