Viewing 15 posts - 11,131 through 11,145 (of 14,953 total)
The stats thing will show parse and compile time vs execution time. Should give you what you need.
Most likely, it's not the compile time, it's IO differences or computation...
February 4, 2009 at 3:17 pm
It sounds like you're asking about a "foreign key" constraint. Look those up in Books Online or MSDN, see if that's what you need.
February 4, 2009 at 3:06 pm
sayfrend (2/4/2009)
DBCC sqlperf ('logspace')
check for the %used column for your database
do the following,
Step1: Change your Recovery Model from Full to Simple...
February 4, 2009 at 3:03 pm
If you use "set statistics time on", it will give you the parse and compile time. That's pretty much the time spent reading the query and building an execution...
February 4, 2009 at 2:58 pm
Oh, there's no guarantee that what I mentioned is the cause. It's just the most common one I've seen.
It's not necessarily that it will happen a lot when the...
February 4, 2009 at 2:56 pm
jjg, I'm afraid I don't see how having a calendar table and selecting a count from it is going to be more difficult for anyone to understand than the code...
February 4, 2009 at 2:24 pm
Select the data from the primary table, and use derived tables (or CTEs) to get the count from each of the two sub-tables.
select Cust_ID, count(*) as Sec_Count
from Sec_Order
group by Cust_ID
That's...
February 4, 2009 at 1:58 pm
The performance of the union version depends almost completely on what indexes you have on the table and how well the individual queries hit those. Secondarily, it can get...
February 4, 2009 at 1:49 pm
The schedule wizard in SQL Server Agent does that kind of thing quite easily in most cases. What problem are you running into with it?
February 4, 2009 at 1:35 pm
Most likely, tempdb is trying to automatically resize itself because of heavy use. That can cause exactly this kind of behavior. Try setting the default size of tempdb...
February 4, 2009 at 1:34 pm
Have you looked at the DatePart function? Won't that do what you need?
February 4, 2009 at 1:31 pm
I'm not sure where your BOCLEARED column gets it's data. May be in there somewhere, but that table structure is close to unreadable.
What you can do with a situation...
February 4, 2009 at 1:30 pm
I'd tend to go with the first one. Doesn't depend on future developers remembering/understanding that it has to insert into two tables.
February 4, 2009 at 1:23 pm
There are a couple of other options for this kind of thing.
One is to use Union statements.
select Col1, Col2
from dbo.MyTable
where Col1 = @Param1
Union
select Col1, Col2
from dbo.MyTable
where Col2 = @Param2;
Another is...
February 4, 2009 at 1:19 pm
The correct way to truncate the transaction log is run a log backup.
February 4, 2009 at 11:25 am
Viewing 15 posts - 11,131 through 11,145 (of 14,953 total)