Viewing 15 posts - 916 through 930 (of 2,647 total)
Ahh yes... Sorry, I did not look at your results completely. You may want to look at the PIVOT capabilities of SQL Server. Personally, I prefer to picot...
May 16, 2012 at 8:10 am
erics44 (5/16/2012)
I have always been under the impression that in tables where there are a lot of inserts a clustered index should be avoided and clustered indexes should be used...
May 16, 2012 at 8:05 am
I think the problem lies in your point #1:
But issue with this option is I don't have access to client's machine and if I use DB from some specific version...
May 16, 2012 at 7:44 am
If the SQL Server Database Engine detects that the system is busy, the degree of parallelism of the index operation is automatically reduced before statement execution starts.
...so might be that...
May 16, 2012 at 7:37 am
Thanks for posting all of the pertinent information! Since you are learning, I don't want to simply provide you with a script. So, are you familiar with a left...
May 16, 2012 at 7:32 am
Assuming it is indexed properly, 10 million records should not be an issue. Let's say the join condition is called ID... Just do a select from the target table...
May 15, 2012 at 4:49 pm
We keep trying to fix your code, but you keep posting the same thing. We can't help you if you keep posting the same thing over and over.
May 15, 2012 at 4:46 pm
Ok, do you know how to join to the employment status table? Can you please give us the table definitions for the tables? That is what I asked for.
May 15, 2012 at 4:45 pm
You're missing the most important parts 🙂 Table definitions for your tables and sample data. This way, we can simulate on our own machines. Sample data does not mean...
May 15, 2012 at 3:16 pm
OH!!! I got it now!
SELECT AgencyID, AgencyName,AgencyType,
SUM(CASE WHEN isOpenAllegation = 1 THEN 1
ELSE 0 END) AS countAllegations,
...
May 15, 2012 at 2:52 pm
I just altered the code from my previous post. Please try that.
This:
Select AgencyID, AgencyName,AgencyType, Count of all docs for this AgencyID where
isOpenAllegation= 1, Count of all docs...
May 15, 2012 at 2:46 pm
Hmm... Can't be done. http://www.brentozar.com/archive/2008/10/sql-server-2008-management-studio-group-execute/ toward the bottom. It is because the SSMS "feature" sends this query to each server individually. Sorry!
May 15, 2012 at 2:36 pm
Did you try the server name instead f just the 3 part naming for the INSERT INTO? Not sure that it will work, and if it doesn't then I don't...
May 15, 2012 at 2:31 pm
Start with this:
;WITH docs AS (
Select AgencyID, Count(*) As Count3yrDocs
From LLA_Audits
Where IsOpenAllegation = 1
GROUP BY agencyID),
scsdocs AS (
Select AgencyID, Count(*) AS CountScsDocs
From LLA_Audits
Where WorkType = 'Agreed-upon Procedures'
GROUP BY AgencyID
)
SELECT a.AgencyId,...
May 15, 2012 at 2:26 pm
Viewing 15 posts - 916 through 930 (of 2,647 total)