CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2011
    Posts
    4

    query hints maximum command buffer size of 1023 bytes

    Hi All,

    I have an error that say's query hints maximum command buffer size of 1023 bytes. I've already researched on the web and found two solutions: first is to create and stored procedure and second is to create a view. Unfortunately I can not apply this two solutions because I'm not allowed to make changes in the database. Is there any other way to solve this problem. Thanks!

  2. #2
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: query hints maximum command buffer size of 1023 bytes

    Without knowing anything about the query or circumstances - I can only suggest working on fragmenting it into multiple smaller queries.

  3. #3
    Join Date
    Apr 2011
    Posts
    4

    Re: query hints maximum command buffer size of 1023 bytes

    Here is the query:

    Code:
    bcp "SELECT '\"' + isnull(rtrim(ltrim(code)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(name)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(address1)),' ') + ' ' + isnull(rtrim(ltrim(address2)),' ') + '\"' as address, 
    '\"' + isnull(rtrim(ltrim(area)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(do)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(country)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(timediff)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(person)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(num)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(curr)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(loc)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(fax)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(email)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(limit)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(cense)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(withof)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(prd)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(amt)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(start)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(end)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(witham)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(rr)),' ') + '\"', 
    '\"' + isnull(rtrim(ltrim(orf)),' ') + '\"', 
    FROM table 
    where code= 'ABC'" queryout C:\fo.csv -c -T -t,

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured