Solved

Maximum length is 128.

Posted on 2001-06-07
19
1,908 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
  • 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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 120 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

829 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