This sample is a stand-alone console application that mimics the bcp utility that ships with Microsoft® SQL Server™ 2000. Unlike the bcp utility, the bii utility detects when an image field is the destination database field and the input is a filename that can be located in the file system. In this case, instead of loading the filename string into the image field, the program opens the file, loads the data, and inserts the file contents in the image data type field.
C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\Utils\bii
Running the Sample
To run the sample:
- Open SQL Query Analyzer, connect to an instance of SQL Server, and run the Createtb.sql query.
- Open a Command Prompt window and change the current directory to
C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\Utils\bii.
- Enter the following command (The -v option is optional; it displays current status.):
bii testinsert.bii -Syourservername -Dyourdbname -Usqlusername -Psqlpassword -t, -v