ExecSQL Task: Cannot pass variable and execute a stored procedure

Hello,

I try to start a trace on a server using SSIS. I have created an OLE Db connection and three variables defined at the Package scope. Here are the variables and definitions:

  • Trace_number, int32 with initial value of 0
  • File_name, String with no initial value
  • File Size, int64 with initial value of 0
The connection works fine, as there is other SQL Task queries that gives correct results with this connection.

So, for this SP, ther resultset is set to "None", the SQLSourceType is set to "Direct input". The SQLStatement is the following:

sp_create_trace ? Output, 0,?,?,NULL

I have also created the following parameter mapping
1.Fisrt parameter

  • Variable Name: "Trace_number"
  • Direction : Output
  • Data Type: Double
  • Parameter Name: "0"
2.Second parameter
  • Variable Name: "File_name"
  • Direction : Input
  • Data Type: NVARCHAR
  • Parameter Name: "1"
3.Third parameter
  • Variable Name: "File_size"
  • Direction : Input
  • Data Type: Large integer
  • Parameter Name: "2"
But, when I parse the query, I receive the following error message:

"The query failed to parse. Syntax error, permission violation, or other nonspecific error"

Or, I am sa on this server.

Could someone help me, please?

[1357 byte] By [RegisM] at [2007-12-17]

SQL Server

Site Classified