» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 07-30-2006, 11:43 AM
CPM CPM is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
CPM is on a distinguished road
Default Why bcp cannot detect temporary table ?

Hello, please advise

Code:
CREATE PROCEDURE [SP_TEST]

AS

SELECT *
INTO #TMP_CUSTOMER
FROM O_CUSTOMER

-------------------------------------------------------------------------
SELECT DISTINCT
COUNT(CUST_CD)

FROM
#TMP_CUSTOMER
GO


when i run in query analyzer , using "exec SP_TEST" , it work and display result

but when run
Exec Master..xp_CmdShell 'bcp "exec mydbtest..SP_TEST " queryout C:\TEST.TXT -c -Slocalhost -Usa -Ppassword'

it give error "SQLState = S0002, NativeError = 208"
and show
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name '#TMP_CUSTOMER'.

thanks for suggestions -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 07-30-2006, 11:46 AM
shaad shaad is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
shaad is on a distinguished road
Default

should you as part of your stored procedure first check whether #TMP_CUSTOMER exists, and if it doesn't, create it ? -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #3  
Old 07-30-2006, 11:48 AM
CPM CPM is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
CPM is on a distinguished road
Default

hello

As i know temporary not necessary to check it existing , cause it is temporary table , so it will create in every new thread and drop after use , correct me if i wrong. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #4  
Old 07-30-2006, 11:51 AM
shaad shaad is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
shaad is on a distinguished road
Default

Not sure about temporary files since i hardly ever use them, but it can't hurt to try a belts-and-braces approach and see if it solves the problem.

Bye for now -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to add posts to a phpbb table after moving servers. tanny MySQL Forums 3 02-13-2007 03:44 PM
adding value to the table. Eshur MySQL Forums 1 11-29-2006 06:36 AM
temp table generation? Bshishe MySQL Forums 1 11-07-2006 04:28 AM
designing table relations? Jett MySQL Forums 1 08-17-2006 10:23 AM
error= #1036 - Table 'table' is read only futuristic PHP Programming and Tips 1 08-12-2006 10:21 AM


All times are GMT. The time now is 08:23 PM.