Viewing 15 posts - 5,266 through 5,280 (of 6,036 total)
UPDATE T1
SET ACT = T2.ACT
FROM Table T1
INNER JOIN Table T2 ON T1.Action = T2.Action AND T1.Code = T2.Code
WHERE T2.AC = 'AA' AND T1.AC = 'BB'
AND...
_____________
Code for TallyGenerator
July 16, 2006 at 11:22 pm
July 16, 2006 at 6:25 pm
Not in this case.
If to make queries identical:
IF Object_ID('[test_dt]') IS NOT NULL
DROP TABLE [test_dt]
CREATE TABLE [test_dt](
Task nvarchar(50),
date datetime)
INSERT INTO [test_dt]
SELECT...
_____________
Code for TallyGenerator
July 13, 2006 at 4:16 pm
Select T1.Inspection, T1.Log_Date, T1.Log_Date - MAX(T2.Log_Date) as TimeGap
FROM InspectionRecord T1
LEFT JOIN InspectionRecord T2 ON T1.Inspection = T2.Inspection AND T1.Log_Date > T2.Log_Date
GROUP BY T1.Inspection, T1.Log_Date
_____________
Code for TallyGenerator
July 12, 2006 at 3:10 pm
What are the datatypes for @CheckForUserID and UserID ?
Are you sure your column UserID contains different values?
_____________
Code for TallyGenerator
July 11, 2006 at 7:45 pm
You should remove ISNULL's from your function.
If source values not supplied result must be NULL. Now you may just fool yourself and your customers calculating distance to Greenwich meridian when...
_____________
Code for TallyGenerator
July 11, 2006 at 7:40 pm
Check out sp_executesql in BOL.
_____________
Code for TallyGenerator
July 11, 2006 at 3:32 pm
Check out topic "triggers, first trigger" in BOL.
_____________
Code for TallyGenerator
July 11, 2006 at 3:28 pm
If you can explain why you need to restore exactly the same values in timestamp column and what use of it you mean to have we'll probably think about solution...
_____________
Code for TallyGenerator
July 11, 2006 at 12:00 am
If you change the schema (set of returned fields is a part of schema) you need to change the code.
But it must not be manual.
If you have a table with...
_____________
Code for TallyGenerator
July 10, 2006 at 9:42 pm
Just to simplify Ryan's solution:
ALTER TABLE Claims
ADD CONSTRAINT CKTbl_Claims_DateClosed
CHECK (ClaimStatusID <> 2 OR DateClosed IS NOT NULL)
_____________
Code for TallyGenerator
July 10, 2006 at 6:03 pm
UPDATE A
SET name = ISNULL(BN.value, A.name),
email = ISNULL(be.Value, A.email),
age = ISNUL(BA.value, A.age)
FROM tblA A
LEFT JOIN tblB BN ON BN.id = A.id and BN.columnname = 'name'
LEFT JOIN tblB BE...
_____________
Code for TallyGenerator
July 10, 2006 at 4:52 pm
I believe if you create indexes on both H.DialID and D.DialID run time must fall under 1 second.
Not to mention an index on D.ProjectID, of course.![]()
_____________
Code for TallyGenerator
July 9, 2006 at 7:44 pm
Select Identity(int, 1,1) as ID, A, B,C
INTO #Table
FROM TheTable
ORDER BY A, B, C
Select T.A, T.B, T.C, COUNT(DT.ID) as Seq
FROM #Table T
INNER JOIN #Table DT ON T.A = DT.A AND T.ID...
_____________
Code for TallyGenerator
July 9, 2006 at 7:35 pm
SELECT CreationDate , Amount
FROM Test WITH(NOLOCK)
WHERE CreationDate >= '2006/07/01'
AND CAST(NULLIF(Amount, '') AS FLOAT) <= '10000'
_____________
Code for TallyGenerator
July 8, 2006 at 5:13 pm
Viewing 15 posts - 5,266 through 5,280 (of 6,036 total)