MS SQL 2000 - 使用xp_cmdshell在DTSRUN中的参数

时间:2022-02-08 10:26:48

I am running the following: master..xp_cmdshell 'dtsrun /S ricmssql02 /U admindw /P letmein /N "scott - debug"' but also send parameters. I am seeing the following to do that: /A global_parameter_name:typeid=value And also that the whole thing can be repeated to send multiple. My questions are; What is the delimiter for multiple? What are the values for typeid or do I even need it?

我运行以下:master..xp_cmdshell'dtsrun / S ricmssql02 / U admindw / P letmein / N“scott - debug”'但也发送参数。我看到以下内容:/ global_parameter_name:typeid = value并且整个事情可以重复发送多个。我的问题是;多个分隔符是什么? typeid的值是什么,或者我甚至需要它?

1 个解决方案

#1


1  

Although DTSRUN will usually work without it, the values for typeid are as follows:

虽然DTSRUN通常在没有它的情况下工作,但是typeid的值如下:

Data type Type ID
-----------------
Integer (small) 2
Integer 3
Real (4-byte) 4
Real (8-byte) 5
Currency 6
Date 7
String 8
Boolean 11
Decimal 14
Integer (1-byte) 16
Unsigned int (1-byte) 17
Unsigned int (2-byte) 18
Unsigned int (4-byte) 19
Integer (8-byte) 20
Unsigned int (8-byte) 21
Int 22
Unsigned int 23
HRESULT 25
Pointer 26
LPSTR 30
LPWSTR 31 

I'm not sure what you mean by "delimiter for multiple" - you need to have an /A for each variable you want to replace. So, if you wanted to set three string variables in your example:

我不确定“多重分隔符”是什么意思 - 你需要为要替换的每个变量都有一个/ A.所以,如果你想在你的例子中设置三个字符串变量:

master..xp_cmdshell 'dtsrun /S ricmssql02 /U admindw /P letmein /N "scott - debug" /A "param1:8=string 1" /A "param2:8=string 2" /A "param3:8=string 3"'

#1


1  

Although DTSRUN will usually work without it, the values for typeid are as follows:

虽然DTSRUN通常在没有它的情况下工作,但是typeid的值如下:

Data type Type ID
-----------------
Integer (small) 2
Integer 3
Real (4-byte) 4
Real (8-byte) 5
Currency 6
Date 7
String 8
Boolean 11
Decimal 14
Integer (1-byte) 16
Unsigned int (1-byte) 17
Unsigned int (2-byte) 18
Unsigned int (4-byte) 19
Integer (8-byte) 20
Unsigned int (8-byte) 21
Int 22
Unsigned int 23
HRESULT 25
Pointer 26
LPSTR 30
LPWSTR 31 

I'm not sure what you mean by "delimiter for multiple" - you need to have an /A for each variable you want to replace. So, if you wanted to set three string variables in your example:

我不确定“多重分隔符”是什么意思 - 你需要为要替换的每个变量都有一个/ A.所以,如果你想在你的例子中设置三个字符串变量:

master..xp_cmdshell 'dtsrun /S ricmssql02 /U admindw /P letmein /N "scott - debug" /A "param1:8=string 1" /A "param2:8=string 2" /A "param3:8=string 3"'