Viewing 15 posts - 1,861 through 1,875 (of 8,416 total)
Flexdog (7/11/2011)
Using Paul's temp table, here is an alternate qry using divide & conquer (90's oldies).
Looks fine to me also. Very similar to the EXISTS version posted at http://www.sqlservercentral.com/Forums/FindPost1139404.aspx
July 11, 2011 at 11:00 am
The Dixie Flatline (7/10/2011)
Yes, it does.
Awesome. All we need now is Jeff Moden to build us a million-row test table to see whether all the effort to get a...
July 10, 2011 at 2:18 pm
In T-SQL, making use of an in-line table-valued function:
IFOBJECT_ID(N'dbo.MetricConversion', N'IF')
IS NULL
EXECUTE ('CREATE FUNCTION dbo.MetricConversion() RETURNS TABLE AS RETURN SELECT 1 AS x');
ALTER FUNCTION dbo.MetricConversion
(
@valueDOUBLE PRECISION,
@from_unitCHARACTER VARYING(2),
@to_unitCHARACTER VARYING(2)
)
RETURNS TABLE
WITH SCHEMABINDING AS
RETURN
WITH...
July 10, 2011 at 2:16 pm
Hi Bob,
While you were checking that, I changed the code a bit to make more sense (to me). Does my edited version work correctly with your data?
July 10, 2011 at 1:19 pm
The Dixie Flatline (7/10/2011)
July 10, 2011 at 12:22 pm
Perry Whittle (7/10/2011)
surely you mean 1TB tempdb, 1TB log and 1TB data.
Yes I meant 1TB, and don't call me Shirley 🙂
July 10, 2011 at 6:32 am
You're a bit limited with 6 large disks: the RAID 1 configuration would result in 1TB tempdb, 1TB log, and 1TB data (and presumably, OS files). The RAID 10...
July 9, 2011 at 11:45 pm
With a single scan of the source table:
SELECT
y.MyNo,
y.GroupID,
y.Code,
y.MyType
FROM
(
SELECT
*,
distinct_types =
MAX(x.type_rank) OVER (
PARTITION BY x.GroupID),
has_2_items =
COUNT(CASE WHEN x.rn = 2 THEN 1 END) OVER (
PARTITION BY x.GroupID)
FROM
(
SELECT...
July 9, 2011 at 11:23 pm
Also:
CREATE TABLE #MyCodes
(
MyNoINTEGER NOT NULL,
GroupIDVARCHAR(100) NOT NULL,
CodeVARCHAR(6) NOT NULL,
MyTypeVARCHAR(15) NOT NULL,
PRIMARY KEY (GroupID, MyType, MyNo)
);
INSERT INTO #MyCodes VALUES (1, 3, 10, 'Red')
INSERT INTO #MyCodes VALUES (2, 3, 11, 'Red')
INSERT INTO...
July 9, 2011 at 11:05 pm
opc.three (4/20/2011)
Slick :smooooth:Now that you point it out I remember reading an Itzik article talking about the new feature in 2008. Here is the article: http://www.sqlmag.com/article/tsql3/sql-server-2008-s-t-sql-features/2
Not only is it slick,...
July 9, 2011 at 11:52 am
mister.magoo (7/8/2011)
My latest submission is based on the string manipulation, but simplified... on my QUAD core PC I like the results, but let's see how it does on yours.
Very creative....
July 8, 2011 at 6:08 pm
Jeff Moden (7/8/2011)
Heh... I also try to avoid words like "always" and "never". 😀
Amen to that. I keep a thesaurus handy for synonyms of 'generally', 'usually'...and so on. ...
July 8, 2011 at 1:36 pm
tfifield (7/8/2011)
Is there a link to Paul's CROSS APPLY method for UNPIVOT? I'd love to see it.
Let me link to someone else's blog for a change...http://bradsruminations.blogspot.com/2010/02/spotlight-on-unpivot-part-1.html
July 8, 2011 at 1:33 pm
Viewing 15 posts - 1,861 through 1,875 (of 8,416 total)