Viewing 15 posts - 3,301 through 3,315 (of 5,588 total)
Here's my solution. I took a similar approach that Chris did to make a row for each unit, but how we did that is different (I'm using a tally table...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 8, 2010 at 9:23 am
LutzM (9/8/2010)
call4ljw (9/8/2010)
Editted accordingly...Not really....
Sample data in a ready to use format and expected result, please.
Something like:
CREATE TABLE Book (BookID int....)
CREATE TABLE Borrow (BookID int, ...)
INSERT INTO Book --...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 8, 2010 at 7:55 am
GilaMonster (9/8/2010)
WayneS (9/8/2010)
Would this affect the recovery time of the database? Would it affect it to this extent?
Shouldn't and no.
Recovery just needs the active portion of the log, the...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 8, 2010 at 7:51 am
richard.kirby (9/7/2010)
Thanks John - I've never heard of 'Except' but I'll look it up.Cheers
Richard,
Here's an example, using your provided code:
--Top select
SELECT ClientID,ReferralNumber,AppointmentDate,ActualTime
--,Count(*)
FROM dbo.vwBRSAppointmentsNPD
WHERE SpecialtyReferredTo='ICNR'
AND AppointmentContactCancellationDateTime IS NULL
AND AppointmentDate between...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 8, 2010 at 7:48 am
Grant Fritchey (9/8/2010)
WayneS (9/7/2010)
Steve Jones - Editor (9/7/2010)
WayneS (9/7/2010)
Looks like Lutz is having to pull teeth to get the OP to read how to help himself out.
Actually I picture Lutz...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 8, 2010 at 7:37 am
vrkn82 (9/8/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 8, 2010 at 5:34 am
GilaMonster (9/8/2010)
As I said, poor IO performance (which you confirmed was the case) and log fragmentation are the main causes of long database recovery.
I'm speculating here... if the database was...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 8, 2010 at 5:27 am
You're setting @Month = '20100801'
Then, in you're doing:
BASE.SERVICE_YR_MO BETWEEN CONVERT(CHAR(6),DATEADD(M,-24,CONVERT(datetime,@MONTH + '01',112)),112) AND @MONTH
AND
BASE.PAID_YR_MO BETWEEN CONVERT(CHAR(6),DATEADD(M,-15,CONVERT(datetime,@MONTH + '01',112)),112) AND @MONTH
Adding the string '01' to '20100801' gives you '2010080101', which is...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 7, 2010 at 8:47 pm
This looks okay - as long as you're doing it in the font color property?
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 7, 2010 at 8:43 pm
Megistal (9/7/2010)
CREATE TABLE tab1 (
ID INT Identity(1,1)
, Col1 int
)
INSERT INTO tab1
SELECT Col1 FROM tab2
Does it guaranteed me that new rows inserted in...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 7, 2010 at 5:33 pm
Steve Jones - Editor (9/7/2010)
WayneS (9/7/2010)
Looks like Lutz is having to pull teeth to get the OP to read how to help himself out.Actually I picture Lutz as Wayne's avatar.
The...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 7, 2010 at 5:26 pm
Yes.
SQL Server 2008 Upgrade Technical Reference Guide
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 7, 2010 at 5:01 pm
jcrawf02 (9/7/2010)
LutzM (9/7/2010)
Steve Jones - Editor (9/7/2010)
WayneS (9/7/2010)
Looks like Lutz is having to pull teeth to get the OP to read how to help himself out.
Actually I picture Lutz as...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 7, 2010 at 4:54 pm
mashikoo (9/7/2010)
Thanks Lynn,But there is no column 'A' for active in the dbo.tablename, that is where my problem lies I need to write a new query refrencing this.
Thanks Lynn
mashikoo,
We understand...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 7, 2010 at 3:07 pm
Steve Jones - Editor (9/7/2010)
jcrawf02 (9/7/2010)
LutzM (9/7/2010)
jcrawf02 (9/7/2010)
Now I just have to...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 7, 2010 at 2:53 pm
Viewing 15 posts - 3,301 through 3,315 (of 5,588 total)