Viewing 15 posts - 511 through 525 (of 1,439 total)
GSquared (9/7/2012)
Try this:
Expand the number of documents beyond 5 up to some reasonable number, like 10,000 or 1-million. Add...
September 10, 2012 at 3:00 am
It's not clear exactly what output you're expecting, but see if this helps
WITH Recur AS (
SELECT TaskID, Task, BaseTask, BaseTaskID, BaseTaskInterval, 1 AS Level
FROM #tblTasks
WHERE TaskID = BaseTaskID
UNION ALL
SELECT t.TaskID,...
September 6, 2012 at 9:13 am
Shadab Shah (9/5/2012)
Mark-101232 (9/5/2012)
SELECT name
FROM sys.objects
WHERE type='P' AND OBJECT_DEFINITION(object_id) LIKE '%myquery here%'
Your solution works only when every thing exact is pasted in myquery area in the above query. By the...
September 5, 2012 at 9:22 am
SELECT name
FROM sys.objects
WHERE type='P' AND OBJECT_DEFINITION(object_id) LIKE '%myquery here%'
September 5, 2012 at 8:51 am
See if this helps
select
MainLock.Process.value('@id', 'varchar(100)') AS LockID,
OwnerList.Owner.value('@id', 'varchar(200)') AS ProcessId,
...
September 4, 2012 at 3:15 am
Use a filtered index
CREATE UNIQUE INDEX IX ON [dbo].[ProjectFacilities] (ProjectNumber) WHERE [IsPrimaryFacility]=1
September 3, 2012 at 12:36 pm
Try this
;with cte1 as(
select t4.adinfid, t5.membername, t5.memberid, t3.adforumname
...
August 31, 2012 at 3:15 am
dwain.c (8/29/2012)
That's an interesting point on the IOs but in the below test harness (5 docs) it still runs pretty fast, although clearly not as fast as Mark's.
Create table #Doc...
August 29, 2012 at 9:12 pm
Another way
WITH CombinedRanges AS (
SELECT s1.NAME,
s1.LOCATION,
s1.DT_START,
MIN(t1.DT_END) AS DT_END...
August 29, 2012 at 9:36 am
Here's a way to generate some simple timing tests.
TRUNCATE TABLE GR;
TRUNCATE TABLE GE;
TRUNCATE TABLE Ref;
Insert into GR(DocNum, GR, Seq)
SELECT 1,'GR_'+CAST(number AS VARCHAR(10)),number
FROM master.dbo.spt_values
WHERE number BETWEEN 1 AND 500 AND type='P'
Insert...
August 29, 2012 at 8:01 am
RBarryYoung (8/28/2012)
Lynn Pettis (8/28/2012)
UPDATE Orders SET
some_col = (select
...
August 29, 2012 at 7:17 am
If you're willing to jump through a load of hoops, you can update both tables with a view
CREATE TABLE ABC (Id INT NOT NULL , Name VARCHAR(10), Tab CHAR(1) NOT...
August 29, 2012 at 5:07 am
WITH AllSeq AS (
SELECT Seq FROM GR
UNION
SELECT Seq FROM GE
UNION
SELECT Seq FROM Ref)
SELECT d.DocNum,
gr.GR,
gr.Seq AS GR_Seq,
...
August 28, 2012 at 10:04 am
Just for completeness, here's a recursive CTE way.
DECLARE @tTABLE(id INT,value INT)
INSERT @t(id, value)
VALUES (1, 2),(1, 3),(1, 4),(2, 5),(2, 6),(3, 7);
WITH CTE AS (
SELECT id,value,
...
August 24, 2012 at 9:08 am
RBarryYoung (8/23/2012)
Mark-101232 (8/23/2012)
RBarryYoung (8/23/2012)
Mark has it. That's what a Difference Query is... 🙂Have a look a Jeff Modens excellent article here[/url] for an explanation
Actually, Jeff and I learned...
August 23, 2012 at 4:02 pm
Viewing 15 posts - 511 through 525 (of 1,439 total)