Viewing 15 posts - 2,686 through 2,700 (of 2,894 total)
george.greiner (6/24/2010)
...I have not used cursors before...
And I believe, you don't need to use the cursor in this case as well 😀
Please provide some DDL script to setup tables and...
June 24, 2010 at 11:09 am
I don't think you can do it with FOR XML AUTO, you need to use EXPLICIT option.
Try:
-- setup test data
/*
insert into Table_1 select 1, 'f1 data', 'f2 data'
insert into...
June 24, 2010 at 11:02 am
Here is minimalist approach (use setup provided by skcadavre):
DELETE dbo.table1 OUTPUT deleted.places INTO dbo.table2 (places)
INSERT INTO dbo.table1 (places)
SELECT DISTINCT places FROM dbo.table2
There is a setback here: if, at the...
June 24, 2010 at 8:50 am
Marking performance good or bad mostly depends on requirements and of cause of what you are doing.
For example, business expects that search of some data in a web based application...
June 24, 2010 at 8:30 am
The error you are getting is due to grouping by a constant result value of
CASE
WHEN @timespan = 'YTD'
THEN DATEPART(Year,getdate())
WHEN @timespan = 'Q'+CAST(DATEPART(quarter,getdate()) AS VARCHAR)+' '+CAST(DATEPART(YEAR,getdate()) AS VARCHAR)
THEN...
June 24, 2010 at 7:51 am
Jeff Moden (6/24/2010)
Eugene Elutin (6/24/2010)
Jeff Moden (6/23/2010)
June 24, 2010 at 7:34 am
What the row number is to do with ID's of records?
Just delete it and that's it, when retrieving records back order them by ID. You should not delete record by...
June 24, 2010 at 6:05 am
You better not update the IDs.
Is any valid reason or requirement to do it?
At the end you don't need the cursor to do re-numbering.
June 24, 2010 at 5:34 am
GilaMonster (6/24/2010)
Eugene Elutin (6/24/2010)
Hi Joe, since when are you back to a dusty Texas? Or how you managed to get internet connection in your Borneo hut?That's uncalled for.
I would like...
June 24, 2010 at 5:06 am
Thanks, Paul!
That is the key! Adding another index to the table made me happy and explained everything!
As soon as second (non-clustered) index added, SQL may deside to use it to...
June 24, 2010 at 4:07 am
The following might cause your problem (in select part):
CASE
WHEN c.Perfect_Journey_Tech_Exception_Flag IS NULL
OR c.Perfect_Journey_Tech_Exception_Flag = 0
THEN COUNT(c.Container_Key) ELSE 0
END AS PerfectJourney
Try to change it to:
SUM(
CASE
WHEN c.Perfect_Journey_Tech_Exception_Flag...
June 24, 2010 at 3:57 am
Vinay Theethira (6/24/2010)
June 24, 2010 at 3:49 am
Jeff Moden (6/23/2010)
June 24, 2010 at 3:39 am
Joe Celko (6/23/2010)
If you have some of my books, you can read a few thousand words on this topic. I don't have my usual "cut & paste" here right now,...
June 24, 2010 at 3:35 am
Viewing 15 posts - 2,686 through 2,700 (of 2,894 total)