Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    Australia
    Posts
    183

    Unanswered: bcp copying,but no file

    DECLARE @query NVARCHAR(2000)
    SELECT @query = 'bcp "SELECT * from dbname..tablename" queryout c:\test.txt -c -Slocalhost -Usa -Ppassword'
    EXEC master.dbo.xp_cmdshell @query

    I have tried doing this with a test table and this is the output
    NULL
    Starting copy...
    NULL
    3 rows copied.
    Network packet size (bytes): 4096
    Clock Time (ms.): total 16
    NULL

    and I did have 3 row,but file is still not created, I have put the server name,login,pasword inside "" and without it,no error,no file.

    Could somebody please help me

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Where are you looking for the file?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •