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.
| Author |
Topic |
|
mike123
Master Smack Fu Yak Hacker
1462 Posts |
Posted - 2008-12-17 : 09:22:16
|
| Hi,I have a table, in which I am having domains passed in the format "http://www.google.com"but in the database they are stored purely in the format "www.google.com"obviously I am not going to get the matches I want like this, so I think I have 2 optionsWHERE domain = 'http://' + @referDomainOR@referDomain = REPLACE(@referDomain, 'http://', '')WHERE domain = @referDomainI am thinking the 2nd option is probably better for index reasons perhaps ? |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-12-17 : 09:38:30
|
this is enough:WHERE domain = REPLACE(@referDomain, 'http://', '')Webfred No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-12-17 : 10:34:10
|
WHERE domain LIKE '%' + @referDomain E 12°55'05.63"N 56°04'39.26" |
 |
|
|
|
|
|