Viewing 15 posts - 1,246 through 1,260 (of 2,462 total)
Luis beat me too it, I came up with the same crosstab solution that he did (his 1st query). I wanted to add that, as long as there are no...
-- Itzik Ben-Gan 2001
September 24, 2015 at 9:37 am
martyres (9/24/2015)
-- Itzik Ben-Gan 2001
September 24, 2015 at 7:18 am
I have personally found CHOOSE to be completely worthless. I have never seen an article or example of where CHOOSE was better than the alternatives. It's slow. I just don't...
-- Itzik Ben-Gan 2001
September 23, 2015 at 10:12 pm
Ed Wagner (9/23/2015)
Alvin Ramard (9/23/2015)
Luis Cazares (9/23/2015)
Manic Star (9/23/2015)
patricklambin (9/23/2015)
Stewart "Arturius" Campbell (9/22/2015)
Interesting question, thanks SteveAnother of the functions copied from Excel.
I don't think so. These functions have been introduced...
-- Itzik Ben-Gan 2001
September 23, 2015 at 9:34 pm
Manic Star (9/23/2015)
patricklambin (9/23/2015)
Stewart "Arturius" Campbell (9/22/2015)
Interesting question, thanks SteveAnother of the functions copied from Excel.
I don't think so. These functions have been introduced only to make easier the translation...
-- Itzik Ben-Gan 2001
September 23, 2015 at 9:17 pm
This can certainly be performance tuned but will work:
-- easily consumable sample data
DECLARE @table TABLE(ID int, value decimal (3,1))
INSERT @table
SELECT 1111,14.0 UNION ALL
SELECT 1111,14.0 UNION ALL
SELECT 2222,13.0 UNION ALL
SELECT 2222,13.0...
-- Itzik Ben-Gan 2001
September 23, 2015 at 9:06 pm
Was this your intended 2012 solution:
-- SQL SERVER 2012 version:
SET STATISTICS IO ON;
SELECT
RowID,
CODE,
COLUMN1,
COLUMN2,
RunningTotal =
...
-- Itzik Ben-Gan 2001
September 23, 2015 at 4:23 pm
kdejan87 (9/23/2015)
DECLARE @t1 TABLE (
CODE nvarchar(20),
COLUMN1 numeric(18, 2),
COLUMN2 numeric(18, 2)
)
INSERT INTO @t1 (CODE, COLUMN1, COLUMN2)
VALUES ('432',...
-- Itzik Ben-Gan 2001
September 23, 2015 at 4:03 pm
Sean Lange (9/21/2015)
WayneS (9/21/2015)
Alan.B (9/21/2015)
-- Itzik Ben-Gan 2001
September 21, 2015 at 5:45 pm
The homework assignment may dictate that the problem be solved with a cursor. Anyone who is good with cursors want to take a look at this?
-- Itzik Ben-Gan 2001
September 21, 2015 at 9:50 am
ITU_dk2012 (9/20/2015)
Thank you for the code example. I am just learning T-SQL and don't know the advanced stuff in T-SQL. I am using Cursors to get the first value, the...
-- Itzik Ben-Gan 2001
September 21, 2015 at 9:48 am
The Data warehouse toolkit that Louis mentioned is awesome - that has been the best book I have read about the whole data warehouse/BI life cycle. It's a shame that...
-- Itzik Ben-Gan 2001
September 20, 2015 at 3:10 pm
kiril.lazarov.77 (9/18/2015)
Thank you very much Alan.
No problem.
-- Itzik Ben-Gan 2001
September 18, 2015 at 11:10 pm
Koen Verbeeck (9/11/2015)
Alan.B (9/10/2015)
Kimball's The Microsoft Data Warehouse Toolkit, 2nd Edition[/url] is essential for any new BI developer. That's my BI bible.
Did you read Star Schema The Complete Reference...
-- Itzik Ben-Gan 2001
September 18, 2015 at 8:40 am
Just ran across this script - it works quite nicely for me.
-- Itzik Ben-Gan 2001
September 17, 2015 at 9:46 pm
Viewing 15 posts - 1,246 through 1,260 (of 2,462 total)