Viewing 15 posts - 19,246 through 19,260 (of 22,219 total)
This sort of implies that you're only using the GUI to create tables. You can change the schema for the object created in the gui by accessing the properties window,...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 26, 2008 at 5:43 am
It really depends on your business needs. If you need to keep a history of the individual call itself, your method won't work. If all you care about is the...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 26, 2008 at 5:41 am
Matt's nailed it. If you went for the identity value on the table, you could get someone else's insert value. OUTPUT pretty much guarantees what you're getting. Still, in most...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 26, 2008 at 5:23 am
Huh... I'm kind of amazed that works. I just tested it. Not only can you do it, but it doesn't affect inserts or updates. Strange.
No, I can't imagine why you...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 25, 2008 at 12:24 pm
You can also open up the Properties window and set it there.
Best of all, try using TSQL. I think it's a heck of a lot easier to create tables there...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 25, 2008 at 10:51 am
For a single value from OUTPUT, I'm pretty sure it's free.
Where you might see a performance hit (or benefit, depending on how you define it) is when you define...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 25, 2008 at 10:48 am
Garadin (11/25/2008)
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 25, 2008 at 10:43 am
That one was a hoot. The original problem definition was what, four lines. It grew to almost four pages of code by the time the guy was done adding things.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 25, 2008 at 10:40 am
Wow! Thanks!
You're very welcome.
Lookup information on sys.dm_exec_cached_plans and some of the other dynamic management views. I left that out and wish I had it in there now.
Do what Steve says....
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 25, 2008 at 9:52 am
Wow, I really misunderstood then. I thought you were going for the most frequent occurence.
Well then, here's one more suggestion. In the sub-query, replace the MAX with a TOP 1...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 25, 2008 at 9:45 am
kalikal (11/25/2008)
I had to make a slight change but it now works - thank you for taking the trouble to help.
WITH X AS (SELECT ...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 25, 2008 at 9:15 am
Books Online are available on line here:
http://msdn.microsoft.com/en-us/library/ms130214.aspx
The OUTPUT clause that you want is here (this in the 2008 version, but it's the same):
http://msdn.microsoft.com/en-us/library/ms177564.aspx
Here is an article describing the OUTPUT clause:
http://blogs.msdn.com/sqltips/archive/2005/06/13/OUTPUT_clause.aspx
@@IDENTITY...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 25, 2008 at 8:30 am
Yes, it is possible through SSIS.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 25, 2008 at 8:22 am
Oh, that's a different problem. I got you a max for the unique combination of values. Just to get a max for each ProductId drop the second sub-select in the...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 25, 2008 at 8:17 am
I've never thought about automating it before. I took a quick look at what happens in Profiler when I script a database. It must be an SMO call from Management...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 25, 2008 at 6:49 am
Viewing 15 posts - 19,246 through 19,260 (of 22,219 total)