Viewing 15 posts - 2,566 through 2,580 (of 10,144 total)
How about sequencing the new column [GroupBy] using ROW_NUMBER()?
March 18, 2015 at 7:50 am
You can probably figure it out from this:
SELECT *, [GroupBy] = TestDate - rn
FROM (
SELECT *, [rn] = ROW_NUMBER() OVER(PARTITION BY TestId ORDER BY TestDate)
FROM tblDatesSequenceTest
) d
March 18, 2015 at 7:32 am
appdev13 (3/18/2015)
March 18, 2015 at 7:24 am
rexyrexin (3/18/2015)
select * from mytable
where class='something'
AND ISNULL(xyz,0) = CASE WHEN @abc = 1 THEN 1 ELSE ISNULL(xyz,0) END
Here @abc is the stored procedure parameter .
Thanks all for...
March 18, 2015 at 7:09 am
GilaMonster (3/18/2015)
Luis Cazares (3/17/2015)
Can someone help with a crystal ball or interrogation system for this thread?http://www.sqlservercentral.com/Forums/Topic1668185-391-1.aspx
Sorry, mine's broken, it's only showing clouds.
You're holding it upside down:-P
March 18, 2015 at 3:24 am
chris.rogers00 (3/16/2015)
DECLARE @date DATE,
@string VARCHAR(5)= 'test'
BEGIN TRAN
PRINT XACT_STATE()
BEGIN TRY
-- see if the data I've been given can be cast...
March 17, 2015 at 8:08 am
Then try SUBSTRING(string, startpos, 8000) or calculate the correct length for the third parameter.
March 17, 2015 at 7:43 am
sqlquery29 (3/17/2015)
We have like after 40 characters the unit of measure is place in the description field. We have more than one space between the description and unit of...
March 17, 2015 at 6:42 am
WolfgangE (3/16/2015)
thank you for the answer.
I know I could optimize the index, but that's not the point. I'd like to understand why optimizer is estimating the way it does...
March 16, 2015 at 10:55 am
Try these indexes:
CREATE INDEX ix_MasterId_Etc ON DetailTable (MasterId, CreateDate) INCLUDE (DetailId)
CREATE INDEX ix_MasterId_Etc ON MasterTable (Name, MasterId)
These are a first guess based on the join columns, filters and output...
March 16, 2015 at 10:05 am
APPLY has been a part of TSQL since 2005. Read more here:
http://www.sqlservercentral.com/articles/APPLY/69953/%5B/url%5D
March 13, 2015 at 10:13 am
-- Check
WITH SequencedData AS (
SELECT *, rn = ROW_NUMBER() OVER(PARTITION BY emp ORDER BY rdate DESC)
FROM #sample
)
SELECT *
FROM SequencedData s
CROSS APPLY (SELECT TOP 1 * FROM #sample si...
March 13, 2015 at 9:37 am
measterbro (3/13/2015)
SET @DynamicPivotQuery = @part1 + @part2 +...
March 13, 2015 at 7:54 am
measterbro (3/12/2015)
March 13, 2015 at 7:46 am
measterbro (3/13/2015)
Msg 207, Level 16, State 1, Line 15
Invalid column name 'LeagueName'.
Msg 207, Level 16, State 1, Line 16
Invalid column name 'ShortName'.
Msg 207, Level 16,...
March 13, 2015 at 7:43 am
Viewing 15 posts - 2,566 through 2,580 (of 10,144 total)