bcp export with ROBUST PLAN ? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

bcp export with ROBUST PLAN ?

I am writing a stored procedure to perform an automated export of a group of tables. It needs to be dynamic plus other requirements which mean a predesigned DTS is not suitable. my stored proc queries information schema to get a list of fields on the table, then outputs them after some formatting according to data type. I then shell to bcp, to perform the export, passing the dynamic sql I have built. BCP complains
Query hints exceed maximum command buffer size of 1023 bytes (1311 bytes input).
: No error
NULL (3 row(s) affected) I have added the query option ROBUST PLAN, but this has not helped.
Any advice please ?
Hi all. Fixed my problem. I now have to create a dynamic temporary stored procedure which selects the result set I want exporting. I then ask bcp to execute this and export its contents A bit long winded though…
]]>