.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to convert varchar to = , > and < operators

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :Sql Server
I have a procedure like

create procedure emp_fill(@operator1 varchar, @operator2 varchar, @emp_salary int, @emp_comm int)
select * from employees where salary [>|=|<] @emp_salary and commission_pct [>|=|<] @emp_comm;

Now the problem is I am sending @operator1 and @operator2 parameter in this procedure either '>' or '=' or '<'
But I cannot write select * from employees where salary @operator1 @emp_salary and commission_pct @operator2 @emp_comm;

What I have to do to convert @operator1 and @operator2 which are varchar type, to change them as [>|=|<] operators and use them in the procedure.

pls help

View Complete Post

More Related Resource Links

Varchar string to int - how to convert empty cells to nulls

Hi, I have a large table from which I want to convert certain columns from varchar to int while loading the table to another table. However, I run into problems when the input column contains empty cells. The SSIS data conversion data flow item can't handle these so I tried the script component. With the script component I can convert these empty cells to zeros but after that I'd need to use SQL update to update the zeros to nulls which in the case of a large table with over 3 million rows takes unnecessarily long. So, is there another way?

convert datetime to varchar and again to datetime


Hi all,

I have a datetime column with value 2010-06-23 03:30:00.000

I need to convert this to varchar.after converting to varchar then again i need to convert the output to datetime2(3).

How can i do this.

thanks in advance!!

how to convert varchar to integer in ssis


I have  a source table with coulmn name phone_no with datatype as varchar(15).

In destination table the datatype equivalent to this column is integer.

for example if i have phone_no as 919009998886662 ,then what type of conversion I need to use so as to match with the target data type

I tried to execute but I got this kind of error

"Invalid character value for cast specification".

 "Conversion failed because the data value overflowed the specified type."

please help me on this


How to convert this varchar(max) to xml


Hello all,

I am writing a query to pull data from a database and then write to an xml file i think.  I have no errors showing in the query section itself only at the end when I am trying to convert the query which is saved in a varchar(max) variable to an xml variable.  here is the code.

select @strFRS = '<?xml version="1.0" encoding="UTF-8"?>

- <hdr:Document Id="Caddo_FRS' + @Date1 + '" 



	- <Header> 

		<Author>Polly Edwards</Author>

		<Organization>Caddo Nation</Organization>


		<CreationTime>' + @Date2 + '</CreationTime>



	- <Payload Operation="Original">

		- <facid:FacilityDetails schemaVersion="3.0" xsi:schemaLocation="http://www.exchangenetwork.net/schema/facilityid/3

			xmlns:facid="http://www.exchangenetwork.net/schema/facilityid/3" xmlns:

Convert English to Arabic number without changing any regional settings in .net

Well, most applications that I worked with was multilingual that supports English UI and Arabic UI.

And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC.

So the code below will help you to display Arabic number without changing any regional settings.

is it possible to convert whole visual studio 2008 web site project to visual studio 2010 web site p


is it possible to convert whole visual studio 2008 web site project to visual studio 2010 web site project


my current project references




i have a very annoying iis problem

iis server stops working until app pool is recycled


i am hoping that new visual studio (net framework 4.0) may solve this very annoying unsolveable problem


Convert excel file into xml


Hai, I have two columns with id,name in the excel sheet.I want to convert into xml file in the below format

<?xml version="1.0" encoding="utf-8"?>

<guide xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Boat id="1"> <name> Copper Kettle </name> </Boat> <Boat id="2"> <name> Copper Penny </name> </Boat> <Boat id="3"> <name> Copperhead </name> </Boat> <Boat id="4"> <name> Coppertone </name> </Boat> <Boat id="5"> <name> Copy Boy </name> </Boat> </guide>

suggest me with sample code in ASP.NET. Thanks


convert SQL data to EDI 835 file


I was assigned to create a app to convert SQL data to EDI 835 file. (Electronic Data Interchange file for Health Care Claim Payment/Advice,  outbound process only).

Can someone help me where to start?

Convert WCF service to self hosting application


 I created project as a  WCF Service application and now according to recuriment that needs to be converted as a self hosting application

How can i do this?

Converting WCF service app to Self hosting app?

How to Convert HTML to Image


 HI all,

I was struggling for the process/code to convert html to image. Please suggest any tutorials for this. And also any code help greatly appreciated.


thanks and regards,



convert jpeg to tiff


Hi all,

I need to comvert jpeg to tiff using c#.net

I have achieved this but problem is image size is increasing drastically. eg: 25 kb of jpeg image is converted to 650 kb of tiff image.

What should be done to have the same image size as of original or atleast double the image size as of original.

Please suggest me. Thanks in advance.

Crystal Report vs 2003 convert to vs 2008 parameter problem


Hi friend,

I have a project develop with Visual Studio 2003, when i convert the project to Visual Studio 2005 is work well. But when i convert to Visual Studio 2008, the crystal report when have pass parameter will prompt the parameter field to re-type then show the report.

But in this converted project i create a new report and pass the parameter is ok. That means i wan re-do all report @.@??

Does someone can help me solve this problem??

Thank you

Convert Cold Fusion to VB.Net


Could someone please help me convert the following code to VB.Net?  

<cfif isdefined("form. backgroundCheckResult")> 


                <cfif processingStatus eq "success">

                                <cfoutput>success </cfoutput>





Cannot convert type 'object[]' to 'byte[]'


I am doing this .. and i want to convert object array to byte array. How should I do that?

Object[] myVal = um.myData;

Byte[] byteArray = (Byte[])myVal;

Want to convert the code from c# to asp

  1.  WebRequest myWebRequest = WebRequest.Create(URL);  
  2.                 WebResponse myWebResponse = myWebRequest.GetResponse();  
  3.                 Stream ReceiveStream = myWebResponse.GetResponseStream();  
  4.                 Encoding encode = System.Text.Encoding.GetEncoding("utf-8");  
  5.                 StreamReader readStream = new StreamReader(ReceiveStream, encode);  
  6.                 string strResponse = readStream.ReadToEnd();  
  7.                 Response.Write("Response from site"

Upsize Your Database: Convert Your Microsoft Access Application to Take Advantage of SQL Server 7.0


What if you need to convert an existing Microsoft Access 97 database application into a true client-server application that is based on a SQL Server back end? If you know a little about Visual Basic and SQL Server, it's easy to make your app take advantage of the power and scalability provided by SQL Server 7.0. Using some concrete code examples, this article takes you step by step through converting the native Jet queries in your Access application into stored procedures and pass-through queries that SQL Server can use. You'll also learn how to pass on parameters when your client-server app calls these SQL Server stored procedures and queries.

Michael McManus

MSDN Magazine June 2000

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend