23,868 reputation
33982
bio website blogs.msdn.com/b/sql_pfe_blog
location In the Ocean somewhere...
age
visits member for 3 years, 2 months
seen 2 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.


2d
comment SQL Query to export
What language are you using to construct this query? C#? Also, what is the context of data retrieval and parameter setting?
2d
comment SQL Query to export
I answered prior to confirming the RDBMS. Which are you using? SQL Server? Oracle? MySQL?
Sep
16
comment How to add an “INCLUDE” part in an Index Created as a part of CONSTRAINT
I think the OP is asking more about how to get INCLUDE columns when defining a constraint.
Sep
15
comment Connection to SQL Server failed. A network-related or instance-specific error occurred while establishing a connection to SQL Server
You can't connect because you service isn't started. You need to troubleshoot why the service won't start. Start with the Windows event logs.
Sep
15
comment Disk Crashed, NDF(Index) file lost
Yes, do you file/filegroup restore using the full backup with NORECOVERY, and then restore your log backups sequentially, with the last one specifying RECOVERY. The link I posted in my answer shows how all of that can be accomplished.
Sep
9
comment CHECKPOINT or COMMIT writes to disk?
+1 this is the right/best answer.
Sep
4
comment SQL Server 2008 logging
Can you define what you mean by "logging"? You mean the SQL Server database's transaction log?
Sep
4
comment Find if Column Belongs to User Table
@AaronBertrand Excellent article, and I've made those changes. Great read and I'll definitely refine my ways as well! Thanks!
Sep
3
comment Database Migration - Create New Filegroup and Move Objects
I'm not sure I understand why you would need to create a new filegroup to move the data. What is wrong with the traditional and simple backup on source server, and restore on destination server?
Aug
22
comment Does sp_indexoption cause index rebuilds?
@Junto Glad to help :-) And yes for some of the more "robust" references they can be quite daunting with all of the syntax and information.
Aug
22
comment Finding rows with duplicate values
Sample data for both tables and desired outcome would be really helpful with this question.
Aug
21
comment How to pull rows only from the weekends?
Your WHERE clause using GETDATE() won't give the desired behavior. That'll test for the current datetime, whether it is Saturday/Sunday. You'd have to specify the Date column there to get the OP's end results.
Aug
21
comment How to pull rows only from the weekends?
Great point, Aaron!! I'll add that to the answer.
Aug
20
comment Stored Procedure null parameter within where clause
Don't do @param = null. You need to do @param is null. Nothing can be "equal" to NULL.
Aug
18
comment Failover Cluster Diagnostic Logs
How are you opening it? Maybe you aren't getting the file(s) you think you are. Use sys.fn_xe_file_target_read_file() to be explicit: msdn.microsoft.com/en-us/library/cc280743.aspx
Aug
18
comment Failover Cluster Diagnostic Logs
No problem, glad to help!
Aug
13
comment Why does transaction log continue to grow in Simple recovery mode with nightly backups
@DerekCate "I don't think we're doing anything that would require 300MB of log"... You'd be surprised, it doesn't take much to bind up the reuse of the transaction log. Don't think of it in terms of quantity of workload, as that's not always the cause.
Jul
28
comment Fixing an error 9004 without taking the database offline
What is the state of the error? Do you have proper backups? Documents that should be read before continuing: support.microsoft.com/kb/2015753 blogs.msdn.com/b/sqlserverstorageengine/archive/2006/06/15/…
Jul
9
comment Transfer all tables from a schema to other schema
I edited my answer to show code to generate the ALTER statements.
Jul
9
comment Looking for a utility to move data between databases (prod to dev) SQL Server 2012
SSIS would still get my vote. You could always write your own script (with PowerShell, for example) but that's more work than necessary. That's a very simple task with SSIS.