Viewing 15 posts - 61 through 75 (of 507 total)
aostanley,
Here's another way to do it using APPLY. Just another way to look at it.
WITH Rel AS
( SELECT DISTINCT Type
FROM RelationshipTable
)
SELECT R.Type
, X.Number, X.Name
FROM Rel R
CROSS APPLY
...
December 1, 2011 at 1:56 pm
Nico,
I would also like to see the actual query plan with the OPTIMIZE FOR not commented out. I'm with Craig on this. With such a dramatic difference between...
December 1, 2011 at 1:35 pm
Lutz,
As I recall it just asks for the columns for a unique/primary key.
Todd
December 1, 2011 at 1:01 pm
As a further comment on what Lutz posted. An updatable query in Access may not be updatable when converted to a view on the SQL Server side. When...
December 1, 2011 at 12:08 pm
Hylton Tregenza (11/29/2011)
Thank you for the time you spent on this.
Yes, the query was generated/formatted using Microsoft SQL Server Management Studio.
Your comments about posting sensible questions with sufficient...
November 30, 2011 at 11:33 am
The WHERE NOT EXISTS() works fine to prevent duplicate inserts into the table as long as the set you are inserting also doesn't have duplicates in it.
You have the pre-qualify...
November 30, 2011 at 11:16 am
I find SELECT INTO as a very handy dandy tool to create a table quickly. If I'm a bit queasy about letting a big DELETE or UPDATE query loose...
November 29, 2011 at 5:55 pm
Jeff,
I came up through the ranks of MS Access then SQL Server. I found the query designer in Access produced code that was almost unreadable with the table joins....
November 29, 2011 at 5:33 pm
Hylton,
Please in the future post the table definitions, some sample data and the expected results.
It looks to me like the query was created using some sort of query designer tool....
November 29, 2011 at 5:15 pm
Tom,
As Craig pointed out an open connection shouldn't interfere with anything.
However, when using VB/VBA I find that explicitly closing and/or destroying objects before exiting the routine is a good practice....
November 29, 2011 at 1:35 pm
Andy,
This type of sequence table logic can be problematic if 2 processes hit the table at the same time requesting the next TranID (sequence number). You can get the...
November 29, 2011 at 12:46 pm
PriyaBabu,
I noticed you used the older syntax of joining the tables in the WHERE clause. While this works, it is preferred to join the tables in the FROM part...
November 29, 2011 at 12:27 pm
Evil Kraig F (11/22/2011)
Thanks Todd, I think you were thinking of this article from me though, though probably helpful here too, thanks for reminding me:
November 22, 2011 at 3:32 pm
There has been lots of very good advice already posted. Craig's article is one of the best I've seen on the subject.
One of the main points you have to...
November 22, 2011 at 12:37 pm
No laser. Stronger reading glasses:pinch:
November 15, 2011 at 6:46 pm
Viewing 15 posts - 61 through 75 (of 507 total)