Forum Replies Created

Viewing 15 posts - 5,236 through 5,250 (of 8,731 total)

  • RE: Query to select records only when all records in group meets the same criteria

    Here's another option.

    SELECT *

    FROM #Machine m

    JOIN #MachineBranch mb ON mb.MachineFk = m.MachinePk

    WHERE m.MachinePk IN ( SELECT im.MachinePk

    ...

    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 return top n and sum up the rest

    sonchoix (2/12/2015)


    dwain.c (2/11/2015)


    In the TOP 2 or 3 or 4 you are listing (outside of the Others group), what do you want to do if there are ties?

    This looks 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: How do I capture the start time of a package and how long in munutes it took to complete?

    I haven't tried it, but you might be able to use Event Handlers to insert into "log" tables.

    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: Will order of fields create any performance issues?

    below86 (2/11/2015)


    Some day, when I get some freee time, Ha Ha, I will run some additional test on our servers.

    Let me save you some time. 😉

    As you'll see, both...

    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: Convert Varchar to Float

    I don't believe you. You're doing something else as my code should work without problems.

    SELECT CASE WHEN [TBL_whole_rock_geochem].au = 0

    ...

    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 this scenario

    SELECT statements don't fire triggers.

    You can use insert and update triggers to avoid empty values but that would only complicate validations.

    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: NULL(DT_I4) usage in a Derived Column

    It's a shame that this functionality got implemented until 2012 using REPLACENULL().

    https://msdn.microsoft.com/en-us/library/hh479601(v=sql.110).aspx

    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: Convert Varchar to Float

    The problem is that SQL server is trying to convert from varchar to float/int and you need to do it the other way (float to varchar).

    Use this example:

    SELECT CASE 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: Help!!!

    Those seem like interview questions and people here don't like to answer to them because it helps others to cheat in interviews. A good interviewer will know the difference between...

    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 this scenario

    If you want to replace NULLs or empty strings with the string 'NODATA', one option would be to create views that use ISNULL() for nulls and NULLIF() for empty strings...

    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: Will order of fields create any performance issues?

    below86 (2/10/2015)


    Well, OK then, I'm not sure why I thought it made a difference.

    I know when listing the fields in your joins in the same way the index...

    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 return top n and sum up the rest

    You're welcome.

    It would be nice if you could share with us the reasons behind the restrictions.

    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 return top n and sum up the rest

    Why can't you use CTE/temp tables/variables? That's nonsense, next they're going to tell you that you can't use update or select.:hehe:

    The solution should be more like this:

    SELECT CASE WHEN rn...

    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: Worldwide mailing address - verification and management

    dwain.c (2/9/2015)


    Many countries don't call them states, they call them provinces.

    And France is divided in regions, departments, arrondisements, cantons, communes and, in some cases, municipal arrondissements.

    I'm sure that other countries...

    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 join the tables to get only record with specific field value in a table

    amar_kaur16 (2/9/2015)


    Thank you for the response.

    The only problem is there can or cannot be a record for an applicant in the review table and I want to get all...

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