在MS SQL SERVER 安裝目錄下有個可執行文件叫 TEXTCOPY
下面是這個工具的描述:
Copies a single text or image value into or out of SQL Server
If the direction is IN (/I) then the data from the specified
TEXTCOPY [/S ][sqlserver]] [/U [login]] [/P ][password]]
[/D ][database]] [/T table] [/C column] [/W
[/F file] [{/I | /O}] [/K chunksize] [/Z] [/?]
/S sqlserver The SQL Server to connect to
specified
/U login The login to connect with
/P password The password for
/D database The database that contains the table with the text or image data
/T table The table that contains the text or image value
/C column The text or image column of
/W
/F file The file name
/I Copy text or image value into SQL Server from
/O Copy text or image value out of SQL Server into
/K chunksize Size of the data transfer buffer in bytes
/Z Display debug information while running
/? Display this usage information and exit
You will be prompted for any required options you did not specify
為此
CREATE PROCEDURE sp_textcopy (
@srvname varchar (
@login varchar (
@password varchar (
@dbname varchar (
@tbname varchar (
@colname varchar (
@filename varchar (
@whereclause varchar (
@direction char(
AS
DECLARE @exec_str varchar (
SELECT @exec_str =
EXEC master
下面是一個拷貝圖像到SQL Server的pubs數據庫的例子
logo
ame =
@login =
@password =
@dbname =
@tbname =
@colname =
@filename =
@whereclause =
@direction =
From:http://tw.wingwit.com/Article/program/SQLServer/201311/22537.html