Link to home
Start Free TrialLog in
Avatar of bnrtech
bnrtech

asked on

Input line too long

Hello,

I am encountering an error while trying to use a stored procedure to execute an SSIS package using the 32bit version of dtexec within a 64 bit environment. I run the following command using xp_cmdshell

SELECT @cmd = '""C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\dtexec.exe"" /F <path to dtsx file> /SET \Package.Variables[User::FileName].Properties[Value];<unc path> /SET \Package.Variables[User::CreateSQL].Properties[Value];"<sql create table statement>"'

exec master..xp_cmdshell @cmd
(Code is also attached)

And it results in the error "The input line is too long." I have also tried using two qoutes ("") instead of one with the same result.

Whenever I remove spaces from "sql create table statment" the execution succeeds, but the package fails because of malformed SQL. I have also tried not using quotes around the sql create statement but that fails with "Option "table" is not valid." The statements length is only around 317 characters so this is a bit puzzling. So far it seems to have something to do with the double quotes. But I believe they are needed to avoid issues with spaces in the sql.

I could try replacing spaces with underscores and then removing them in the package, but this same command works fine within 32 bit sql 2005 housed on a 32 bit windows server 2003 machine. So i would like to get it working.

Does any know exactly what the issue is?

SELECT @cmd = '""C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\dtexec.exe"" /F <path to dtsx file> /SET \Package.Variables[User::FileName].Properties[Value];<unc path> /SET \Package.Variables[User::CreateSQL].Properties[Value];"<sql create table statement>"'

exec master..xp_cmdshell @cmd

Open in new window

Avatar of Lowfatspread
Lowfatspread
Flag of United Kingdom of Great Britain and Northern Ireland image

how have you defines @c,d

and please show us the create table data...


but why can't you just create the table outside of the package?
ASKER CERTIFIED SOLUTION
Avatar of bnrtech
bnrtech

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial