Viewing 15 posts - 2,986 through 3,000 (of 5,588 total)
Here's some code.
Note that I kept in the prefix checking... I need to strip it out anyway, so I just kept it in.
-- need to add some columns to the...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 7, 2010 at 10:54 am
craig-404139 (10/6/2010)
Please skip to post Post #1000624 for updated requirements.
It's actually post # 1000643. Also, if you click the post number, you will get a URL that you can...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 7, 2010 at 10:13 am
CirquedeSQLeil (10/7/2010)
Alvin Ramard (10/7/2010)
CirquedeSQLeil (10/7/2010)
GilaMonster (10/7/2010)
This has got to take some form of prize. http://www.sqlservercentral.com/Forums/FindPost1000227.aspxTime to get the crystal ball out again.
Sounds like a college exam to me. Or...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 7, 2010 at 9:31 am
Gianluca Sartori (10/7/2010)
WayneS (10/7/2010)
try:
set @t1=IsNull((select sum(a) from order where type='1'),0) + IsNull((select sum(b) from order2 where code='3'),0)... ok, it was me! 🙂
:w00t::hehe::-P
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 7, 2010 at 8:30 am
Here's an alternative way that doesn't require verifying if the table exist, and doesn't perform a count(*) against the table if it does:
IF OBJECT_ID('tempdb..#TEST') IS NOT NULL DROP TABLE #TEST;
CREATE...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 7, 2010 at 7:59 am
try:
set @t1=IsNull((select sum(a) from order where type='1'),0) + IsNull((select sum(b) from order2 where code='3'),0)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 7, 2010 at 7:43 am
Jeff Moden (10/7/2010)
So... without me running all the code presented so far, what has been decided? Does the numbering restart for each prefix or not?
Haven't heard back from the...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 7, 2010 at 7:41 am
Andrew - I'll test out your modifications tonight. Interesting the large difference in time between our systems.
Thanks for making the change to use the same # of characters for a...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 7, 2010 at 7:04 am
Okay, I am seeing the IO frozen/thawed messages in the sql log, so it does appear that NT backup is the culprit. Time to work with the SAs to fix...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 7, 2010 at 6:51 am
Brandie Tarvin (10/7/2010)
GilaMonster (10/7/2010)
This has got to take some form of prize. http://www.sqlservercentral.com/Forums/FindPost1000227.aspxTime to get the crystal ball out again.
Apparently it's my turn to feel snippy. I couldn't resist.
IMO, it...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 7, 2010 at 6:29 am
Craig Farrell (10/6/2010)
WayneS (10/6/2010)
craig-404139 (10/6/2010)
(I've got some real nifty, high-speed code (thanks to Jeff!) to quickly...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 6, 2010 at 7:07 pm
Craig Farrell (10/6/2010)
The Test Harness:
SELECT TOP 1000000
IDENTITY(INT, 1,1) AS N
INTOTally
FROM
Master.dbo.SysColumns...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 6, 2010 at 6:54 pm
Craig Farrell (10/6/2010)
WayneS (10/6/2010)
Research links, no. But I've seen deadlocks caused by parallelism before myself... so self-research - yes.
Well, in that case, Amit, try a MAXDOP 1 and see if...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 6, 2010 at 6:45 pm
Craig Farrell (10/6/2010)
WayneS (10/6/2010)
Craig Farrell (10/6/2010)
Answer: No and no.This code, as is, will not deadlock independently. There's no transaction calls.
What is the serverwide setting for isolation?
Craig, did you consider...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 6, 2010 at 6:32 pm
craig-404139 (10/6/2010)
Craig Farrell (10/6/2010)
craig-404139 (10/6/2010)
Craig Farrell (10/6/2010)
Is it safe to assume that this field will alway end in numerics? If so, I may have a simple solution for you...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 6, 2010 at 6:25 pm
Viewing 15 posts - 2,986 through 3,000 (of 5,588 total)