Forum Replies Created

Viewing 15 posts - 7,606 through 7,620 (of 8,731 total)

  • RE: SPLIT a single column value by comma

    I'm glad that I could be of help. It's weird to be called Sir Luis, makes me feel like someone important. 😀

    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: SPLIT a single column value by comma

    Not exactly what you might be looking for, but instead of trying to add commas after each character, you can use a subquery in the IN clause. Something like this:

    WITH...

    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: SELECT Statement against view takes 3 seconds on one machine and 1:10 on others

    Save it as .sqlplan (right click to save) and below the post editor, there's an attachments 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
  • RE: How do delete multiple CHAR(9) at end of string

    Could you post some sample data in consumable format(Insert statements or a CTE)? That would help us to know what would be 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
  • RE: How do delete multiple CHAR(9) at end of string

    Do you only have those characters at the end of your string? you could simply use REPLACE or if you just want to eliminate the last ones, there's a more...

    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: t-sql 2008 r2 performance

    I don't believe that there's a performance difference. However, I'm not sure why would anyone use so many gotos, seems like spaghetti code for me.

    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: Adding Zero

    dwain.c (10/9/2013)


    Luis Cazares (10/9/2013)


    You need a Units table or at least a Units set to look for all units. after that the rest is easy, just add a RIGHT JOIN.

    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: Why are virtual tables in a FROM clause unable to reference aliases from the outer query?

    jshahan (10/9/2013)


    Thanks for the responses and they both tell me “what”. I am after the “why”.

    Let me quote myself.

    because JOINs don't support correlated subqueries.

    And to quote Nevyn

    And second, you...

    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: Why are virtual tables in a FROM clause unable to reference aliases from the outer query?

    That's because JOINs don't support correlated subqueries. Change the INNER JOIN for a CROSS APPLY. 😉

    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: Adding Zero

    You need a Units table or at least a Units set to look for all units. after that the rest is easy, just add a RIGHT JOIN.

    SELECT

    count(fr.[Unit]) as Actual,

    fr.unit,

    [1st_of_month],

    last_of_month

    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 split the comma delimited string into rows without using LOOP, CTE, XML.

    Abu Dina (10/9/2013)


    Use Jeff's string splitter function?

    Tally OH! An Improved SQL 8K “CSV Splitter” Function[/url]

    Jeff's string splitter uses CTEs, but that would have been my first suggestion.:-)

    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 split the comma delimited string into rows without using LOOP, CTE, XML.

    Why do you want to limit the methods? You might be losing performance over strange requirements.

    You could use CLR, but I'm not sure if that counts as a loop for...

    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: Catch invalid object and rollback transaction

    Have you tried the TRY..CATCH to handle errors?

    http://technet.microsoft.com/en-us/library/ms175976(v=sql.105).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: How about a Stairway to CLR series

    It would be great to at least cover the basics.

    It seems important to be prepared if MS ever discontinues the extended procedures.

    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: I dindn't understand how this query works?

    There might be something weird. Maybe the collation used or the way you expect your results.

    This returns 'False' for me with the following collation SQL_Latin1_General_CP1_CI_AS

    IF 'alphabet' > 'ax'

    SELECT 'True'

    ELSE

    SELECT 'False'

    What...

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