Viewing 15 posts - 18,676 through 18,690 (of 22,226 total)
How does table 3 relate to the others?
Also, didn't this get posted before in the same form?
"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
January 21, 2009 at 6:21 am
Abhijit More (1/21/2009)
CREATE TABLE tmpProduct
(
ProductIDINT IDENTITY(1, 1) PRIMARY KEY CLUSTERED,
ProductNameVARCHAR(10)
)
CREATE TABLE tmpProductSales
(
ProductSalesIDINT IDENTITY(1, 1) PRIMARY KEY CLUSTERED,
ProductIDINT,
TotalAmtMONEY,
BalanceAmtMONEY
)
INSERTtmpProduct(ProductName)
SELECT'Pr0duct' UNION
SELECT'Pr0duct2' UNION
SELECT'Pr0duct3' UNION
SELECT'Pr0duct4'
INSERTtmpProductSales(ProductID,...
"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
January 21, 2009 at 6:19 am
Are you trying to insert into the first temp table filling the gaps?
Because if you're simply trying to insert unique numbers, you can get the max value from the original...
"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
January 21, 2009 at 6:08 am
And if you want to get really confused, then, without an IDENTITY setting on the column, when the table is empty, the MAX value should be NULL. I'll bet that's...
"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
January 21, 2009 at 6:01 am
Great. Glad to hear it. And thanks for posting the success of the suggestion.
"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
January 21, 2009 at 5:32 am
So when you say you want to "extract non-generic sql" do you mean that you have stored procedures in your database that you need to pull out or that 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
January 20, 2009 at 6:42 am
I didn't have that one on my list. I do now.
"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
January 20, 2009 at 6:15 am
Check out the Books Online for the topic SQL Agent. Agent is a scheduling process that will let you run lots of stuff, including TSQL batches, on a scheduled basis....
"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
January 20, 2009 at 5:49 am
One place I've been visiting for bits and pieces is this blog: http://blogs.msdn.com/sqltips/default.aspx
But by & large, for focused information, Gail has given you what I've been using.
There is also 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
January 20, 2009 at 5:47 am
mgalgey (1/20/2009)
I want to capture any custom code that is in the stored proc that is not auto generated and insert it into the new stored proc.
Eg
Old ...
"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
January 20, 2009 at 5:41 am
Oh, and it goes before the ORDER BY clause.
"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
January 20, 2009 at 5:36 am
Try using the HAVING clause. Look it up in Books Online for details, but it would look something like this:
SELECT...
FROM...
WHERE..
GROUP BY...
HAVING SUM(MyValue) > 0
It's sort of like a WHERE clause...
"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
January 20, 2009 at 5:35 am
I'm not aware of a good, all encompassing SQL Server 2005 tutorial. I'm with Jack. You'll need to hit JumpstartTV, Simple-Talk, and of course, here at SSC, to get 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
January 19, 2009 at 11:42 am
Jack Corbett (1/19/2009)
Grant Fritchey (1/19/2009)
Ninja's_RGR'us (1/19/2009)
That's worth repiting Grant :w00t::D:hehe:.
What? Did the copy editors fall down on the job again. Steve, fire that mangy lot and get someone decent in...
"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
January 19, 2009 at 7:26 am
Ninja's_RGR'us (1/19/2009)
That's worth repiting Grant :w00t::D:hehe:.
What? Did the copy editors fall down on the job again. Steve, fire that mangy lot and get someone decent in here to protect us...
"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
January 19, 2009 at 7:03 am
Viewing 15 posts - 18,676 through 18,690 (of 22,226 total)