Forum Replies Created

Viewing 15 posts - 226 through 240 (of 2,458 total)

  • RE: Concatenate rows into string

    DesNorton - Thursday, July 20, 2017 5:29 AM

    info 58414 - Thursday, July 20, 2017 4:00 AM
    "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: Year, Month and Days from date of birth table

    Building off of Luis' excellent solution...
    This:

    -- Sample data, solution
    DECLARE @samples TABLE (dob date);
    INSERT @samples VALUES
    ('20161102'),('20150326'),('20150717'),('20140818'),('20120712'),('20121201'),('20120522');

    -- Solution
    SELECT dob,

    "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: Year, Month and Days from date of birth table

    Note the line in my signature about the best way to get help. Pictures aren't the easiest because we can't copy/paste from an image. 

    That said, what you are...

    "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: Separate rows depend on Previous Row

    ikrami2000 - Friday, July 14, 2017 11:34 AM

    i need to get the data depend on Category (Food,beverage, hot drinks,....)
    but to be not...

    "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: Separate rows depend on Previous Row

    ikrami2000 - Friday, July 14, 2017 10:36 AM

    the below working find with three rows :
    DECLARE @test-2 TABLE (ID int, Name varchar(30), ...

    "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: Separate rows depend on Previous Row

    Phil beat me to it. We need more/better sample data and clearer expected results.  Something like this for the sample data:


    DECLARE @yourtable TABLE (id int,...

    "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: Get DDL for any SQL 2005 table

    I still love this proc Lowell (I'm using your newest version of sp_GetDDLa). I know I've posted that in this thread before. I thought I'd take a moment to include...

    "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: Help with query

    Jacob Wilkins - Wednesday, July 12, 2017 3:50 PM

    Here's another way (based on the original sample data with two table variables) that...

    "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: Unlimited PTO

    I've interviewed at a couple places that offer this and drilled them pretty extensively about it. It seems like a good deal - you're going to be able to take...

    "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: separating SSRS from Database server - SQL server 2016 standard

    bgz30 - Tuesday, July 11, 2017 2:08 PM

    when SSRS component is installed on a different server from Database server, will there be...

    "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: The Panjandrum Conundrum

    I just started playing around with SQL 2017 and was enthusiastic about TRANSLATE and STRING_AGG. STRING_AGG is long overdue and performs a wee-bit better than using the FOR XML PATH('') method and...

    "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: SQL Server Maintenance Plan - Unable to Edit

    You have a couple options, none of which are super simple. 

    OPTION 1 - Edit in BIDS or SSDT
    As already mentioned, you can open the maintenance plan with...

    "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: Change SSN in textbox

    Luis Cazares - Friday, July 7, 2017 1:55 PM

    Is there any problem if we follow the logic from the original function? Or...

    "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: Change SSN in textbox

    Eric's original solution did not address multiple instances of the same SSN-matching pattern but he fixed that. The only problem is when an SSN appears at the beginning or end...

    "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: Problem with using a field parameter, in a user defined function

    SqlServerCampbell - Thursday, July 6, 2017 10:28 AM

    ScottPletcher - Thursday, July 6, 2017 9:55 AM

    "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 - 226 through 240 (of 2,458 total)