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 |
|
krpmahesh
Starting Member
2 Posts |
Posted - 2008-02-14 : 01:50:05
|
| I have a column named tags which contains tagnames seperated by commas now i have to compare this column with a parameter named tagname which contains a single tagname how to do this.Please help mehere is my procedureALTER PROCEDURE [dbo].[ProcSoftwaresGetSoftwaresbyTags](@FileTag Varchar(64))ASBEGIN SELECT Category.CategoryName, Softwares.SoftwareFileID, Softwares.CategoryID, Softwares.FileName, Softwares.FileImage,Softwares.FilePath, Softwares.FilePublisher, Softwares.Adminrating, Softwares.FileDownloadCount,substring(Softwares.FileDescription,1,200)as FileDescription,convert(Varchar(12),Softwares.FilePostedDate,109)as FilePostedDate,Softwares.FileSize, SystemRequirements.OperatingSystemFROM Category INNER JOIN Softwares ON Category.CategoryID = Softwares.CategoryID INNER JOIN SystemRequirements ON Softwares.SoftwareFileID = SystemRequirements.SoftwareRequirementID where substring(Softwares.FileTag,0,3) LIKE substring(@FileTag,0,3) and FileStatus=1END |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-02-14 : 03:09:54
|
| where substring(Softwares.FileTag,0,3) LIKE '%' + substring(@FileTag,0,3) + '%' |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-02-14 : 03:39:55
|
| Also trywhere Softwares.FileTag LIKE substring(@FileTag,0,3) + '%'MadhivananFailing to plan is Planning to fail |
 |
|
|
krpmahesh
Starting Member
2 Posts |
Posted - 2008-02-14 : 06:05:00
|
| Thank you very much |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-14 : 06:17:28
|
where Softwares.FileTag LIKE '%' + substring(@FileTag, 1, 3) + '%' E 12°55'05.25"N 56°04'39.16" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-02-14 : 06:25:14
|
quote: Originally posted by Peso where Softwares.FileTag LIKE '%' + substring(@FileTag, 1, 3) + '%' E 12°55'05.25"N 56°04'39.16"
I forget about first value of substring MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|