Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Invalid operator for data type. Operator equals modulo, type equals varchar.

Posted on 2006-04-04
Medium Priority
Last Modified: 2012-06-27

Please kindly assist how can we resolve the error and what does this means?


Server: Msg 403, Level 16, State 1, Line 9
Invalid operator for data type. Operator equals modulo, type equals varchar.
Question by:DexterJones
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 400 total points
ID: 16369890
you have somewhere a module operator with at least on of the arguments being of data type varchar.
without the offending query code we cannot help more
LVL 75

Accepted Solution

Aneesh Retnakaran earned 1600 total points
ID: 16369892
you need to convert your field to 'int' before the % opr


cast (urField as int) % somvalue

Author Comment

ID: 16370109
it was '%' should have been ''%'' for building sql string.

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
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.
Suggested Courses

572 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