Forum Replies Created

Viewing 15 posts - 6,301 through 6,315 (of 8,731 total)

  • RE: How to avoid duplicate values?

    How do you get the parameter list? Is it a query where you could you simply add a DISTINCT?

    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: Display results as vertical string? Use PIVOT?

    If I understand correctly, this article explains what you need:

    http://www.sqlservercentral.com/articles/comma+separated+list/71700/

    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: Total in pivot Statement

    Yes, I saw that after Ed replied and didn't want to repeat it.

    Thank you for the feedback.

    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: Need a trigger to stop a restore with replace

    I'm not sure if you can do that, but why don't you remove the permissions to restore backups on the database for that user?

    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: Total in pivot Statement

    That's the expected output, where's the sample data?

    My options should give you that total. How is it wrong?

    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: Records in n-Relation-Table in one Select-Statment

    This article can help you accomplish what you're looking for:

    http://www.sqlservercentral.com/articles/comma+separated+list/71700/

    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: Total in pivot Statement

    Can you be more specific? What's wrong with what I posted?

    I could help you better with sample data and expected output as described on the article in my signature.

    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: Total in pivot Statement

    You could change your approach to a traditional CROSS TAB.

    You'll end with something like this:

    --Normal cross tab

    SELECT Hospital,

    p.subjectnumber,

    COUNT ( CASE OralAnticoagulantID...

    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: Weird Join Problem

    Maybe this code can help you. 😉

    SELECT ISNULL(

    REPLACE(

    ...

    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?

    Hi Andrew!

    Could you remind me your previous username? My ADHD won't let me remember. 😀

    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: Find Customers Who Bought "A" and "B" But Not "C" (SQL Spackle)

    Naomi N (6/6/2014)


    Luis Cazares (6/6/2014)


    Naomi N (6/6/2014)


    Peter,

    I think we wanted customers who bought A and B but not C, so your query will be even simpler,

    MIN(productID) = 'A' and MAX(productID)...

    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: Find Customers Who Bought "A" and "B" But Not "C" (SQL Spackle)

    Naomi N (6/6/2014)


    Peter,

    I think we wanted customers who bought A and B but not C, so your query will be even simpler,

    MIN(productID) = 'A' and MAX(productID) = 'B'

    What if we...

    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: Just curious, what are your SQL pet peeves ?

    djj (6/6/2014)


    Luis Cazares (6/6/2014)

    That's why I consider zip codes, phone numbers, credit card numbers & others should be stored on string type columns. You could enforce to use just digits...

    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: Interview Questions

    dotnetkim (6/6/2014)


    Good thing this wasn't a pop quiz on the difference between "your" and "you're".

    LOL :hehe: My fault.

    I know the difference, I'm not sure why did I write it wrong...

    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: Just curious, what are your SQL pet peeves ?

    djj (6/6/2014)


    An expert converted our database from Access to SQL2000. We now have zip codes that are float, column names with spaces and #.

    One thing I do...

    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 - 6,301 through 6,315 (of 8,731 total)