Viewing 15 posts - 181 through 195 (of 291 total)
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...
May 31, 2007 at 12:21 pm
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...
May 31, 2007 at 12:07 pm
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...
May 31, 2007 at 11:14 am
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...
May 31, 2007 at 9:42 am
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...
May 30, 2007 at 1:34 pm
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...
May 29, 2007 at 10:26 am
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...
May 29, 2007 at 9:58 am
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...
May 29, 2007 at 9:38 am
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...
May 29, 2007 at 6:34 am
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.
May 25, 2007 at 1:15 pm
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...
May 25, 2007 at 1:00 pm
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"...
May 25, 2007 at 12:53 pm
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...
May 25, 2007 at 12:29 pm
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. ...
May 25, 2007 at 11:40 am
Viewing 15 posts - 181 through 195 (of 291 total)