Forum Replies Created

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

  • 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

  • RE: how to retrieve numbers from a string

    Assuming Jason's interpretation of the OP's requirement is correct and the requirement was to have all the numbers in a single column separated by spaces (which looks correct but who...

    "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: Online T-SQL Scripts and Copyright

    manie (11/25/2016)


    I just realised that I posted a comment as if the is a new article and then realised it was posted in 2009. Still a very good article!!! :cool::cool::cool::cool::cool::cool:

    Its...

    "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?

    I just deleted a table named dbo.deleteme from our Dev box. This upset some people. Nothing surprises me anymore.

    "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: will it call subquery for every row of table with distinct in subqyery.

    rajemessage 14195 (11/22/2016)


    this one has alias, so that u can find which col belongs to which table.

    1) select * from abc where abc.abcid =(select top 1 xyz.abcid from xyz...

    "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,458 total)