Viewing 15 posts - 1,231 through 1,245 (of 1,491 total)
Try putting you trigger code in a TRY block and adding a CATCH block containing the ROLLBACK statement.
April 5, 2007 at 3:48 am
Sean and I have given you outline solutions to your problem.
Without detailed information on your schema, and its data, it is difficult to give you more help.
You should now be...
April 5, 2007 at 3:33 am
I would be interested in knowing how the following performs:
SELECT CL.Code, CL.[Name]
FROM Country_lkp CL
WHERE EXISTS (
SELECT *
FROM SalesCountryDestination_lnk SCD
WHERE SCD.destinationcode = CL.Code
AND SCD.SalesCountryCode = @CountryCode
AND EXISTS (
SELECT *
FROM DestinationArticle_lnk DA
WHERE...
April 4, 2007 at 10:41 am
Try something like:
SELECT T1.*
FROM Table1 T1
LEFT JOIN Table2 T2
ON T1.CacheID = T2.CacheID
AND T2.LogType = 'Found'
AND T2.LogOwner = 'Sue'
WHERE T2.CacheID IS NULL
Putting the filters in the ON clause means they are...
April 4, 2007 at 3:35 am
If your site is going to be that heavily used, I suspect you will have problems timing the RESEED.
If bigint is too small for the IDENTITY column, try decimal(38).
April 3, 2007 at 10:46 am
You could try leaving the IDENTITY column alone and just subtract the MAX value from the previous day when it needs to be displayed.
To aid querying, the previous days MAX...
April 3, 2007 at 9:55 am
Without example source data it is difficult to tell what you want.
You may want something along the lines of:
-- Set up Tag List
DECLARE @TagList TABLE
(
TagID int NOT NULL
)
INSERT INTO @TagList
SELECT 35...
March 30, 2007 at 11:22 am
Instead of using a comma delimited list of subject IDs, and dynamic SQL, try re-writing the query with static SQL and a sub-query in the IN statement.
March 19, 2007 at 5:09 am
Jeff,
Thanks for taking the time to explain your algorithm.
March 19, 2007 at 5:03 am
Try something like:
SELECT R1.*, R2.*
FROM RegionLevels L
JOIN Regions R1
ON L.Level1Region = R1.RegionID
LEFT JOIN Regions R2
ON L.Level2Region = R2.RegionID
March 16, 2007 at 11:51 am
Thanks for this.
As a matter of interest, how quick is my style of solution if there is an index on status,code?
March 16, 2007 at 11:34 am
Thanks to David le Quesne for showing me the above approach. Here is the thread:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=303210&p=2
March 16, 2007 at 7:43 am
The logic for working out the above is:
1. Self join the table on status where one code is less than or equal to the other code:
SELECT T1.code AS MinCode
,T2.code AS...
March 16, 2007 at 7:24 am
The following is similar to Brian's code but should be more efficient. If you have more than 10000 rows you may be better off using cursors/temp tables.
SELECT MIN(D.MinCode) AS MinCode
,D.MaxCode
,D.status
FROM...
March 16, 2007 at 7:11 am
March 16, 2007 at 5:08 am
Viewing 15 posts - 1,231 through 1,245 (of 1,491 total)