?
Solved

The identifier that starts with 'INSERT INTO is too long Maximum length is 128.

Posted on 2005-03-10
13
Medium Priority
?
3,962 Views
Last Modified: 2009-11-14
Hello

I'm trying to run this insert command on sql sever but I keep getting this error message

"INSERT INTO tblLicense (NumberBought, ProductID, Cost, TypeID, ServerWorkstation, StartDate, RenwalDate, SupplierID, OrderNumber, Notes, TimeInputmaid, UserID) VALUES ('12', '19', '12', '3', 'S', '31/03/2005', '00:00:00', '3', 'ordeernumber', 'notes', '10/03/2005 11:28:07', '6') "


Server: Msg 103, Level 15, State 7, Line 1
The identifier that starts with 'INSERT INTO tblLicense (NumberBought, ProductID, Cost, TypeID, ServerWorkstation, StartDate, RenwalDate, SupplierID, OrderNumber' is too long. Maximum length is 128.


This insert command is generated by a vb.net program how do I get round this problem?

Thanks FRIBBLE
0
Comment
Question by:FRIBBLE1
  • 3
  • 2
  • 2
  • +5
13 Comments
 
LVL 11

Expert Comment

by:Ramesh Srinivas
ID: 13504931
Is the stored procedure...

Change (all of) your double quotes to single quotes. Double quoted items
are considered identifiers and as such your entire query is being treated as
a column name.

regards,

KS
0
 
LVL 23

Expert Comment

by:adathelad
ID: 13504933
Try removing the double quotes at the start and end of the statement. The error message thinks that you are providing an identifier (i.e. a column name) - these are limited to 128 characters
0
 
LVL 7

Expert Comment

by:lozzamoore
ID: 13504955

You may need to SET QUOTED_IDENTIFIERS OFF for this connection.
See the BOL page entitled: 103(error) for more information.

Is this command on its own, or does something come before it?

Do you have any triggers on the tblLicense table?

Thanks,
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:FRIBBLE1
ID: 13505004
Ok i've done that thats got rid of the first error.

It's now coming up with

Server: Msg 242, Level 16, State 3, Line 1
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The statement has been terminated.

This seems to be intermittent. The dates in sql server are in us format and the dates coming from my program are also in us format
MM/DD/YYYY


Thank FRIBBLE
0
 
LVL 7

Expert Comment

by:Mehul Shah
ID: 13505025
The problem is with the Renewal date column where the insert shows '00:00:00'
0
 
LVL 9

Expert Comment

by:solution46
ID: 13505028
Check the minimum date you are expecting to return. SQL Server will not be able to store any date earlier than 1 Jan 1799 and you will get this error.

s46.
0
 
LVL 23

Accepted Solution

by:
adathelad earned 1200 total points
ID: 13505029
I personally always pass dates into SQL using the yyyy-mm-dd format. This rules out any date conversion issues
0
 
LVL 7

Expert Comment

by:lozzamoore
ID: 13505038

Check the language of the login you are using is set to "English" aswell.
Or use an explicit "set dateformat mdy" command for the connection.

Ideally, use an unambigous date format in your insert statement, like ISO: e.g. yyyy-mm-dd as this is the format datetime columns will be stored in the database.

I'm sure VB.net will have a function to convert a date to ISO or something similar.

Hope that helps,
0
 
LVL 9

Expert Comment

by:solution46
ID: 13505039
Ah yes... MehulS78 is bob on (sorry, I forgot you were inserting set values, not reading them from a table).

Still, the problem is the same; you'd be best changing the renewal date to NULL (...'31/03/2005', , '3'...), but make sure your field accepts NULL values.
s46.
0
 
LVL 1

Author Comment

by:FRIBBLE1
ID: 13505055
the renwal date seems to work fine i will try changing the date format to yyyy-mm-dd and see what happens

0
 
LVL 23

Expert Comment

by:adathelad
ID: 13505061
The renewal date column is valid - by supplying 00:00:00, SQL Server will default the date to 1900-01-01


I think it's the start date field :'31/03/2005' - this is in the dmy format but sounds like SQL is trying to evaluate it in the mdy format. Hence, try passing in dates in the yyyy-mm-dd format, this cant go wrong
0
 

Expert Comment

by:kalyson1
ID: 25823425
It is astounding that FRIBBLE1 does not give at least partial credit to saleek, who answered the first problem he posted (the main problem he posted, in fact) with the correct solution.
0
 

Expert Comment

by:NIks
ID: 27625101
For passing string to a parameter, make sure it has single quotes in for double qoutes, also palces where we normally put single quotes ex: ColumnName like '%value%' has doubled single quotes making it look like ColumnName like ''%value%''

This should solve any problem occuring due to quotes
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.
Suggested Courses

621 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