Forum Replies Created

Viewing 15 posts - 2,041 through 2,055 (of 8,731 total)

  • RE: How to find repetitive strings in a column and then remove the second string

    Here's an option, but it's not perfect as it won't get the first row because it's not completely duplicated.

    WITH

    E(n) AS(

    SELECT n FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(n)

    ),

    E2(n) AS(

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Split String On Delimiter

    Alan.B (10/14/2016)


    Luis Cazares (10/14/2016)


    Here's a simple option using the DelimitedSplit8k that can be found here along with its explanation: http://www.sqlservercentral.com/articles/Tally+Table/72993/

    A specific function could be made to split only on the...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Split String On Delimiter

    Here are 2 modified versions of the DelimitedSplit8k function. The second one will only work on 2012 and more recent versions.

    CREATE FUNCTION [dbo].[DelimitedSplit8KNOccurrence](@pString [varchar](8000), @pDelimiter [char](1), @pOccurrence int)

    RETURNS TABLE WITH...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    jasona.work (10/14/2016)


    Sean Lange (10/14/2016)


    Lynn Pettis (10/13/2016)


    Wow, what an answer to a 2 year old thread. No idea where they came up with that idea.

    Amazing!!! That "answer" is as vague...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Split String On Delimiter

    Here's a simple option using the DelimitedSplit8k that can be found here along with its explanation: http://www.sqlservercentral.com/articles/Tally+Table/72993/

    A specific function could be made to split only on the 7th delimiter and...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: trying to insert data from one table to multiple tables row by row with derived columns. Somehow it's end up with infinite loop. and also throwing the message of

    I know why do you get an infinite loop. I won't post the solution, because you would keep the loop and ignore Sean's advice.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Using SP in UDF

    Alaster07 (10/13/2016)


    @Sergiy

    I tried your approach, and it kind of mostly works. The issue I am running into is that the "early" times will all be at the front of...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    Grant Fritchey (10/13/2016)


    Sean Lange (10/13/2016)


    WOW...http://www.sql-datatools.com/2016/05/sql-queries-tuning-and-optimization.html

    This is supposed to be a list of things to do to optimize queries. While some of these are valid most of them lack context or...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    Changing subject here.

    Has anyone else had problems with the site being slow or fully unavailable since last night (American time)?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    Ed Wagner (10/13/2016)


    jasona.work (10/13/2016)


    David Burrows (10/13/2016)


    djj (10/13/2016)


    Let me get my walker....

    20 years ago I had been working for 20 years.

    Ditto 😀

    p.s. I starting programming circa 1973 :w00t:

    Geez, '73 I think...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How to get the table name from a objectID?

    I really hope the OP didn't depend on the last replies. Not because they're bad, but because it's been over 3 years now.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Help: Truncate tables with same prefix

    mr_xtant (10/12/2016)


    I am verifying the space used by using Management Studio, right clicking on the table object in question, choosing properties, and looking at storage. So far, nothing has worked,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Using SP in UDF

    Here's an alternative that should be faster than using a scalar function. It includes an example on how to use it.

    CREATE VIEW vNEWID

    AS

    SELECT NEWID() AS _NewID;

    GO

    CREATE FUNCTION GenerateRandomDateTime

    (

    @MinimumDate DATETIME,

    @MaximumDayDifference INT,

    @MaximumSecondsFromMidnight...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: TSQL Assistance

    mareynolds (10/12/2016)


    Good afternoon. I need some assistance getting pointed in the right direction. My ultimate goal is to produce rows where there is not a matching courseinfo.coursestatecode in the responsibility.subjectcode...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    Sean Lange (10/12/2016)


    Grant Fritchey (10/12/2016)


    jasona.work (10/12/2016)


    Now this sounds like it has an interesting story behind it...

    Grant Fritchey (10/12/2016)


    I'm the guy who helped a developer send porn to our client list...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 2,041 through 2,055 (of 8,731 total)