Viewing 15 posts - 1,351 through 1,365 (of 1,438 total)
Use
CASE ... WHEN ... THEN ... ELSE ... END
March 27, 2008 at 5:55 am
You can remove duplicates using this
delete from mytable
where exists (select * from mytable t2
where t2.UserName=mytable.UserName
...
March 24, 2008 at 3:00 pm
I find this really useful
March 20, 2008 at 4:52 am
Try using an indexed view
create view dbo.myview
with schemabinding
as
select TvsFormNo
from dbo.TvsRecords
where TvsFormNo is not null
go
create unique clustered index uix_myview on dbo.myview (TvsFormNo)
Also...
March 19, 2008 at 1:32 am
Maybe this ?
select r.SessionID
from Requests r
inner join PageFlow p on p.MatchValue=r.PageUrl
group by r.SessionID
having count(distinct r.PageUrl)=(select count(distinct MatchValue) from PageFlow)
March 13, 2008 at 8:02 am
Personally I avoid FOR XML EXPLICIT in SQL Server 2005 and use FOR XML PATH instead
CREATE FUNCTION dbo.GetSubTree(@id int)
RETURNS XML
BEGIN RETURN
(SELECT id AS "@id",
...
February 29, 2008 at 3:49 am
Using a different approach
select X.h_id, X.l_id, X.ton
from #t1 X
where not exists (select * from #t1 Y
...
February 28, 2008 at 10:15 am
Sample data would help...
select g.ID,g.Name
from Groups g
where exists (select 1
from Search s
...
February 28, 2008 at 8:15 am
Maybe this?
select T1.client_id,T1.services_rendered,T1.date
from T1
where not exists (select T2.client_id
from T2
...
February 28, 2008 at 6:26 am
Try this. Probably not very efficient on large data sets though
WITH CTE AS
(SELECT checkInOutID,
employeeID,
isCheckInOut,
...
February 26, 2008 at 9:45 am
Easier to use FOR XML PATH
select b.externalid as "@externalid",
b.ititid as "@ititid",
b.containstype as "@containstype",
...
February 26, 2008 at 4:19 am
See if this helps
create table missingdates(person varchar(10),division varchar(10), dt datetime)
insert into missingdates(person,division,dt)
select 'John','Div1','20080711' union all
select 'John','Div1','20080712' union all
select 'John','Div1','20080713' union all
select 'John','Div1','20080805' union all
select 'John','Div2','20081211' union all
select 'John','Div2','20081212'
select lbound.person,
...
February 15, 2008 at 4:16 pm
create table #Teams (Id int, ParentId int, name varchar(100), Position int)
insert into #Teams(Id, ParentId, Name,Position)
select 1, 0, 'Items', 1 union all
select 2, 0, 'Standings', 3 union all
select 3, 0,...
February 14, 2008 at 3:23 am
Really don't know. It works on the all of the 2005 machines I've tried and fails on the 2000 machine with the exact same error.
February 11, 2008 at 10:30 am
Viewing 15 posts - 1,351 through 1,365 (of 1,438 total)