Forum Replies Created

Viewing 15 posts - 8,671 through 8,685 (of 8,731 total)

  • RE: practical application of REVERSE function?

    ColdCoffee (7/30/2012)


    sestell1 (7/30/2012)


    LEN(Reverse(<string>) is a quick and dirty way to find the length of a string INCLUDING trailing whitespace.

    Instead, you can use DATALENGTH function to get the length, inlcuding white...

    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: practical application of REVERSE function?

    Thanks Sean, but I was joking with this because I'm not sure palindromes count as a "practical application".

    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: practical application of REVERSE function?

    You can use it to check if 2 phrases are palindromes.

    Just kidding.

    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: Look up duplicates

    It's important to give all the information possible in the first post, otherwise the solutions might not be completely accurate.

    Here are 2 solutions with DDL and sample data (something 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: Look up duplicates

    How would you define "the first ocurrence"?

    I'm not sure if this is the best place to search for that answer, as the best solutions would be oriented on MS SQL...

    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: Look up duplicates

    Thanks Jared, I think I couldn't have explained that well.

    Of course, I know what I'm doing but I have problems to explain when I see some things that might look...

    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: Look up duplicates

    This could be easier to translate (if even needed)

    DECLARE @tTabletable(

    IDint,

    namevarchar( 20));

    INSERT INTO @tTable

    SELECT 1275, 'Customer A' UNION ALL

    SELECT 3472, 'Customer A' UNION ALL

    SELECT 2812, 'Customer A' UNION ALL

    SELECT 1245, 'Customer...

    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 use case and in clause together

    Was this a homework assignment?

    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 issue with LIKE operator

    Do you really need the first '%'?

    That prevents you from using an index (As far as I know).

    If you could drop it, the query would speed up.

    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: Create a dataset based on the result of another dataset?

    Yes, it's possible.

    Look for "subqueries" or "Common Table Expressions (CTE)"

    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: Reg: Query

    You could simply drop the conditions and the union.

    SELECT EID,

    [Status],

    MAX(EDate) AS EDate

    FROM TheTable

    WHERE [Status]='cp'

    GROUP BY EID,[Status]

    ORDER BY EID,[Status]

    It 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: query help - repeating date

    SQL_NuB (7/25/2012)


    Its returning me 0 for my counts

    You should post DDL and sample data, so we can compare results.

    Added: Also post the query that returned 0 for the counts.

    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 help - repeating date

    I'm curious Lynn,

    You presented the first solution just because it would be a correction of the original query?

    Because it seems to me that it would give terrible performance compared...

    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: "Value is not a boolean" error for filter based on a boolean ... what value should I use for True?

    That's the problem we face when SQL Server does not use the same datatypes for all of its tools.

    the value you're looking for should be: true (with no quote marks).

    I'm...

    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: error when using while in select script

    xmozart.ryan (7/25/2012)


    thx for share it,, but i'm really sorry coz i cannot understand what is it ??

    :crazy:

    *once again i'm really newbie on SS..

    Try printing the code stored in @DynamicSelect 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

Viewing 15 posts - 8,671 through 8,685 (of 8,731 total)