SQL Server, T-SQL, Development, DBA and Career Resources

Human Created Content by Industry Experts for Developers, DBAs and Analytics Professionals

Simple way to export SQL Server data to Text Files

Since the transition from DTS to SSIS, I have found myself looking for alternative ways to do simple tasks such as exporting data from SQL Server into text files. SSIS is a far more powerful tool than DTS, but I generally try to stay away from it for simp

Are Your SQL Server Application Queries Wasting Memory

I am running an application that issues queries directly to the database from within its source code. I have noticed that the database server will get low on available memory and that CPU activity is higher than I would like. What could be the problem?

Connecting to SQL Server with a Bad Logon Trigger

In a previous tip, SQL Server 2005 SysAdmin Login Auditing, I wrote about how to use a LOGON trigger to capture all logon activity. One of the things you need to aware of is that if you create a logon trigger and there is some bad code you are going to p

How to use a SQL Server Plan Guide to Tune Queries

My company uses a vendor purchased application to process orders. Lately, one of the vendor application queries has been running very slowly and is starting to cause problems. My testing has determined that the SQL statement can benefit from a query hint.

SQL Server User Defined Data Types, Rules and Defaults

SQL Server provides numerous system data types to store dates, character based data, numeric data, etc. However there are some situations when a customized data type is needed for consistency across an application. Some examples could be phone numbers in

SQL Server 2005 SysAdmin Login Auditing

I want to audit whenever a member of the sysadmin role logs on to my SQL Server. Auditing all successful logins provides that information, however, it logs every connection. The sysadmin logins are being lost amidst all the noise. How can I just track the

An alternative to SQL Server email alerts

In a tip on How to setup SQL Server alerts and email operator notifications, you have seen how you can configure email alert notifications in your SQL Server instance. There are cases where we cannot use SQL Server alerts like in a SQL Server 2005 Express

Generate SQL Agent Job Schedule Report

I am trying to come up with a list of Job Schedules, so I can make sure that my Jobs are staggered. Is there a way to query the system tables so I do not have to manually keep track of the schedules?

How to setup and use a SQL Server alias

I have an application that has a specified database connection that I either can't or don't want to change. However, I need to move the database to a new server. How can I do this easily without breaking other things that maybe using this connection and/o

Using the FORFILES Command to Delete SQL Server Backups

Recently I constructed a new backup process that I want to institute globally across all my SQL Server 2005 instances. This backup process will not only backup all the databases I point it towards, but at the same time will script out the backup commands

Creating Your Own SQL Server System Stored Procedures

Microsoft provides a good set of basic queries into their system tables. However, some of these procedures lack some additional information that I am interested in and I find myself constantly issuing queries to get this additional data. Is there a way I

SQL Server Schema Binding and Indexed Views

Recently while creating an archival job I noticed that job was taking way too long to complete. To help troubleshoot I executed the stored procedure directly and it was also taking a long time to fetch the rows from the view that I was using. Based on t