Forum Replies Created

Viewing 15 posts - 346 through 360 (of 2,462 total)

  • RE: Are the posted questions getting worse?

    Jeff Moden (12/7/2016)


    This Saturday, 12/10, marks the anniversary of a very unhappy event for me...

    Ditto.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Are the posted questions getting worse?

    Doing some code cleanup today, running into lots of this

    insert into <someTable>

    select <a bunch of stuff>

    ...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Today's Random Word!

    Manic Star (12/8/2016)


    Luis Cazares (12/8/2016)


    Ed Wagner (12/8/2016)


    Revenant (12/8/2016)


    Kaye Cahs (12/8/2016)


    Manic Star (12/8/2016)


    crookj (12/8/2016)


    Brandie Tarvin (12/8/2016)


    Stuart Davies (12/8/2016)


    Ray K (12/7/2016)


    whereisSQL? (12/7/2016)


    Manic Star (12/7/2016)


    Ed Wagner (12/7/2016)


    djj (12/7/2016)


    Luis Cazares (12/7/2016)


    Ed Wagner (12/7/2016)


    DamianC (12/7/2016)


    Revenant...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: coalesce in a where clause

    You don't need coalesce here. NULL values are neither equal nor unequal when compared to other because NULL is unknown. Does a bag with an unknown number of apples have...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Is there a way to extract only credit card numbers from text

    I'm a little late here but actually started a solution on Friday that I just now had time to finish.

    First and foremost: unless someone has an example of how...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Today's Random Word!

    Luis Cazares (12/5/2016)


    crookj (12/5/2016)


    djj (12/5/2016)


    Lane

    Lois

    Lana

    Turner

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: CREATE FUNCTION with a WHILE LOOP

    patelxx (12/1/2016)


    I am learning and new to CREATE FUNCTIONS - how to I add a WHILE LOOP in a function:

    CREATE FUNCTION fn_list_the_number(@count INT)

    RETURNS TABLE

    AS

    RETURN

    (

    WHILE (@count <= 10)

    BEGIN

    PRINT CAST(@count AS...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Working days grouped by month

    Some DDL and easily consumable data would help circumvent any confusion but here's some sample code to get you started. Thom referred you to a calendar table article - that's...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Best and economical enterprise monitoring tool

    Ditto Grant's recommendation. I also like Idera's SQL Diagnostic Manager. It's been about 6 years since I last used it but, as a DBA I really liked it and the...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Split list of string into all possible combinations

    N_Muller (11/30/2016)


    Alan.B (11/29/2016)


    My solution can be totally optimized and simplified but here's a solution that uses DelimitedSplit8K (see the link in my signature):

    You'll notice three UNION ALL's. The first query...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Split list of string into all possible combinations

    My solution can be totally optimized and simplified but here's a solution that uses DelimitedSplit8K (see the link in my signature):

    -- your sample data

    declare @table table ( Col varchar(100) )

    insert...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Find last business day from table with date and day in SQL 2008 and 2012

    Using this sample data:

    CREATE TABLE #myTable (dt date UNIQUE NOT NULL);

    WITH E AS (SELECT v FROM (VALUES (1),(1),(1),(1),(1),(1)) t(v))

    INSERT #myTable

    SELECT CAST(DATEADD(DAY, ROW_NUMBER() OVER (ORDER BY (SELECT 1))-1, '20140101') AS...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: EzAdo Part 4

    Very interesting read - I was not aware of this tool. Cool stuff - well done!

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: how to retrieve numbers from a string

    Of that only works with the "numbers dash numbers dash letters" formatting.

    Plus it boring... My "just for the fun of it" solution answered (what I thought) was a more interesting...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: What is a good place to start an Analysis Services SSAS Education / Tutorials with AdventureWorks DB

    First - If you are using SSAS 2012 then look at this link: https://msdn.microsoft.com/en-us/library/ms170208(v=sql.110).aspx (what you posted was for SSAS 2016).

    Second, ignore the second link for now (the one...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

Viewing 15 posts - 346 through 360 (of 2,462 total)