[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Maximum length is 128.

Posted on 2001-06-07
19
Medium Priority
?
1,922 Views
Last Modified: 2008-03-04
HELP!!!

When executed in query analyzer (or DoCmd.RunSQL for that matter...)

EXEC spUPDATE_InitialDescriptor 1128, "Thinly sliced smoked ham, sandwiched with real cheddar cheese and baked egg in a hearty bagel.  Have it grilled or microwave at your office."

I get this message...

Server: Msg 103, Level 15, State 7, Line 1
The identifier that starts with 'Thinly sliced smoked ham, sandwiched with real cheddar cheese and baked egg in a hearty bagel.  Have it grilled or microwave at ' is too long. Maximum length is 128.

I would give more points on this if i could--  but please don't make me have a conniption over this one--  I need to pass longer strings into a parameter for a stored procedure...

Should I use ADO instead?  GetChunk/AppendChunk?

Thanks a ton!!
206 694 6384
0
Comment
Question by:AAMFK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 15
  • 3
19 Comments
 

Expert Comment

by:Hotwu
ID: 6166015
looks like a type error bro, not necessarily what you are using to insert the data. try changing your data type?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6166566
This should work:

EXEC spUPDATE_InitialDescriptor 1128, 'Thinly sliced smoked ham, sandwiched with real cheddar cheese
and baked egg in a hearty bagel.  Have it grilled or microwave at your office.'

The " (double quotes) are used for identifiers...

You can also try this:
SET QUOTED_IDENTIFIER OFF
EXEC spUPDATE_InitialDescriptor 1128, "Thinly sliced smoked ham, sandwiched with real cheddar cheese
and baked egg in a hearty bagel.  Have it grilled or microwave at your office."

Cheers
0
 
LVL 1

Author Comment

by:AAMFK
ID: 6168834
The datatype I have been using is varchar (600)

Additionally, I have tried Char and NVarChar...

0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 1

Author Comment

by:AAMFK
ID: 6172433
A;

What does this Sp do?

SET QUOTED_IDENTIFIER OFF

0
 
LVL 1

Author Comment

by:AAMFK
ID: 6174825
Also--  just wanted to let people know that the files that Im importing are up to 4400 characters--

I just found that out--  I was thinking that 500 was the maximum--  but i wrote something that let me keep track of whenever the MaxLength is increased...

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6175909
Normally, your identifiers (table names, column names) can be named without any quotes or brackets:

SELECT YourColumn FROM YourTable

However, if you have names that have special caracters in it (like spaces), or if the names are reserved words, you need to enclose the names:

SELECT "Your Column" FROM "Your Table"
SELECT [Your Column] FROM [Your Table]

If you want to specify a string constant, you have to use single quotes:
INSERT INTO YourTable VALUES ('My Name')

SET QUOTED_IDENTIFIER OFF
This will make that the double quotes will also be used for strings, ie the next examples will produce the same result:
INSERT INTO YourTable VALUES ('My Name')
INSERT INTO YourTable VALUES ("My Name")

Cheers
0
 
LVL 1

Author Comment

by:AAMFK
ID: 6178135
Ok-  Ill give that a shot..

Im trying to keep on raising the value for this question--  I am desperate for a solution for this one.. (holding up a _big_ project involving the past 6-9 months of my life..)
0
 
LVL 1

Author Comment

by:AAMFK
ID: 6184656
Im looking for some help with the TSQL WriteText or UpdateText commands/functions..

I read BOL for SQL 7.0; and it all still seems kindof obnoxious..

Have you guys ever used these TSQL Commands?

I think that I basically have them working now--  except for the fact that I still cough on any text around 600 characters..
0
 
LVL 1

Author Comment

by:AAMFK
ID: 6192160
Ok guys... please help...

I am using the TSQL WriteText/UpdateText commands (in the Stored Procedure)..

Basically, it looks like it helps--  but then again I am only importing something like 2200 out of 4500 text files successfully.

Again, I really wish that I had more points to give--  I am increasing the points on this as often as I can...

0
 
LVL 1

Author Comment

by:AAMFK
ID: 6215659
This is the new SP that is still causing problems..


Alter PROCEDURE dbo.spUpdate_InitialDescriptor
@PLU smallint,
@STRING TEXT
AS
exec sp_DbOption 'BRIAZZ', 'select into/bulkcopy', True
Declare @Pointervalue Varbinary(16)
-- declare a local variable to store the pointer
-- find and assig the value of the pointer
Select @Pointervalue = TEXTPTR(InitialDescriptor)
From Products
WHERE     (PLU = @PLU)
-- Alter the value of the text field
WRITETEXT DBO.Products.InitialDescriptor @Pointervalue @String
0
 
LVL 1

Author Comment

by:AAMFK
ID: 6215692
I lied.  here is the text for this SP:

Alter PROCEDURE dbo.spUpdate_NutritionalStatement
@PLU smallint,
@STRING TEXT
AS
exec sp_DbOption 'Briazz', 'select into/bulkcopy', True
Declare @Pointervalue Varbinary(16)
-- declare a local variable to store the pointer
-- find and assig the value of the pointer
Select @Pointervalue = TEXTPTR(NutitionalStatement)
From Products
WHERE     (PLU = @PLU)
-- Alter the value of the text field
WRITETEXT DBO.Products.NutitionalStatement @Pointervalue @String

Here is the EXEC Statement that calls this (with the associated data)

EXEC spUPDATE_NutitionalStatement 1091, 'Serv size: 1 package of cereal, Amount Per Serving:  Calories  530, Fat Cal. 60,  Total Fat  6g(10%DV), Sat Fat 0g(0%DV),  Cholest.  0mg(0%DV), Sodium 530mg(22%DV),  Total Carb.  111g(37%DV), Fiber 8g(30%DV), Sugars 48g,  Protein  10g, Vitamin A(0%DV), Vitamin C(0%DV), Calcium(6%DV), Iron(15%DV), Percent Daily Values(DV) are based on a 2000 calorie diet.'
0
 
LVL 1

Author Comment

by:AAMFK
ID: 6218125
i think that i got most of the nutritionalstatement problems ironed out..

i think that it was just that i was misspelling Nutritional...

Can anyone help me more?  Please?
0
 
LVL 1

Author Comment

by:AAMFK
ID: 6218130
so in other words; im still having occasional problems with long fields...

Does anyone know for sure how long WRITETEXT can handle?  

Or is the limitation in the ADP Database itself?  (Obviously the answer to this is no, because when i try these with the query analyzer, it doesn't work either...)

0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 480 total points
ID: 6223398
I don't know the max size for the writetext, but i know the following:
Select @Pointervalue = TEXTPTR(NutitionalStatement)

If the NutitionalStatement is NULL (which is normally the case after the row has been created, TEXTPTR returns NULL too, which makes the WriteText function fail!
You have to update the NutitionalStatement field first:
UPDATE Products
SET NutitionalStatement = 'x'
WHERE  (PLU = @PLU)
after this, you can use the TEXTPTR function...

Cheers
0
 
LVL 1

Author Comment

by:AAMFK
ID: 6223454
Ill give that a shot.. thanks..

Aaron
0
 
LVL 1

Author Comment

by:AAMFK
ID: 6236170
that didn't help..

the files aren't null..  

are there any better TSQL Debugges other than the Query Analyzer that comes with SQL 2000????

Aaron
0
 
LVL 1

Author Comment

by:AAMFK
ID: 6258387
hotwu

how could this be a datatype error..
i dont' understand.

the field itself is 'text'--

can i/should i make a custom datatype?
0
 
LVL 1

Author Comment

by:AAMFK
ID: 6792979
thanks for all your help, guys..

0
 
LVL 1

Author Comment

by:AAMFK
ID: 6792983
thanks for all the help, guys.

0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question