Forum Replies Created

Viewing 15 posts - 7,711 through 7,725 (of 8,731 total)

  • RE: Are the posted questions getting worse?

    jasona.work (9/16/2013)


    What happened? Nothing new in here all weekend, and it's not even any sort of a holiday anywhere (that I'm aware of at least...)

    It's Independence day in Mexico...

    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: Extract string between to characters

    Maybe you're trying to hard with different functions and didn't notice the splitter that Sean commented. With some replaces, it should work great for you.

    SELECT MAX( CASE WHEN ItemNumber =...

    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 a query

    Here are two options. Be sure to understand them before using them in production.

    If you have any question, feel free to ask.

    UPDATE t SET

    Haslift = 0

    FROM #Tracking t

    WHERE NOT EXISTS(...

    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 convert column data into row data?

    Erland Sommarskog (9/11/2013)


    ChrisM@Work (9/4/2013)


    Or CROSS APPLY VALUES

    Somewhat odd to use CROSS APPLY here. The normal is CROSS JOIN. Of course since there is no correlation on the right side, 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: how to get data from a table all in one result row

    You can use cross tabs to accomplish this. To read more about this technique, read the following article.

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    SELECT ID,

    MAX( CASE WHEN Name = 'Description'...

    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: Alternative to Cursor

    It depends on what the cursor and the SP do. To give a good advice you should give more details on what you're trying to accomplish.

    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: FOR XML question

    If I understand correctly, you want to show the emails that have multiple ids.

    Here are 2 options. If I continue to be wrong, please explain what's the problem 🙂

    WITH 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: FOR XML question

    Another option would be using a different approach.

    select s.email,

    COUNT( distinct s.id) [ids]

    from dbo.j3688931 s

    GROUP BY s.email

    HAVING COUNT( distinct s.id) > 1

    I'm just guessing here because I can't see your...

    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: FOR XML question

    Have you tried using CHARINDEX?

    WHERE CHARINDEX( ',', s1.id) > 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: Pivot Help--I need to Pivot really to just make the rows the column

    You're not giving enough information.

    We would be happy to help but we need you to be more explicit on what you need.

    Please post the DDL for your tables and sample...

    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: Pivot views

    I'm not sure if this article might help you. It's a great explanation by Jeff Moden

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    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: concatenate with leading zeros

    You guys are awesome. That's why I love this site, it reminds me to think different to look for better results. 🙂

    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: concatenate with leading zeros

    I'm not sure that's giving you the correct result. You said you need to have 6 characters on the first part and 3 on the second one. You need 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: concatenate with leading zeros

    John.Hagen (9/9/2013)


    it turns out it is not working correctly. It is adding all the zeros to the front and not to the 2 parts.

    Column 1 - 12345 should be 6...

    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

    Just another way to do it. It should perform better than the JOIN, but I'm not sure about INTERSECT.

    select product_id

    from tablea a

    WHERE brand_id=1

    AND EXISTS(

    select product_id

    from tablea b

    WHERE brand_id=2

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