Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002
    Posts
    5

    Question Unanswered: Is that possible to BCP queryout from a #tmptable?

    I have create a #tmptable and want to bcp queryout

    SET @bcpCommand = 'bcp "select * from #tblDisplay" queryout "c:\HAK.csv " -c -t -r\n -m100 -Usa -P -SNisdev4

    execute master..xp_cmdshell @bcpCommand

    But it say "no #tmptable this object".

    what can i do?

    PLS HELP.
    thank you

    ami

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    The problem is that you created #tmptable in one session but were trying to reference it while in another session (BCP). By design a temp table is ony visable to the session it was created in.

    If you are using SQL2K you can create a global temp table ## rather than #. look up "CREATE TABLE" in Books On Line and go dwon to the "Temporary Tables" section for more info.
    Paul Young
    (Knowledge is power! Get some!)

Posting Permissions

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