Viewing 15 posts - 571 through 585 (of 1,082 total)
what is the some processing select stuff?
Depending on what it is you may not need a cursor
November 10, 2008 at 10:21 am
well other than the fact that you missing half the BETWEEN statement I would say yes almost there.
c.Date > = DATEDIFF(yy,-5,GETDATE())
Please not the this will take into account time as...
November 10, 2008 at 10:17 am
Ok cool.
My question is why do you need a table, I'm going to assume that you want to work with the data set from the proc.
I assume this because otherwise...
November 10, 2008 at 10:15 am
Are you doing a pivot in your proc call?
What is it that you want to achieve here it might help us help you.
Thanks
Chris
November 10, 2008 at 10:07 am
Is the plan the same or different?
Could you post the plan for sum of us to look at?
November 10, 2008 at 6:32 am
Have you had any recent data changes as in large amounts of updates or inserts?
I would check the stats on the indexes in that query
November 10, 2008 at 6:21 am
HI there,
OK this is still not clear to me.
Please could you read this:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Then re-post your data samples for input and output
thanks
Chris
November 7, 2008 at 7:56 am
ok based on your first post I wrote up a query.
Does that query work?
November 7, 2008 at 7:21 am
Ok without a table structure or sample data and a sample of what you want to output this is hard.
but this is what I have so far:
[font="Courier New"]
DECLARE @imports TABLE
(
qty...
November 7, 2008 at 6:56 am
what are the possible years?
November 7, 2008 at 6:43 am
yes read up about the partitioning it's sort of like a "GRouping"
November 7, 2008 at 6:36 am
Try this:
[font="Courier New"]
DECLARE @MyTable TABLE
(
[Id] INT,
[User] VARCHAR(10),
[Item] CHAR(3),
[EventTime] DATETIME
)
INSERT INTO @MyTable
SELECT 1,'Bob','AAA','2008-02-02 11:02:51.000' UNION ALL
SELECT 2,'Bob','BBB','2008-02-04 09:10:52.000' UNION ALL
SELECT 3,'Sue','CCC','2008-02-04 15:00:13.000' UNION ALL
SELECT 4,'Bob','DDD','2008-02-04 16:02:05.000' UNION ALL
SELECT 5,'Peter','EEE','2008-02-07 16:03:43.000'...
November 7, 2008 at 6:18 am
Lynn yours would work if you LTRIM RTRIM the status first.
November 5, 2008 at 10:36 am
Viewing 15 posts - 571 through 585 (of 1,082 total)