/    Sign up×
Community /Pin to ProfileBookmark

SQL Server & Stored Procedures

I’m not sure where to post this thread…

Hello all ?

What my problem is:
When I execute my stored procedure it gives an error back:
[FONT=courier new]Description = The identifier that starts with ‘blah..

[code cut]..blah’ is too long. Maximum length is 128.[/font]
I declared the field as ‘text’ so it can be 2^31-1 chars long…? I’m useing SQL Server. The field where I want to save this long string is ‘text’ type. I can type it directly into the database with no problems…

Isn’t it possible to send longer strings than 128 chars with a stored procedure? How do I have to solve the problem?

to post a comment
Full-stack Developer

4 Comments(s)

Copy linkTweet thisAlerts:
@CardboardHammerMay 13.2004 — The use of the word "identifier" suggests that it's either a parameter name or a field name that is too long (as, I believe, 128 characters is the limit for a name). If you supply too long of a string value for a n/var/char field or parameter, I believe it is just truncated down to the appropriate size. Double check to make sure that what you think you're trying to do is what you're actually doing.
Copy linkTweet thisAlerts:
@JayDieauthorMay 13.2004 — CardboardHammer: Double check to make sure that what you think you're trying to do is what you're actually doing.[/QUOTE]
Check... Check... Doublecheck!

It is, because if I give that parameter a shorter string (shorter than 128 chars) it works and the databasefield will be filled with the text (that string).

I don't change the parameter of field name (as far as I know).

So CardboardHammer, you say, if you give a too long string, it just cuts it off and places it into the database?

Thanks for your help!
Copy linkTweet thisAlerts:
@JayDieauthorMay 13.2004 — Little mistake...

What was wrong:

I did this:
EXEC sp_storedProc "1", "2", "text-more-than-128-chars"
I use SQL Server 7 and I didn't know you have to use single quotes...
EXEC sp_storedProc '1', '2', 'text-more-than-128-chars'
It works perfect!

But... can anybody tell me why? Does SQL Server makes a varchar(128) from a text with double quotes around it?
Copy linkTweet thisAlerts:
@CardboardHammerMay 13.2004 — Wild assed guess: based on the message provided, it sounds as though it was trying to treat that "text-more-than-128-chars" as if it were the name of a database object. Perhaps double quotes work the same as brackets for naming purposes? (Ex. perhaps [a table] is equivalent to "a table"... Not sure, because I'm not at work with all my documentation, and also because I avoid using names that have spaces or similar quirks... I had been bitten a few times early on using double quotes instead of singles for strings, but I don't recall the messages that I got.
×

Success!

Help @JayDie spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...