Forum Replies Created

Viewing 15 posts - 1,861 through 1,875 (of 8,416 total)

  • RE: Filter challenge

    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

  • RE: Filter challenge

    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...

  • RE: Recursive problem

    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...

  • RE: Filter challenge

    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?

  • RE: Filter challenge

    The Dixie Flatline (7/10/2011)


    Paul, I tried your code against the data from my example and no rows were returned. I think the proper WHERE clause...

  • RE: Revisited: RAID10 vs RAID1 SQL

    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 🙂

  • RE: Revisited: RAID10 vs RAID1 SQL

    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...

  • RE: Filter challenge

    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...

  • RE: Filter challenge

    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...

  • RE: Convert to bigint

    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,...

  • RE: In-CASE you need to SUM...

    Good question today, thank you.

  • RE: Are the posted questions getting worse?

    --- never mind ---

  • RE: Handle NULLs

    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....

  • RE: Handle NULLs

    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. ...

  • RE: Handle NULLs

    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

Viewing 15 posts - 1,861 through 1,875 (of 8,416 total)