Viewing 15 posts - 14,671 through 14,685 (of 14,953 total)
Actually, if the date is "2/14/2008 00:00:00.000" and you want = "2/14/08', it will come up. But if the date is stored as "2/14/2008 12:00:00.000" and you want =...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 14, 2008 at 8:51 am
I've had both good and bad Agile experiences as a DBA.
In one case, "we're an agile shop" was used mainly as an excuse to avoid planning and documentation. Lots...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 14, 2008 at 6:35 am
MrAkki (2/13/2008)
The problem is, that the Rollback is initiated by the Client and not in the StoredProcedure....
So I was wondering if I can log the errors to...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 13, 2008 at 7:41 am
What you need to do is look at the long running queries in the database(s) and then analyze them for what makes them slow. I doubt it's varchar vs...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 12, 2008 at 3:10 pm
Yes.
But the details vary.
For example, if I ran an index defrag on my main production server all at once, it would run longer than the time-slot I have available for...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 12, 2008 at 3:07 pm
I don't know what a "code complexity analysis" is. Can you clarify?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 12, 2008 at 2:59 pm
Log them to a table variable, and in your Catch statement, insert them into the log table AFTER the rollback. Table variables don't do rollback.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 12, 2008 at 2:54 pm
You can use "replace" (see Books Online for details).
Sample:
update dbo.Table
set Col1 = replace(Col1, "mcdonald", "MacDonald")
where Col1 like '%mcdonald%'
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 12, 2008 at 2:46 pm
Create a view with rand() in it, then pull from that instead of using rand() in the function. That usually works.
create view Random
as
select rand() as num
SET @RandNum = ROUND(@mn...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 12, 2008 at 2:10 pm
Try something like this:
select distinct tempcheck_id, record_id
from #tempcheck
inner join
(select tempcheck_id, min(record_id) as min_id
from #tempcheck
group by tempcheck_id) Sub
on main.tempcheck_id = sub.tempcheck_id
and main.record_id = sub.min_id
except
select t1.tempcheck_id, t1.record_id
from #tempcheck t1
inner join #tempcheck t2
on...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 12, 2008 at 1:41 pm
I should ammend what I just said. A table variable doesn't have a clustered index. Doesn't have any indexes. But it's common (though not guaranteed) that unordered...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 12, 2008 at 1:22 pm
Clive Strong (2/12/2008)
The two pieces of code are the same, with the exception that one...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 12, 2008 at 1:18 pm
Move the order by clause from the insert to the select.
DECLARE @T1 TABLE (ENTITYID INT PRIMARY KEY, entityname varchar(100))
INSERT INTO @T1
SELECT ENTITYID, entityname
FROM ENTITY
SELECT entityid FROM @T1
order by entityname desc
(Changes...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 12, 2008 at 11:18 am
I just had a thought.
Maybe something like this would work:
create proc @Update
(@SourceTable_in varchar(100),
@TargetTable_in varchar(100))
as
declare @Script varchar(max)
select @script = 'delete from ' + @targettable_in +
' where id in (select id...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 12, 2008 at 11:10 am
My conclusion is that having calculated, indexed columns (not persisted) can be quite useful in the right circumstances. Dates are especially subject to this, because selecting against them is...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 12, 2008 at 10:59 am
Viewing 15 posts - 14,671 through 14,685 (of 14,953 total)