21,420 reputation
33573
bio website blogs.msdn.com/b/sql_pfe_blog
location In the Ocean somewhere...
age
visits member for 2 years, 9 months
seen 2 hours 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.


Apr
16
comment How Automatic Failover Works (AlwaysOn)
You could have some scheduled job that polls for the desired primary as a secondary in SYNCHRONIZED state, and if that's the case then failover. Just realize that this unnecessary failover could and would be an interruption in service of the database.
Apr
8
comment Index against a subset of rows?
Great point, Aaron. Thanks for the additional information!
Apr
7
comment Cannot Copy Database
I am interested to see what the error message during your RESTORE operation is. That should be rather specific.
Apr
7
comment Cannot Copy Database
Are you looking on your local machine, or on the server? You should be looking on the server here the SQL Server instance actually lives.
Apr
7
comment Cannot Copy Database
Where are you looking for the "error log file" from this operation? And with the backup/restore approach, what was the error you got when you attempted to restore the database?
Apr
2
comment Multiple Transaction Log files and performance impact
It does answer the question on why you see different I/O. The point is, having multiple transaction logs is contributing absolutely nothing to your differing I/O stats.
Apr
2
comment High Query Wait Times
Ok, that is the wait time. But what is/are the wait type(s)?
Apr
2
comment How to solve the error Msg 547, Level 16, State 0, Line 1
What does your table look like (CREATE TABLE DDL, as well as constraint DDL), and what was your exact statement that you tried to execute, resulting in the error?
Apr
1
comment How do I delete unique rows from a table with duplicate keys?
Essentially, yes. That's basically what is happening.
Apr
1
comment High Query Wait Times
@K09 the next step would be to find out what/who is running it. What version of SQL Server are you using?
Apr
1
comment Secure database access from particular applications
@JasmineJohn I understand that might be the easiest approach, but I highly recommend against doing that. As per my answer, that implementation is extremely easy to get around with almost no effort.
Apr
1
comment SQL service does *not* start, port 1433 in use
@user36285 Ha! I tend to be doubtful of things just fixing themselves :-) But keep an eye on it! And of course, always glad to help!
Mar
31
comment Altering Multiple Tables
+1 Completely missed the part to add the column if it doesn't exist. This answer is the complete and correct one.
Mar
27
comment SQL service does *not* start, port 1433 in use
Of course, always glad to help!
Mar
27
comment SQL service does *not* start, port 1433 in use
To be honest, I can't say for sure why that process is listening on TCP 1433, or anything further. I'd take that information you have (you should remove that comment you just posted, and ensure that sensitive information is removed) and post a follow-up question on serverfault.com asking about the process and why it's using TCP 1433.
Mar
27
comment Displaying the list of all tables in all database
Beware of sp_MSforeachdb : sqlblog.com/blogs/aaron_bertrand/archive/2010/02/08/… by @AaronBertrand.
Mar
27
comment Can't find stored procedure for updating after creating it
Which RDBMS are you working with? SQL Server? MySQL? ??
Mar
25
comment Find which session is holding which temporary table
See my answer below. That query should give you the top current tempdb page allocation consumers.
Mar
25
comment Find which session is holding which temporary table
Why are you concerned about pulling information based on particular and specific temp tables? They are transient by nature. What exactly are you trying to find? Perhaps sessions that have consumed the most tempdb and their last run query? Maybe current tasks' consumption of tempdb? And, of course, the query text that goes along with those. Those are typical requirements. Or am I missing exactly what you're trying to get at?
Mar
20
comment AlwaysOn Availability Group Forced Failover
@TDPSQL_Newbie No problem! Always glad to help.