Forum Replies Created

Viewing 15 posts - 856 through 870 (of 8,731 total)

  • RE: Listing records based on condition

    Maybe something like this:

    WITH CTE AS(
      SELECT *,
       MIN(CASE WHEN TestResult = N'Fail' THEN CycleID END) OVER(PARTITION BY MemberID) FirstFail
      FROM...

    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: Find and replace ASCII Character

    yogi123 - Monday, November 6, 2017 10:56 AM

    Hello,

    I have to build something that will find ASCII character and replace them with blank...

    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 with basic stored proc, two part name giving me grief.

    Not a big fan of this procedure. But if you're going to use it, try keeping it safe and robust.

    CREATE PROCEDURE sp_Truncate_Anything
    (
      @DBName nvarchar(130)...

    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 - Friday, November 3, 2017 10:22 AM

    Nice.  Please tell me you fixed the implicit cast against the datetime column...

    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: Need a .net like function in user defined function of sql server

    Just adding more details as you got answers. You can't create a function that will work for everything, unless you do additional work that is not really recommended. You should...

    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 - Wednesday, November 1, 2017 1:18 PM

    jasona.work - Wednesday, November 1, 2017 1:01 PM

    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: Syntax Issues

    MarkW.Rhythm1 - Wednesday, November 1, 2017 12:09 PM

    OMGee!!

    Luis & Lynn,
    I cannot thank the both of you enough!!!
    I came here for help 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: Syntax Issues

    MarkW.Rhythm1 - Wednesday, November 1, 2017 11:43 AM

    Greetings SQL Guru's... 1st post
    I'm an Excel VBA programmer and very new to SQL...
    I'm working...

    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: Msg 102, Niveau 15, État 1, Ligne 2 Syntaxe incorrecte vers 'order'.

    That syntax is only allowed starting on SQL Server 2012. You seem to be working on 2008, so that would be a problem.
    Try using ROW_NUMBER() instead of COUNT(). In...

    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: Need help in improving performance of a stored proc which invokes multiple scalar functions on the resultset

    This gives the result you expect with the parameters shown. However, I suggest that you do a more extensive testing as I might have missed something.

    CREATE...

    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: Sum case nulls and 1900-01-01 00:00:00.000

    Why not use NULLIF with a COUNT?

    DECLARE @ClosedStuff TABLE (InspectionClosed DATE NULL);
    INSERT INTO @ClosedStuff
    VALUES (NULL),(NULL),('19000101'),(GETDATE())

    SELECT COUNT(NULLIF( InspectionClosed, '19000101')) FROM @ClosedStuff

    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: Substring Question

    Jeff Moden - Monday, October 30, 2017 8:52 AM

    Luis Cazares - Monday, October 30, 2017 8:35 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: Which is the end?

    Jeff Moden - Saturday, October 28, 2017 2:10 PM

    I still think it hilarious (I laughed almost hysterically when I first heard 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: Substring Question

    Have you compared the performance of the given solution with simply appending the searched character at the end of the string?

    Select name, Substring(name,0, Charindex('.',name +'.')) 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: StartDate and EndDate in same column

    Since there's no way to give a proper answer without further information, I'll just leave this article here that explains this kind of problem.
    https://www.red-gate.com/simple-talk/sql/t-sql-programming/the-sql-of-gaps-and-islands-in-sequences/

    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 - 856 through 870 (of 8,731 total)