Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

operand type clash
I have a stored procedure that works fine on SQL Server 2000 or 2005,
but when run on an machine running MSDE, I get the Operand type clash,
int is incompatible with text data type error.  The data type is
actually text and text is the type of data being passed.  Any
parameters not being used are defaulted to null.  Any ideas why this
would happen on MSDE and work fine anywhere else?

Thanks so much.


Report this thread to moderator Post Follow-up to this message
Old Post
coop
12-21-05 01:24 AM


Re: operand type clash
I found a solution.  I knew it had something to do with null values,
so I dropped the table involved and recreated it declaring the
fields involved  with defaults of '' instead of null and that solved
the problem.

Original table structure:

CREATE TABLE [dbo].& #91;Employee_Fingerp
rint] (
[Location_Code] [varchar] (8) NOT NULL ,
[Employee_Code] [varchar] (8) NOT NULL ,
& #91;Fingerprint_Temp
late1] [text]  NOT NULL ,
& #91;Fingerprint_Temp
late2] [text]  NULL,
& #91;Fingerprint_Temp
late3] [text]  NULL,
& #91;Fingerprint_Temp
late4] [text]  NULL
) ON [PRIMARY]
GO

This caused operand type clash on MSDE when trying to insert a record,
but worked fine on SQL2000 and SQL2005

Restructuring the table like this:
CREATE TABLE [dbo].& #91;Employee_Fingerp
rint] (
[Location_Code] [varchar] (8) NOT NULL ,
[Employee_Code] [varchar] (8) NOT NULL ,
& #91;Fingerprint_Temp
late1] [text]  NOT NULL ,
& #91;Fingerprint_Temp
late2] [text]  DEFAULT '',
& #91;Fingerprint_Temp
late3] [text]  DEFAULT '' ,
& #91;Fingerprint_Temp
late4] [text]  DEFAULT ''
) ON [PRIMARY]
GO

solves the problem.

If any of you SQL gurus knows why, I'd really appreciate hearing
from you. It's been driving me nuts.


Report this thread to moderator Post Follow-up to this message
Old Post
coop
12-21-05 04:23 PM


Re: operand type clash
coop (carol.cooper@intura.com)  writes:
> I found a solution.  I knew it had something to do with null values,
> so I dropped the table involved and recreated it declaring the
> fields involved  with defaults of '' instead of null and that solved
> the problem.
>
> Original table structure:
>
> CREATE TABLE [dbo].& #91;Employee_Fingerp
rint] (
>      [Location_Code] [varchar] (8) NOT NULL ,
>      [Employee_Code] [varchar] (8) NOT NULL ,
>      & #91;Fingerprint_Temp
late1] [text]  NOT NULL ,
>      & #91;Fingerprint_Temp
late2] [text]  NULL,
>      & #91;Fingerprint_Temp
late3] [text]  NULL,
>      & #91;Fingerprint_Temp
late4] [text]  NULL
> ) ON [PRIMARY]
> GO
>
> This caused operand type clash on MSDE when trying to insert a record,
> but worked fine on SQL2000 and SQL2005
>
> Restructuring the table like this:
> CREATE TABLE [dbo].& #91;Employee_Fingerp
rint] (
>      [Location_Code] [varchar] (8) NOT NULL ,
>      [Employee_Code] [varchar] (8) NOT NULL ,
>      & #91;Fingerprint_Temp
late1] [text]  NOT NULL ,
>      & #91;Fingerprint_Temp
late2] [text]  DEFAULT '',
>      & #91;Fingerprint_Temp
late3] [text]  DEFAULT '' ,
>      & #91;Fingerprint_Temp
late4] [text]  DEFAULT ''
> ) ON [PRIMARY]
> GO
>
> solves the problem.
>
> If any of you SQL gurus knows why, I'd really appreciate hearing
> from you. It's been driving me nuts.

Maybe if you post the offending code, we might be able to think of
an explanation.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Report this thread to moderator Post Follow-up to this message
Old Post
Erland Sommarskog
12-22-05 01:25 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 04:14 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006