Viewing 15 posts - 571 through 585 (of 1,923 total)
How is this?
; WITH MaxValues AS
(
SELECT EEID , EFDT , DATA ,
MaxRow = ROW_NUMBER() OVER(PARTITION BY EEID ORDER...
November 22, 2011 at 1:20 am
i guess a cute written cursor will smoke recursive cte here. But it will be interesting to see how quirky update works. should be stunning fast here...
November 20, 2011 at 5:33 pm
For starters 🙂
here is the sample data..
IF OBJECT_ID ('#TempDB..#TempOne') IS NOT NULL
DROP TABLE #TempOne
GO
CREATE TABLE #TempOne
(
ID INT PRIMARY KEY...
November 20, 2011 at 5:25 pm
2 ways to do this,if there is an unique ID column.
1. Recursive CTE - not a performant one; will be similar to the performance numbers of cursors or while loops.
2....
November 20, 2011 at 4:45 pm
Does your table an ID column to know the order of the rows?? Without that it is highly impossible to code this requirement. With ID column, this can achieved without...
November 20, 2011 at 4:28 pm
Jeff Moden (11/19/2011)
November 19, 2011 at 11:43 pm
First the test data:
IF OBJECT_ID('TempDB..#Table') IS NOT NULL
DROP TABLE #Table;
CREATE TABLE #Table
(
RecordSeq INT PRIMARY KEY CLUSTERED
,Account ...
November 19, 2011 at 8:12 pm
i see that you have posted in SQL 2005 forum, but can you confirm that u are running this query in SQL 2005? From SQL 2008, BACKUP LOG WITH TRUNCATE_ONLY...
November 16, 2011 at 4:45 pm
A GROUP BY and HAVING COUNT(*) > 1 will give you what you want.
And this is a cross post: Please redirect ur replies to : http://www.sqlservercentral.com/Forums/Topic1205657-392-1.aspx
November 14, 2011 at 11:03 pm
A GROUP BY and HAVING COUNT(*) > 1 will give you what you want.
November 14, 2011 at 11:02 pm
How about this?
; with numberofdays(n) as
( select 0 union all select 1 union all
select 2 union all select 3 union all
select 4 union all select 5...
November 11, 2011 at 9:40 am
Cadavre (11/10/2011)
BEGIN TRAN
CREATE TABLE #TABLE1 (ID INT, GroupA VARCHAR(10), GroupB VARCHAR(10), GroupC VARCHAR(10))
INSERT INTO #TABLE1
SELECT 1, 'True', 'False', 'True'
UNION ALL SELECT 2, 'False', 'False', 'True'
UNION ALL SELECT...
November 10, 2011 at 10:27 am
First lets set up some sample data:
IF OBJECT_ID('TempDB..#TableA') IS NOT NULL
DROP TABLE #TableA;
CREATE TABLE #TableA
( ID INT
,GroupA BIT
,GroupB BIT
,GroupC BIT
);
INSERT INTO #TableA
...
November 10, 2011 at 10:24 am
Another way of doing it:
WITH SampleData (UserName, UserID, DateCreated) AS
(
SELECT 'Mary Poppins', 123456, '12-07-05 14:23:45'
UNION ALL SELECT 'Mary Poppins', 123456, '12-12-05 08:15:28' -- I want this one
UNION ALL...
November 9, 2011 at 10:30 am
With 582 points and 1500 visits you must have known that the sample data in form of INSERT statement will make the life easier for the answerers. I also see...
November 9, 2011 at 10:24 am
Viewing 15 posts - 571 through 585 (of 1,923 total)