Viewing 15 posts - 586 through 600 (of 2,462 total)
This is a job for a tally table[/url]!
Here's a crash course on how they work. Run this:
SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL))-1 FROM
(VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) a(x), -- 10
(VALUES...
-- Itzik Ben-Gan 2001
July 20, 2016 at 8:40 am
Another couple options:
1. You can use DigitsOnlyEE[/url]. This exactly the type of task it was designed for (note my comments):
-- How to use dbo.DigitsOnlyEE
SELECT DigitsOnly FROM dbo.DigitsOnlyEE('Recalc 2015659341589653');
SELECT DigitsOnly FROM...
-- Itzik Ben-Gan 2001
July 20, 2016 at 7:51 am
ALTER TABLE employees
ADD CONSTRAINT check_length
CHECK (LEN(fieldname) < 1)
Should be
ALTER TABLE employees
ADD CONSTRAINT check_length
CHECK (LEN(fieldname) = 1)
But this could be handled by using a nullable char(1) data type:
ALTER TABLE employees
ALTER...
-- Itzik Ben-Gan 2001
July 20, 2016 at 7:17 am
PB _BI touched on this...
I'm assuming you're attempting to use that expression in a text box properties/color setting... you can put a color or expression in there. if it...
-- Itzik Ben-Gan 2001
July 20, 2016 at 6:12 am
mjh 45389 (7/19/2016)
-- Itzik Ben-Gan 2001
July 19, 2016 at 12:09 pm
I have been working from home part of, or most of the time, since 2009. First as a DBA for remote clients and since 2011 as a BI Person. I...
-- Itzik Ben-Gan 2001
July 19, 2016 at 12:03 pm
Jeff Moden (7/13/2016)
Alan.B (2/25/2016)
The NTally Inline Table Valued FunctionN-I-I-I-I-C-E! Great documentation, too!
Thank you, thank you! I thought you might like that ;-).
-- Itzik Ben-Gan 2001
July 19, 2016 at 11:33 am
Solomon Rutzky (7/14/2016)
CELKO (7/14/2016)
Can you explain why you think this kind of programming and systems design would result in lower cost, easier maintenance or any other advantage?-1
+1
-- Itzik Ben-Gan 2001
July 14, 2016 at 11:58 am
[Quote]Jeff Moden (7/13/2016)
Alan.B (7/13/2016)
CELKO (7/13/2016)
-- Itzik Ben-Gan 2001
July 13, 2016 at 8:16 pm
Note that Jeff's second solution will sort the results in the order you demonstrated in your original post. The NTILE solution would not. If you need the numbers in that...
-- Itzik Ben-Gan 2001
July 13, 2016 at 10:55 am
Alternatively you can do it like this:
WITH
E(n) AS(
SELECT n FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(n)
),
E2(n) AS(
SELECT a.n FROM E a, E b
),
E4(n) AS(
...
-- Itzik Ben-Gan 2001
July 13, 2016 at 10:22 am
Start with: Querying Microsoft SQL Server 2012/2014.
Buy the exam book. Study it and practice the coding related to the subject matter one chapter at a time. Once you feel that...
-- Itzik Ben-Gan 2001
July 13, 2016 at 9:41 am
CELKO (7/13/2016)
-- Itzik Ben-Gan 2001
July 13, 2016 at 9:23 am
CELKO (7/12/2016)
-1 is a wonderful answer.
To what? Who are you trying to communicate with here?
Mixed systems (those with more than one language embedded in each other) are always in...
-- Itzik Ben-Gan 2001
July 12, 2016 at 8:31 pm
Solomon Rutzky (7/9/2016)
Alan.B (7/7/2016)
-- Itzik Ben-Gan 2001
July 12, 2016 at 8:09 pm
Viewing 15 posts - 586 through 600 (of 2,462 total)