Subscribe to Subscribers

Online Members

ankita
More...

Forums » .NET » SQL Server »

SQL query


Posted Date: 27 Jun 2008      Posted By:: krishna chaitanya     Member Level: Gold    Member Rank: 798     Points: 1   Responses: 3



thank u for replay
yes i used like its working but am using stored procedure

my s.p is

declare @site as varchar(50)
set @site='40'
declare @t1 table
(
t1 int
)

while charindex(',',@site) > 0
begin
insert into @t1 select substring(@site,1,(charindex(',',@site)-1))
SET @site = substring(@site,charindex(',',@site)+1,len(@site))
end
insert into @t1
select @site


Select m.ItemId, m.CreatedByUser, m.FileFriendlyName, m.FileNameUrl, m.FileSize, m.CreatedDate, m.Category, m.ItemType, m.DestructionDate, m.Acls, m.RealFolderPath, m.RealFileName, m.IndexField2
from Documents m
where m.moduleid =12 and m.FileNameUrl =RTrim('E:\NRA-2\NRAFilesRepository\MyDocuments\')
and (Acls in (select * from @t1))---> hear acls in am using how to use 'like'

acls like (select * from @t1) it is not working how to use that one








Responses

#256453    Author: Bunty      Member Level: Gold      Member Rank: 14     Date: 27/Jun/2008   Rating: 2 out of 52 out of 5     Points: 3

Hi,

It's my pleasure.

I want to know onething we can declare as a table because table is not a datatype.

Waiting for your reply.

Thanks and Regards
S.S.Bajoria


Thanks & Regards


Bunty

Expertise Dot Net On Earth


 
#256466    Author: RajaSekaran R      Member Level: Gold      Member Rank: 0     Date: 27/Jun/2008   Rating: 2 out of 52 out of 5     Points: 4

check whether u are getting value in the @t1 table.

only if u get some rows their u can get the output in last select statement..

so have an i condition in the last select like
If (select count(*) from @t1 ) >= 1
// ur statement with @t1 comparison
else
// statement without using @t1


Hope u got it..


 
#257130    Author: Gaurav Agrawal      Member Level: Gold      Member Rank: 176     Date: 28/Jun/2008   Rating: 2 out of 52 out of 5     Points: 3

Register urself on this site for earning money by using this link

http://www.rupeemail.in/rupeemail/invite.do?in=MTAxNTM0JSMlS0hqblZtUFI0c3BmTmw2azNNVDhyb1dCaA==

GA

Thanks & Regards,
Gaurav Agrawal
http://www.planetofcoders.com/





 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : SQL query
Previous : RowID From Sqlserver2000
Return to Discussion Forum
Post New Message
Category:

Related Messages

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Talk to Webmaster Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2013 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.