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
 Import/Export (DTS) and Replication (2000)
 Bcp Utility

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-10-29 : 09:08:59
venkatesh writes "Hi,

I have written a stored procedure for to wirite flat file.
Select with all coumns class builds dynamically based on the table name. So far it is working fine.
While executing following bcp command,it says the folowing error

SET @lv_bcp ='bcp "'+ @totname +'"' + ' queryout '+ rtrim(@lv_val) + 'first.txt -c -t'+' -a65534 '+ ' -S' + @@servername + ' -Uscbtest -Pscbtest'


bcp " Select REGION_ID+'|'+VALUE_CENTER_ID+'|'+PRODUCT_ID+'|'+cast(PERIOD as varchar (8))+'|'+cast(isnull(AC_NO_ACCT,' ') as varchar (8))+'|'+cast(isnull(FC_NO_ACCT,' ') as varchar (8))+'|'+cast(isnull(BD_NO_ACCT,' ') as varchar (8))+'|'+cast(isnumeric(AC_AGG_LMT_AMT) as varchar (13))+'|'+cast(isnumeric(FC_AGG_LMT_AMT) as varchar (13))+'|'+cast(isnumeric(BD_AGG_LMT_AMT) as varchar (13))+'|'+cast(isnumeric(AC_AGG_LMT_AMT_USD) as varchar (13))+'|'+cast(isnumeric(FC_AGG_LMT_AMT_USD) as varchar (13))+'|'+cast(isnumeric(BD_AGG_LMT_AMT_USD) as varchar (13))+'|'+cast(isnumeric(AC_DRAWDOWN_AMT) as varchar (13))+'|'+cast(isnumeric(FC_DRAWDOWN_AMT) as varchar (13))+'|'+cast(isnumeric(BD_DRAWDOWN_AMT) as varchar (13))+'|'+cast(isnumeric(AC_DRAWDOWN_AMT_USD) as varchar (13))+'|'+cast(isnumeric(FC_DRAWDOWN_AMT_USD) as varchar (13))+'|'+cast(isnumeric(BD_DRAWDOWN_AMT_USD) as varchar (13))+'|'+isnull(AC_REMARKS,' ')+'|'+isnull(FC_REMARKS,' ')+'|'+isnull(BD_REMARKS,' ')+'|'+cast(STATUS as varchar (4))+'|'+isnull(CREATE_USER,' ')+'|'+cast(isnull(CREATE_DATE,' ') as varchar (8))+'|'+cast(isnull(LAST_UPDATE_DATE,' ') as varchar(8)) from scb..D_NEW_BUSINESS" queryout c:/utldir/first.txt -c -t -a65534 -SSELVAKUMAR -Uscbtest -Pscbtest


"Query hints exceed maximum command buffer size of 1023 bytes (1152 bytes input)"


What should we do?
Please let me know the problem..




Thanks in advance
regards
Venkatesh"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-10-29 : 09:23:13
Your select statement is too long for bcp ... create a proc that returns the same rowset and call that proc from bcp ...

Jay White
{0}
Go to Top of Page
   

- Advertisement -