0

I have a variable called 'Test123' - it is a string.

I then have an Execute SQL Task. I have mapped the variable as a parameter - Direction = Input \ Data Type = String \ Parameter Name = 0 \ Size = 512

The actual SQL is thus:

 update [MyTable] set MyField = ? where MyField2 = 'xxx'

However, I keep receiving the error:

 "Incorrect syntax near '?'

Where am I going wrong? I thought you use the question mark for parameters (that I've mapped to the variable)

8
  • I assume you are using the Direct Input option for your SQLSourceType property? The error suggests you aren't. Commented Dec 11, 2018 at 14:24
  • Also, i recommend leaving the Parameter Size value as -1. Commented Dec 11, 2018 at 14:25
  • What type of Connection Manager is being used by the Execute SQL Task? Commented Dec 11, 2018 at 14:25
  • Already Direct Input yes. Tried Parameter Size as -1 to no avail. Connection Type = ADO.NET Commented Dec 11, 2018 at 14:34
  • 2
    See this answer in the duplicate: stackoverflow.com/a/46739168/1507566 Commented Dec 11, 2018 at 14:48

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.