October 27, 2010 at 8:43 am
Hi everybody, in my package I have a variable FecArch of type String, and the Execute SQL Task with:
- Parameter Mapping: FecArch
- SQLStatement:
USE PRUEBA
DECLARE @FA VARCHAR(100)
SET @FA='dir C:\Interfaces_Peru_IN\FD\AU375D*' + ? + '* /b /o-d'
TRUNCATE TABLE bitacora
INSERT bitacora
EXEC master.dbo.xp_cmdshell @FA
But when I run the package show me the follow error:
[Execute SQL Task] Error: Executing the query "USE PRUEBA DECLARE @FA VARCHAR(100) SET @FA='dir C:\Interfaces_Peru_IN\FD\AU375D*' + ? + '* /b /o-d' TRUNCATE TABLE bitacora INSERT bitacora EXEC master.dbo.xp_cmdshell @FA" failed with the following error: "Syntax error, permission violation, or other nonspecific error". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Please how I can do it, for capture the variable FecArch and use in the sql statement master.dbo.xp_cmdshell with this variable.
Thanks by your help.
October 28, 2010 at 1:33 am
Help us to help you better.
Please explain what do you wish to do with EST(Execute SQL Task)
Raunak J
October 28, 2010 at 10:22 am
Are you getting this error when you schedule the package via a job and were successful from BIDS/VisStudio, or are you getting this from Visual Studio directly before a deployment during development/testing?
If you've tested sucessfully but the deployment is failing, login as the the SQLAgent service login and see if it has access to run cmdshell.
If you've not successfully tested at all, first thing is to take that script out of SSIS and drop it into SSMS query window, do some minor adjustments, and see if you can get it to fire there. I've found that sometimes you'll get better error messages from the query windows, and it may help narrow down the problem.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
October 28, 2010 at 2:06 pm
Dear, I want to execute a statement using xp_cmdshell using a variable of the package.
I am execute the package by SSIS.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply