22,810 reputation
33979
bio website blogs.msdn.com/b/sql_pfe_blog
location In the Ocean somewhere...
age
visits member for 3 years, 1 month
seen 36 mins ago

SQL Server Premier Field Engineer at Microsoft.

Twitter: @SQLife
Blog: http://blogs.msdn.com/b/sql_pfe_blog/
Email: sqlsalt [at] outlook [dot] com

Disclaimer
The views expressed on my posts on this site are mine alone and do not reflect the views of my company. All posts of mine are provided "AS IS" with no warranties, and confers no rights.

The following disclaimer applies to all code, scripts and demos available on my posts:

This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code, provided that You agree: (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits, including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.


Jan
11
comment Same Query takes 0 seconds on Server A, 7.5 minutes on Server B (same db/hardware/config)
Does the patient_account_fk nonclustered index not exist on your slow server's database table IB_Charge? Your index scan has an estimated row count of 9.7+ million rows where only about 1000 are required. I believe your eager index spool (a blocking operation) is to blame because of that. Not to mention, even on the other server/database/table (the "fast" one) you have an expensive key lookup that you can solve with a covering index. Long story short, poor indexing is causing your woes.
Jan
11
comment Same Query takes 0 seconds on Server A, 7.5 minutes on Server B (same db/hardware/config)
On each server, what does set statistics io on .... run your query .... set statistics io off look like?
Jan
11
comment Same Query takes 0 seconds on Server A, 7.5 minutes on Server B (same db/hardware/config)
Agreed with @AaronBertrand. Post the plans and we'll take a look.
Jan
7
revised Advice about Backup Solution
edited tags
Jan
7
answered Advice about Backup Solution
Jan
6
reviewed Approve suggested edit on How do I fix SQL Server assembly optimization errors and memory exhaustion?
Jan
5
comment Safe way to truncate SQL Server Error Log
@JohnDaCosta please reread the question. I believe you are mistaken.
Jan
3
revised can you run sql server 2005 and sql server 2008 r2 in mirror mode?
edited tags
Jan
3
revised can you run sql server 2005 and sql server 2008 r2 in mirror mode?
added 172 characters in body
Jan
3
answered can you run sql server 2005 and sql server 2008 r2 in mirror mode?
Jan
3
comment Query Regarding Database Instance not proper
Are you sure that Test resolves to the IP address you expect?
Jan
2
revised Why does SqlSentry Plan Explorer not give the duration of my queries?
edited tags
Jan
2
comment Color syntax printing in SSMS 2012
"Print" as in physically print to an ink printer?
Jan
2
revised Safe way to truncate SQL Server Error Log
edited tags
Jan
2
answered Safe way to truncate SQL Server Error Log
Dec
31
comment Does this mean the 'public' has full select, insert, update, and delete access?
Nope, the deny should take precedence in that case.
Dec
31
comment Does this mean the 'public' has full select, insert, update, and delete access?
Off the top of my head, I can't think of an easy way around that one. The real question is why does the public role have those excessive permissions??? That's a huge security issue in my opinion. I'd contact the vendor and demand an explanation on that one. Perhaps they will give you written consent to change permissions to the public role if they get push back. I'd be surprised if they actually had a good reason for giving public those permissions.
Dec
31
revised Does this mean the 'public' has full select, insert, update, and delete access?
edited tags
Dec
31
comment Does this mean the 'public' has full select, insert, update, and delete access?
Define "everything". What exactly do you want the user to be able to do/not do?
Dec
31
revised Does this mean the 'public' has full select, insert, update, and delete access?
added 1387 characters in body