Forum Replies Created

Viewing 15 posts - 991 through 1,005 (of 8,731 total)

  • RE: Replace the first charatcer in a String

    crazy_new - Wednesday, September 13, 2017 2:45 AM

    You can also use replace as below:

    UPDATE #Test
    SET Dsc = REPLACE(dsc,SUBSTRING(dsc,1,1),'27')
    WHERE ...

    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: Running total with reset condition

    What happens if the sum is not  exactly 30? Would you need to divide it? or should you move the whole row to a new page?

    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 need converting date field

    I must remind you that all days should be properly stored using the date data types. Format should be used for display only (or maybe some calculation hacks).

    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: Performance - View vs. SP

    tinausa - Thursday, September 7, 2017 1:24 PM

    I have inherited a DB where a specific report is created using a view, which...

    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: Replace the first charatcer in a String

    anand08sharma - Thursday, September 7, 2017 10:38 AM

    hoseam - Thursday, September 7, 2017 7:22 AM

    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: Replace the first charatcer in a String

    hoseam - Thursday, September 7, 2017 7:22 AM

    I want to replace all the values in a Column that starts with 0 to...

    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?

    Congratulations Brandie!
    Just take care as it seems that the weather won't be great for Florida these following dates.

    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?

    Steve Jones - SSC Editor - Wednesday, September 6, 2017 12:38 PM

    Amber ale here, so feel free to sort one for me...

    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?

    Thom A - Wednesday, September 6, 2017 9:24 AM

    Chris Harshman - Wednesday, September 6, 2017 9:18 AM

    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: remove spaces in strings

    Try this code (adapt it to your table) to find out what the problematic character is.

    WITH
    E(n) AS(
      SELECT n FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(n)
    ),
    E2(n)...

    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: Update data with same values

    sgmunson - Tuesday, September 5, 2017 10:58 AM

    Chuck S - Tuesday, September 5, 2017 10:50 AM

    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?

    It's good to know that I'm not alone in my despise for IPAs. I don't understand how they became so popular and some bars here will offer them as 80%...

    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: Why Derived Table and CTE Over T-SQL ?

    There's one more alternative:

    SELECT per.FirstName,
        per.LastName,
        emp.JobTitle,
        emp.HireDate,
        COUNT(*) OVER(PARTITION BY emp.JobTitle) Totalemployeeinthatjobtitle
    FROM Person.person per
    INNER...

    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: First / last item of a string in a nvarchar field

    Similar to Jason's solution. The CTE is only to create sample data.

    WITH SampleData AS(
      SELECT 'New York' + char(9) +'Washington' + char(9) +'Los Angeles' +...

    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: Finding Consecutive Values For a Record

    drew.allen - Wednesday, August 30, 2017 12:16 PM

    Here is another solution.

    SELECT ID,
    (PATINDEX('%1%',(
        SELECT
            CAST([2017_07] AS BIT)
        ,    CAST([2017_06] AS BIT)
        ,    CAST([2017_05] AS BIT)
        ,    CAST([2017_04] AS BIT)
        ,    CAST([2017_03]...

    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 - 991 through 1,005 (of 8,731 total)