Forum Replies Created

Viewing 15 posts - 6,286 through 6,300 (of 8,731 total)

  • RE: Find Customers Who Bought "A" and "B" But Not "C" (SQL Spackle)

    Hi Rob,

    The problem with your first query is that you missed to add the join condition for the CustomerID. In result, you're getting a cross join between all the rows...

    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: Where do I put my data

    You might want to check the books section on this site. There are some that might help.

    Troubleshooting SQL Server: A Guide for the Accidental DBA by Jonathan Kehayias and Ted...

    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: install backward compatability

    Does this help?

    http://blogs.msdn.com/b/ramoji/archive/2008/10/16/how-to-open-dts-packages-in-sql-server-2008.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: Query help

    If you only need those 3 levels, just keep it simple. 😉

    SELECT p.TeacherId AS userID,

    s.UserID AS student

    FROM #temp p

    JOIN #temp s ON p.UserID = s.TeacherID

    WHERE...

    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: Tool

    There is one free built-in tool.

    http://msdn.microsoft.com/en-us/library/ms188055.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: automatically create insert statements for table data

    You can read on how to do it in the article linked 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: Just curious, what are your SQL pet peeves ?

    Sean Lange (6/10/2014)


    below86 (6/10/2014)


    Having a consistent naming convention for fields. I am as guilty as anybody at not doing this, but it is driving me nuts now. Years...

    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: CASE condition not affecting CAST output

    Or you could use a single data type such as a (var)char.

    SELECT CASE WHEN decimals = 0

    THEN...

    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: Arithmetic overflow error converting numeric to data type numeric

    That's because 16 is the full length. From those 16 positions you need to substract 4 for decimal positions. That gives you 12 positions on the left and 4 positions...

    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: CASE condition not affecting CAST output

    A CASE statement can only return one type of data. All possible returned values should be the same. Imagine that you have something more extreme such as

    select case when datatype='int'...

    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: exporting data

    Hi welcome to the forums,

    bcp only allows to export to a text file (regardless of format or extension). If you want to use it, you'll need to have the intermediate...

    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 avoid duplicate values?

    New Born DBA (6/10/2014)


    I also don't have access to the DB yet. I am using the shared dataset which was provided to me.

    That can be a problem and you might...

    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: Bulk Insert

    I would go with the format file. That way you have a little more control on what it's happening.

    Jeff Moden made a great article for starters on this (it helped...

    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 avoid duplicate values?

    Why do you have so many columns?

    It's normal that you get an error if you're using distinct and ordering by a column that's not returned in the select.

    You should use...

    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 avoid duplicate values?

    New Born DBA (6/9/2014)


    Luis Cazares (6/9/2014)


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

    This is what I did. (see attachment)

    So...

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