2012年3月19日星期一

BCP Interactive - from script

I have a script where I'm doing a bcp out - I need to have the script do the format file on export.

Is there a way to run bcp interactively from script, accepting the defaults? THat way it will make a format file for me.

when you use bcp, a format file is not required, most of our scripts just use the native defaults, we never use format files. Is there a reason you need a format file?|||THis is for an archiving process, and I need to automate the BCP back in...is there a way to bcp in without a format file? I've always used one...|||yes, you can bcp in without a format file. We've never ever had to use a format file when bcp'ing in or out. Of course our datatypes always matched, and we always use -n, but I'm sure -c works as well.|||You can generate a format file like so:

bcp pubs..authors2 format nul -fc:\authors.fmt -Sservername -Usa -Ppassword|||

Thanks so much!

I couldn't find anything anywhere.

THis solves a big problem.

没有评论:

发表评论