Search code examples
sybasebcp

How to Generate Format file without doing BCP out operation in SYBASE explicitly


I am searching for a utility , which can help me generate Format file for any a table without doing BCP out in Sybase.

I understand and know about the solution for generating Format file by Invoking BCP out operation. but downside of this approach is as follows 1. It is completely manual and given a scenario where I have to do for 1600 tables with huge number of columns , it will be a nightmare . 2. if DDL of any table will change , then keeping track and regenerating will be a pain.

If any one can advice/suggest me a solution , with which I could achieve both or either one of the requirement , then it will ease my work.

Thanks Andy


Solution

  • You can automate this by using xp_cmdshell to kick off a BCP-out to generate a format file. You can call xp_cmdshell from a stored procedure so you can execute it for every table in the catalogs. But as mentioned here too, do you really need all those format files?