Viewing 8 posts - 46 through 53 (of 53 total)
Hi guys,
My apologies, just realized that I pretty much repeated code already posted by someone else (never do things in a hurry!).
MB
March 25, 2011 at 7:21 am
LOL
Just realized, my previous post is same as:
select a.UserId,a.columnA,a.ColumnB from tableA a
left outer join FlaggedRecords b
on a.USerId=b.USerId
where ((@Flag=0 ))
Or
(@Flag=1 and b.UserId is not null)
Even easier!
March 24, 2011 at 11:59 pm
Hi,
I believe that htis will solve your problem:
select a.UserId,a.columnA,a.ColumnB from tableA a
left outer join FlaggedRecords b
on a.USerId=b.USerId
where ((@Flag=0 and b.UserId is null) or (@flag=0 and b.USerId is not...
March 24, 2011 at 11:56 pm
Hi
I could not really see how does this relate to SQL Server or TSQL, but let's give it a try...
Please, note that this is not the complete solution but the...
February 20, 2011 at 4:48 pm
Hi
You could also use:
execute sp_MSforeachDB @command1="use [?] select * from dbo.sysobjects where xtype='U'"
Keep in mind that system databases will be listed as well, although I don't think that should be...
February 17, 2011 at 7:00 pm
Try to rebuild the indexes on the tables that are used in that query
(If it suddenly starts working slower and recompiling doesn't help, set statistics io shows big numbers it...
December 15, 2009 at 3:42 pm
Additionally,
This (is not very elegant, I know) would return records from your example
DECLARE @tbl TABLE (Id INT , [Name] char(3), Lft INT , Rit INT , ParentId INT )
INSERT @tbl...
December 14, 2009 at 10:41 pm
Hi
Your query is returning ALL the left nodes, starting from node 1. (matches description of what you want)
Based on your example it seems that you want FIRST LEFT NODE to...
December 14, 2009 at 10:07 pm
Viewing 8 posts - 46 through 53 (of 53 total)