Forum Replies Created

Viewing 15 posts - 181 through 195 (of 291 total)

  • RE: Query help

    Remember you did ask for the most EFFICIENT sql, and using exists() is a lot less efficient then using a join and simple where clause (i.e. something <> 'Cancel').  The...

  • RE: Query help

    SELECT DISTINCT L.LoadID

    FROM @Load L

        INNER JOIN @Orders O

        ON L.LoadID = O.LoadID

    WHERE O.Status <> 'Cancel'

    Is there some reason the example John provided doesn't work for you?  You should...

  • RE: Query help

    You can use the "Having" clause only if you are doing a group by clause and then only with columns included in the select statement.

    Sounds like the where clause is...

  • RE: Query help

    I think John's example is right on the money.  If you need specific help changing an "existing" query then you should post the actual query.  If possible you should also...

  • RE: Correlated joins

    What do you mean by "Coorelated Join"?  Granted I don't pay particular attention to all the "jargon" but I've heard of "Coorelated Sub-queries" which as I understand it means that...

  • RE: Copying DB from one server to another, dfferent DB name, using scripts

    While I'm sure there is a way to retrieve that info I have not done so through a script.  If the database already exists you can get it from the...

  • RE: Problem with Cursor Insert

    I'm not sure from your code what is going wrong.  I would need to see the rest of the script, especially up to the point of the actual insert.  But...

  • RE: Copying DB from one server to another, dfferent DB name, using scripts

    This can be done in a couple of different ways.  The easiest I think would be a backup/restore (though you can use sp_detach_db and sp_attach_db as well). Here is an...

  • RE: Sort column without ORDER BY

    Make it a clustered index

  • RE: Problem in attaching database

    Sounds like something corrupted in the database.  Did you run sp_detach_db before copying the database files to the new server?  I've never encountered a problem after detaching a database (doesn't...

  • RE: How To Use Wildcard in SELECT Statement (but not in WHERE clause)

    xp_fileexist does not work with wild cards, so unless you know the exact file name I don't think you are going to have any luck getting what you want. 

     

    James.

  • RE: Min values

    What do you mean it does for some fields and not for others?  You have asked only for the min of test_result.  I'm assuming you are grouping by KPAIDS_NO and...

  • RE: using sp_executesql and restore verifyonly

    I don't believe you can get anything back because "restore" does not return a result set.  It outputs a "message" only which is neither a "Return Value/Code" or "Result Set"...

  • RE: Can''''t connect to 2000 db from particular client machine

    Hmm, what is the security setting, SQL Server and Windows or Windows Only?

    Just so I'm clear, you can connect to the instance in question from "other" client workstations, just not...

  • RE: Using a foreign Key as the PrimaryKey

    There is nothing wrong with it.  It is unusal for the FK to be the PK because that means you have a 1 to 1 relationship with your parent table. ...

Viewing 15 posts - 181 through 195 (of 291 total)