August 9, 2005 at 8:33 am
I have a SP that recieves parameters except that when sending down one parameter I get the following error.
The identifier that starts with....is too long. Maximum length is 128.
I have one parameter that is passing a length of 140.
Is there a way to increase this size pass 128?
Thanks
August 9, 2005 at 8:38 am
AFAIK, nope.
BOL states the max identifier length as 128 characters. Can't go beyond that.
/Kenneth
August 9, 2005 at 10:52 am
Ah, now I understand the problem (duh)
Don't use double quotes around strings, use single quotes. This is the most bulletproof solution, since then it doesn't matter if QUOTED_IDENTIFIER is set to either OFF or ON. Remember, in Transact-SQL, always use single quotes, never double quotes.
If, somehow you can't avoid to use double quotes denoting strings, then you must ensure that for the connection QUOTED_IDENTIFIER is set to OFF. It's a bit more hassle this way, since each connection can override the serversetting - you have to enforce this everywhere in the clientcode making the connection...
/Kenneth
June 25, 2008 at 3:46 am
Single quote should be used when passing String to a query or Stroed Procedure in Transact SQL
January 27, 2011 at 6:55 pm
Thanks guys! the single quote idea worked for me.
March 20, 2012 at 9:56 am
I am getting the exact same error. I have a huge binary file and I want to pass the binary content (as is) from Visual FoxPro to SQL Server using insert command or update command. I am getting this error. Is there a way to bypass this error?
My SQL command looks like this
insert into Settings (SettingVal) values (cast (long binary string here as varbinary(max)) -- tried using image with the same result.
May be I should try adding single quotes around the varbinary value?
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply