Sunday, February 19, 2012

data type error from SQL server

any one familiar with the following error:
___________error___________
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value 'xxx_xx_xxx' to a column of data type int
___________error___________

any help will be greatly appreciated
thanks in advanceWhen does this error occur? Are you doing an insert, update? It just seems like you are trying to put a data type into a column that cannot be implicitly converted.|||rlopez,
thanks for your reply

Actually this is root of a bigger problem that I am having.
So at the base level what I am trying is check if a primary key is present in the database table or not via an ASP page.

I call a SP to execute a select command and determine the presence of an ID.

The call from the calling ASP page obtains this querying ID from another ASP page. (not sure if I make myself clear enough here)

The way this page sends ID to the querying ASP page is via a link whose syntax is as follows:
<a href=xyz.asp?id=123_456_789>123_456_789</a>

The Id in SP and DB is defined as varchar (16). I am not sure why "int" data type error is being thrown by the SQL server on the resulting ASP page.

Thanks Again|||It's a bit difficult to figure out what is going on without the underlying data structure. Can you email me or post the table schema and the stored procedure code that is involved?|||it got fixed
It required a change in the way the data was being retrieved in the ASP code.
I had to use request.Querystring to get it workin.

Thanks again

No comments:

Post a Comment