Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Integer wildcard

Author  Topic 

Scott
Posting Yak Master

145 Posts

Posted - 2002-01-25 : 03:28:43
Is there any way to use a wildcard in an integer where clause.
Building dynamic SQL in an asp page:
where int = 1 most times but also need
where int = '%,*...'
???

nr
SQLTeam MVY

12543 Posts

Posted - 2002-01-25 : 03:34:44
you can convert the integer to a varchar and use the string functions.

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.
Go to Top of Page

spock
Starting Member

35 Posts

Posted - 2002-01-25 : 03:36:52

select * from table where cast(emp_id as varchar(4)) like '20%'
this works.

kaushik

Go to Top of Page

kabapy
Starting Member

1 Post

Posted - 2009-08-21 : 13:18:39
It is Easy

use this

WHERE Id=@Id OR @Id=0

Pass the id for results for this id
and pass 0 to all Rows

You can replace 0 with -542313542 or any number below 0 for security purpose

Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-08-21 : 14:29:03
kabapy....9 year old thread?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-08-24 : 02:34:17
quote:
Originally posted by kabapy

It is Easy

use this

WHERE Id=@Id OR @Id=0

Pass the id for results for this id
and pass 0 to all Rows

You can replace 0 with -542313542 or any number below 0 for security purpose




Did you read the question fully?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-08-24 : 09:55:19
quote:
Originally posted by madhivanan
Did you read the question fully?


I may have read it fully - it's just that after 7 1/2 years he probably forgot what it was.

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -