Forum Replies Created

Viewing 15 posts - 4,156 through 4,170 (of 8,731 total)

  • RE: How to get rid of NULL in my results from case when

    I believe that the leading zero is correct and missing the zero is incorrect. That coming from the article shared by Jason.

    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: Hekp required on Where clauses

    Please post DDL and sample data to be able to test different possibilities. Be sure to post the expected results based on that sample data.

    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?

    WayneS (9/21/2015)


    Alan.B (9/21/2015)


    The homework assignment may dictate that the problem be solved with a cursor. Anyone who is good with cursors want to take a look at this?

    Anyone good...

    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 find the first, last and the Highest (Peak Value) in a list

    Why did you open this other thread for the same problem?

    http://www.sqlservercentral.com/Forums/Topic1721196-391-1.aspx

    It only divides the answers and multiplies the efforts of people helping in here.

    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 T-SQL Cursors to find first, highest and last values

    You overcomplicate things, Ben. It can all be done in a single query.

    This won't solve the whole problem, but it can show how it could be done.

    --

    -- Create a table.

    --

    select...

    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: Dynamic SQL Question

    WayneS (9/21/2015)


    Kristen-173977 (9/20/2015)


    GilaMonster (9/19/2015)


    protecting against SQL Injection is done, in most cases, by ensuring that it is parameterised, except for the rare scenario where the user input can be...

    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: Search through rows with specific values

    That's easier, just remove the GROUP BY (and HAVING) clause as that's only needed if you want to exclude the job numbers that have both operation codes.

    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: Cursor Clarification

    You could change your function to an iTVF (inline table valued function) which should be faster.

    Something like this:

    --Added an i as prefix to prevent code malfunctions where the original function...

    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: Search through rows with specific values

    Here's a simpler option to Scott's query that can be easily converted to the second report.

    SELECT

    J.DT_ID

    ,J.OperationCode

    ,J.EmployeeCode

    ,J.JobNumber

    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: How to get rid of NULL in my results from case when

    You might expect that '090471' is equal to '90471' because they have the same numeric value. However, they're different strings.

    Here's a code that removes leading zeros to solve this problem....

    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?

    Alvin Ramard (9/18/2015)


    Jack Corbett (9/18/2015)


    Okay, I'm going to give the instructor the benefit of the doubt. Maybe lesson 1 is cursor and lesson 2 is set-based 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: Help creating stored procedure with cursor loop

    I completely understand, that's why I mention that it only complies with part of the requirements. However, I wanted to show a better option that will actually help in 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: Control of Flow - where is CASE ?

    Because T-SQL doesn't like to have flow control.

    Don't forget to remove THEN, this isn't VB. 😛

    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?

    Why do they keep teaching this kind of stuff? http://www.sqlservercentral.com/Forums/Topic1720978-169-1.aspx

    Then people wonder why there's crappy code everywhere.

    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 creating stored procedure with cursor loop

    hyper50 (9/18/2015)


    4.You must use a cursor to loop through the GRADE_CONVERSION table to find the letter grade

    WHAAAAAAT????? :w00t:

    That's actually the best way to return the values by using a cursor....

    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 - 4,156 through 4,170 (of 8,731 total)