Viewing 15 posts - 1,876 through 1,890 (of 2,458 total)
I'm thinking something like this...
WITH
scores(ID, creationdate, score, MCC) AS--SAMPLE DATA
(
SELECT 1, '2014-08-02', 30, 7422 UNION ALL
SELECT 2, '2014-08-03', 40, 7422 UNION ALL
SELECT 3, '2014-08-01', 100, 7500 UNION...
September 30, 2014 at 8:52 am
It looks like John beat me to it, if you can post a query plan that would be a great help - see: How to Post Performance Problems[/url]
September 30, 2014 at 8:36 am
I would second both recommendations and add that you can't go wrong with any Itzek ben-Gan book.
Learn what a tally table is; that has changed my career.
This site...
September 29, 2014 at 10:41 pm
... I was thinking, using the logic in my previous post you could create a dbo.SubstringBeforeSSI function (examples included in the code)...
ALTER FUNCTION dbo.SubstringBeforeSSI
(
@string varchar(1000),
@substring varchar(100),
@substring_index tinyint
)
/*
DECLARE @string varchar(1000)='10.0.1600.22',
@searchPattern varchar(100)='.',
@substring_index...
September 29, 2014 at 8:23 pm
This wont perform as well as what Eugene posted but is a solid, set-based way to solve this problem dynamically...
Using my Ngrams8k function:
ALTER FUNCTION [dbo].[nGrams8K]
(
@string VARCHAR(8000),
@n TINYINT,
@pad BIT=0
)
/*--
Created by:Alan Burstein
Created...
September 29, 2014 at 7:56 pm
Another Approach:
;with
CurrentResutSet(Period, Sense, mt, Total) AS
(
select '2014_S27', 'CPT', 1, 215 union all
select '2014_S27',...
September 29, 2014 at 3:59 pm
As Louis said, DDL and what you have tried will help us help you faster. That said, I think you are looking for this:
WITH
your_data AS
(SELECT *
FROM (values ('ClassA',10001,'Y','Eligible',1,1),
...
September 29, 2014 at 10:56 am
dagnea (9/16/2014)
Does this make...
September 16, 2014 at 12:11 pm
A couple variations (these will get you the same query plan as what rxm posted).
SELECT isnull(cast(id as varchar(12)),'Total'), sum(cnt)
FROM @rollup
GROUP BY id with rollup;
or...
-- since we're only...
September 16, 2014 at 7:02 am
Jeff Moden (9/12/2014)
fregatepllada (9/12/2014)
Dwain you do not need CLR to use regex 🙂There is an old way to call Vbscript library
From t-SQL code 😉
sp_OA???
I suspect they were talking about:...
September 12, 2014 at 4:55 pm
Sean Lange (9/11/2014)
Alan.B (9/10/2014)
months as(
select 1 as MoNo, 'January' as Mo union all
select 2 as MoNo, 'February' as Mo union all
select 3 as MoNo, 'March' as Mo union all
select...
September 11, 2014 at 8:46 am
months as
(
select 1 as MoNo, 'January' as Mo union all
select 2 as MoNo, 'February' as Mo union all
select 3 as MoNo, 'March' as Mo union all
select 4 as MoNo,...
September 10, 2014 at 7:00 pm
I love SSMS 2012 and have not had any of the issues you describe. I'd reinstall or repair ssms.
September 10, 2014 at 4:58 pm
SQL Guy 1 (9/10/2014)
We have transactional replication. We have a index rebuilding job on publisher, but subscriber is still highly fragmented.
Should we create defragmentation job on subscriber, or...
September 10, 2014 at 4:48 pm
Viewing 15 posts - 1,876 through 1,890 (of 2,458 total)