July 30, 2018 at 1:57 pm
Trying to Convert VBScript Com Object to PS.
VbScript:
Set objPkg = CreateObject("DTS.Package")
objPkg.LoadFromSQLServer machine,,,DTSSQLStgFlag_UseTrustedConnection,,,,packageName
objPkg.Execute
PS:
$DTSSQLStgFlag_UseTrustedConnection = 0x100
$dtsapp = New-Object -ComObject DTS.Package
$dtsapp.LoadFromSqlServer(
$server,
[type]::Missing,
[type]::Missing,
$DTSSQLStgFlag_UseTrustedConnection,
[type]::Missing,
[type]::Missing,
[type]::Missing,
$pkgname
)
Throws error.
Exception calling "LoadFromSQLServer" with "8" argument(s): "Error converting data type varchar to uniqueidentifier
Any Help?
Thanks,
July 30, 2018 at 4:55 pm
Bruin - Monday, July 30, 2018 1:57 PMTrying to Convert VBScript Com Object to PS.VbScript:
Set objPkg = CreateObject("DTS.Package")
objPkg.LoadFromSQLServer machine,,,DTSSQLStgFlag_UseTrustedConnection,,,,packageName
objPkg.ExecutePS:
$DTSSQLStgFlag_UseTrustedConnection = 0x100
$dtsapp = New-Object -ComObject DTS.Package
$dtsapp.LoadFromSqlServer(
$server,
[type]::Missing,
[type]::Missing,
$DTSSQLStgFlag_UseTrustedConnection,
[type]::Missing,
[type]::Missing,
[type]::Missing,
$pkgname
)Throws error.
Exception calling "LoadFromSQLServer" with "8" argument(s): "Error converting data type varchar to uniqueidentifierAny Help?
Thanks,
There are quite a few examples available - try one of these approaches:
SSIS and PowerShell in SQL Server 2012
Execute an SSIS Package from Powershell
Run an SSIS package with PowerShell
Sue
July 30, 2018 at 5:48 pm
Its an older DTS package that has been converted to SSIS.
July 30, 2018 at 5:58 pm
Its an older DTS package that has "NOT" has been converted to SSIS.
November 15, 2018 at 2:59 pm
any thoughts on how to convert this script .. without going the SSIS route?
Thanks
April 4, 2019 at 11:24 pm
I know this is old but any ideas how to make this run?
PS:
$DTSSQLStgFlag_UseTrustedConnection = 0x100
$dtsapp = New-Object -ComObject DTS.Package
$dtsapp.LoadFromSqlServer(
$server,
[type]::Missing,
[type]::Missing,
$DTSSQLStgFlag_UseTrustedConnection,
[type]::Missing,
[type]::Missing,
[type]::Missing,
$pkgname
)
Throws error.
Exception calling “LoadFromSQLServer” with “8” argument(s): “Error converting data type varchar to uniqueidentifier
April 4, 2019 at 11:28 pm
in the vbscript version you pass in the OLD DTS package and the server
so from a cmd script its csript vbsrun pgkname server
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply