Viewing 15 posts - 16 through 30 (of 32 total)
Thank you, I would have been searching forever for that :hehe: I've since updated the code to work properly but still thought it was a bit strange.
October 24, 2008 at 9:25 am
Or save yourself the trouble and solve it with the information you already have
SELECT RTable.*
FROM RTable
INNER JOIN (
SELECT MAX(TheId.id) MaxId
FROM RTable TheId
INNER JOIN RTable TheSum ON TheSum.id <= TheId.ID
GROUP BY...
May 8, 2008 at 12:02 pm
Thanks for the info on the tally table. It was originially designed for 2k and not updated to 2k5 and didn't realize about the fill factor. Most of the reporting...
May 8, 2008 at 7:06 am
ok, I am getting the result set I finally need but it's still pretty messy, I abbreviated all the data needed but this code will run alone. Any ideas on...
May 7, 2008 at 11:35 am
Yes I did and it does work but I tweaked it to
UPDATE #tbl SET
...
May 5, 2008 at 8:49 am
that still returns
val rt
----------- -----------
1 1
2 ...
May 5, 2008 at 8:38 am
That article, great by the way, is where I got the idea from. I realized I forgot the with index hint and then also added option(maxdop 1) and still get...
May 5, 2008 at 5:28 am
I was working on a query in which an existing index covered what was needed but wanted to do a group by. I wanted to create a duplicate index in...
April 25, 2008 at 8:01 am
Awsome, the OUTPUT clause. As I said it was always 2000 development for me. I did get it to work for any SQL2K developers as follows which is the actual...
March 19, 2008 at 8:40 am
I was trying to keep the example to a minimum. The tblAdr table has more columns and it's posible for people/companies/banks/etc to have the same mailing address. The tblPrs is...
March 19, 2008 at 7:41 am
I had a similar issue and included a lot of table joins. I found the or condition was causing scans not seeks. I used the following to get the seeks...
January 23, 2008 at 9:42 am
ok, I've abbreviated more of my real code. Not all the fields, indexes, etc are included but maybe this can get my point accross a little better. Any and all...
January 18, 2008 at 6:27 am
Okay, this one intrigued me a lot. I often use * when beginning anything because "I'll worry about it later" but the idea that this was a performance issue was...
January 16, 2008 at 10:28 am
Keep in mind that this only works when the view is updated and not the underlying table changes that make up the view. If you need to track the changes...
January 16, 2008 at 6:38 am
I commonly use this for audit triggers
create trigger t_audit_tablename
on tablename
after insert, update, delete
as
begin
set nocount on
DECLARE @strOperation AS NVARCHAR(20)
--set operation variable
IF EXISTS(SELECT * FROM inserted) AND EXISTS(SELECT * FROM deleted)
set...
January 14, 2008 at 12:34 pm
Viewing 15 posts - 16 through 30 (of 32 total)