Forum Replies Created

Viewing 15 posts - 5,416 through 5,430 (of 8,731 total)

  • RE: Multiple Conditions on a Case Statement

    You just need a single CASE.

    SELECT CASE

    WHEN PT.datatype = 7 AND MVA.DateTimeValue IS NOT NULL

    ...

    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: Query that generates values by date range

    This should work for 2008.

    WITH cteRows AS(

    SELECT fmc_terminal,

    fmc_date,

    fmc_prodlnk,...

    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: Kindly resolve some error in the below function

    mahi123 (12/12/2014)


    Thanks for your reply,

    i have been created procedure but i want data in select statements, because in front end code we have to pass optinal perameters something, s that...

    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?

    Have you ever feel that posters are just trolling you by saying that a solution doesn't work even when you have tested it correctly? I feel that Lynn is a...

    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: Export to Text, CSV, or Excel through web app

    Have you tried using SSRS?

    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 Execution Plan after query was run?

    John Mitchell-245523 (12/11/2014)


    You need to copy and paste the plan into a text file and save it with a .sqlplan extension. You can then open it in graphical form...

    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: Wrapping CASE in MAX() - Performance hit?

    Are you aware of this possible combination of values?

    WITH SomeTable AS(

    SELECT CAST( '20141209' AS DATE) AS date,

    ...

    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: Pivoting hierarchial data

    This isn't pretty, but it might be what you need to handle one to many relationships between managers and employees.

    SELECT CEO.Emplid AS CEO,

    SrVP.Emplid AS SrVP,

    ...

    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: Execution Plan TEST vs LIVE

    Could you post both execution plans to have a better idea on what you're talking about?

    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: Conversion of Date from legacy systems with 7 and 6 digit format to DD/MM/YYYY format

    Should I insist on this method? I just added a NULLIF function and it works.

    SELECT CAST( CAST( 19000000 + NULLIF(oldDate, 0) AS CHAR(8)) AS date)

    FROM( VALUES('0980412'),('1100323'), ('0'))x(oldDate)

    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 a record with a validation from other table

    It hurts to love someone and not to be loved in return, but it hurts even more to have an UPDATE without a WHERE.

    Try this example:

    CREATE TABLE CustomerCredit(

    ...

    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: Quick question regarding CASE WHEN statement

    You just need to change the order in your conditions.

    SELECT CASE

    WHEN C.Insuranceid = 'MCD' THEN 'Medicaid'

    WHEN...

    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: evidently confused on temp table scope

    Trying to go back to the original problem, I think the SP that is supposed to fill your temp table has some sort of problem. Either the data is not...

    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: Removing a cursor

    Your main problem is the stored procedure. Unless you change the code from the procedure, you'll end up with RBAR anyway.

    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: Joining of small & larger tables and query optimization

    Unless you force the order (which you shouldn't in most cases), it really doesn't matter which table you use first in your query. SQL Server will decide the best option...

    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 - 5,416 through 5,430 (of 8,731 total)