In this issue

Featured Articles

Editorial

Featured Script

 
 advertisement
 
SQL Toolbelt Free your mind for the really creative stuff.
How do some SQL professionals manage to get more stuff done than others?
"The functionality provided by the SQL Toolbelt is astounding." Mustafa Bashiti, Dutco Group. Download a free trial of the SQL Toolbelt and tick the SQL chores off your 'To do' list.
 
SQL Response V2 Survey Answer our survey for a chance to WIN 1 of 3 $100 Amazon vouchers
How important is database monitoring to you? Answer our survey to help shape tools of the future and have your chance to win 1 of 3 $100 Amazon vouchers! Take part now.

Featured Articles

Managing many SQL Servers?

Question. Can I submit my article as an upload? I have created it in MS Word with diagrams which would make it easier to submit. More »


Generating Random Results - SQL School Video

How can you randomly generate data? MVP Andy Warren shows how in this SQL School Video. More »


Extending the REVERT statement using the WITH COOKIE clause in SQL Server 2005

In a previous tip on Switching Execution Context using the REVERT clause, you have seen how to switch execution context to a more privileged user and revert back to the original context of the caller within a programmable object. The REVERT clause accepts a parameter WITH COOKIE to provide an even more granular option. How do we use it? More »


Obtaining Index Usage Information

This article shows how the sys.dm_db_index_usage_stats DMV can be used to tune your indexes, and maximize the performance of your database More »


Editorial - The Hassles of Travel

ConcordeI've commented before that I don't really like travel and it's hard to get me to go places. Those of you I've met might attest to that as well since I can be a bit cranky when I've been gone from home for too many days.

This week I'm in Cambridge, UK, not really because I want to, but because my group at Red Gate, the Simple Talk Publishing group, is having a summit where we can sit down and talk about changes and plans for the sites. We did this last year in Boulder because I didn't want to travel and likely we'll be somewhere in the US next year since I'm hoping to not cross the Atlantic again.

As I was getting ready for this trip, I stopped to think a bit about what I don't like and why it bothers me so much. After all, travel should be exciting, shouldn't it? I will admit that it's exciting to think about a trip, it still sounds like a good idea as I book a trip to TechEd, the PASS Summit, or even the UK. It's as I drive to the airport each time that I realize it was a bad idea.

For me I think it's being out of my routine,  and out of my element. As much as I'd like to be a daring adventurer, the truth is that I'm more of a homebody. I prefer being in my bed, in my house, where everything is familiar. I'm much more likely to do the same thing day after day, with very little variation. I don't think I'm boring, but I that I prefer what I know more often than I’m excited by some new adventure. And while I do try new things, I don't find them interesting enough to make it a regular activity.

I don't want to seem ungrateful because I am. I think I've been very lucky to be able to attend conferences and it's an honor to be asked to speak. I like the events, I just don't like the travel pieces.

I do like getting out of the house, visiting people in town, going snowboarding, even making it to conferences and other events.  It's always interesting and I meet some great people each time I go.

I just wish I could go home every night.

» Join the debate, and respond to today's editorial on the forums


The Voice of the DBA Podcasts

Everyday Jones

The podcast feeds are now available at sqlservercentral.mevio.com to get better bandwidth and maybe a little more exposure :). Comments are definitely appreciated and wanted, and you can get feeds from there.

Overall RSS Feed: or now on iTunes!

Today's podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. Support this great duo at www.everydayjones.com.

I really appreciate and value feedback on the podcasts. Let us know what you like, don't like, or even send in ideas for the show. If you'd like to comment, post something here. The boss will be sure to read it.

» To submit an article, rant or editorial, log in to the Contribution Center


Question of the Day

Today's Question:

In SQL Server 2008, what does the Replication Log Reader Agent do?

Think you know the answer? Click here, and find out if you are right.

This question is worth 2 points in this category: Transactional Replication. We keep track of your score to give you bragging rights against your peers.

We'd love to give you credit for your own question and answer. To submit a QOD, simply log in to Contribution Center.

Inside Microsoft SQL Server 2005: T-SQL Querying is the highly rated book by Itzik Ben-Gan, Lubor Kollar, and Dejan Sarka that brings all you need to know about T-SQL. Grab your copy today from Amazon!


Yesterday's Question of the Day

You create a database snapshot on the CRM database. The CRM mdf is located on the e: drive and the snapshot is located on the f: drive. If the snapshot uses up all available space on the f: drive, what should you do?

Answer: drop the snapshot and recreate it

Explanation: If the snapshot runs out of disk space, it becomes suspect and must be dropped.

Ref: Limitations on Database Snapshots - http://msdn.microsoft.com/en-us/library/ms189940.aspx

» Discuss this question and answer on the forums

Accelerated SQL Server 2008 - The expert tuition and approach to rapid learning in Accelerated SQL Server 2008, one of the first SQL Server 2008 books available, will enable SQL Server and other database professionals to make the leap to the latest release of Microsoft’s flagship database management system quickly. Take full advantage of the new features of SQL Server 2008, know what tools are available, and quickly realize the power and ease of use that SQL Server 2008 has to offer. Grab your copy today from Amazon!


Featured Script

Yet Another Deleting Duplicate Records (in-place)

Here is another "deleting duplicate records" script, this time in-place, using a uniqueidentifier column. More »


Database Pros Who Need Your Help!

Here's a few of the new posts today on the forums. To see more, visit the forums.

SQL Server 2005 : Administering

SQL mirroring. Both servers In Recovery - Hi , We have a pair of mirror servers. Windows server OS rebooted unexpectedly on one of the servers and databases...

Transaction logs - I need to start keeping data every 4 hours for transaction logs. DB is saet to full, how can I...

Proportional Fill and Tempdb - 1 Data File Per Processor - I believe I understand the reason why you can achieve tempdb performance benefits from creating one data file per CPU....

Reverse enineering a table - Hello all, we are currently looking for a way to automatically (e.g. based on a script) export the structure of a...

How to convert a SQLserver-2005 database into 0racle 10g - tell me the steps to convert SQL database table into ORACLE tables.

Oracle Linked server from sql server 2005 - Hi I've am trying to set up a linked server from sql server 2005 to an oracle server in order to...

Replication - actually i have a 7 client having different cities and a server act as a central database.means it have a 7...

SQL Server 2005 installation question - I am installing sql server 2005. Now, my question is how can I give different paths for my data files...

I/O requests taking more than 15 seconds - I've read through a lot of posts regarding this error message. Unfortunately, none of them seem to fit my situation. Here's...

Actual Sql Server Name - Hi Friends, how may i know the actual name of my sql server 2005. Please help me... Deepak Nigam

MSDB log file size is 17GB????? - Hi, In one of our sql server production instances, the MSDB log file size is 17GB. I have no idea why MSDB...

Buffer latch type 3Msdb Cannot backup\Cannot view history of Jobs - I recently inherited a server from one of our offices. Upon inspecting the server I discovered, that the msdb database...

Linked Server - Hello All, I have ODBC DSN. I created Linked server in SQLServer 2005. When I select 'script as select to' is...

Error: 7886, Severity: 20, State: 1. - Hi all, Last night my SQL box (2005 Std) reported the following error, this occured at just after 18:00 "Message A read operation...

Blocking Objects - If a process / spid is blocking, what is the best way to query what tables are being locked by name? When...

Disk Space - I trying to gain more space on my disks on different servers. I observed that there are many database files...

Transaction log backup failure in maintenance plan - Hi, I'm getting the below message when viewed in the job history of 'transaction log backup' maintenance plan. "The job failed....

Connection reset by peer - Hi Folks, I am using the Weblogic Server 10 and SQL Server 2005 for my application. I Tested the whole application...

SQL Server 2005 SP3 - SQL Server 2005 SP3 It just isn't available yet! I can already hear you saying "But it must be coming...

SQL Server 2005 : Backups

Trying restore a db to another instance stuck in restoring - Hi All, I am trying to restore a db to another instance on the same server. the problem is i keep getting...

How to copy and rename database - I want to copy a database to the same server and change the bame at the same time. How do i...

Backup and Diff Random Failures - Alright, I have looked and looked and not found anything on this so any help I can get would be...

Maintenance Cleanup Tasks / xp_delete_file slow & not working - Hi, I've got a bizarre issue with some of our maintenance plans which is driving me nuts - I can't figure it...

Restoring data from .SQB file - Can anyone tell me how to go about restoring data from a .SQB file? My friend is having some trouble...

How do I recover data from SQL Server's log files? - How do I recover data from SQL Server's log files? UPDATE foo1 SET relID = 5 After I hit F5, I realize:...

Transaction log backup failed message - we have a transaction log backup job runs every 30mins. it backs up 4 databases. once a while, we receive...

Back-up jobs taking forever to run - Hi, We are experiencing an issue with backup jobs taking an excessively long amount of time to run, and I was...

SQL Server 2005 : Business Intelligence

Custom rollups across multiple dimensions - Hi All, My first post on this web site and am really hoping somebody here can help. I am designing a financial...

Is it a good practice for fact tables to have a PK? - In a data warehouse, is it a good practice for fact tables to have a actually primary key added as...

Cannot Deploy SSAS database - I have been trying to use BIDS to build an SSAS database and cannot deploy the database if there is...

SQL Server 2005 : Development

How to convert a SQLserver-2005 database into 0racle 10g - plz tell me the steps to follow for converting SQL database(tables) to oracle(tables).

SQLCMD & Batch File - Hi, I am using SQLCMD in a batch file. I am unable to do the following thing I have to pass...

Join Query Where Problem - Hello, I am new here and I am not very experienced with more complex sql queries, so I hope someone will...

Dynamic WHERE clause in a stored procedure - Hello All - I'm having trouble figuring out the best way to handle a dynamic WHERE clause in a stored procedure....

Production DB Inserts with No Blocking - Hello, We have a 24x7 Production database running on SQL Server. And every alternate day there are customer tokens that need...

Where 1 = 1 - Hi All, I come accross some queries where the "where" clause is as follows: "WHERE 1 = 1" Now these are not dynamic...

select multiple identity values after insert? - for example, if i insert a batch of say five rows in table IdentTest (UserID int identity(1,1), UserName varchar(10)), i'd...

Should i change table design to improve performance - Hello Im working on a call centre application. Primarily there are 2 main tables, customer and calls. The customer table holds...

SQL Server 2005 : Working with Oracle

What is 'i' in Oracle 9i - Hi, I want to know what is 'i' stand for in Oracle 9i......

SQL Server 2005 : SQL Server 2005 Compact Edition

How do I shrink a SQL Server 2005 Compact Edition Transaction Log (ldf)? - I have an application (ServiceCEO) that bundles SQL Server 2005 Compact Edition. The sql data (mdf) currently uses about 600MB...

SQL Server 2005 : SQL Server 2005 General Discussion

what type of lock is acquired when inserting data in a table in SQL server ? - When I Insert data in a table in SQL server, what type of lock is acquired ? Is it Table level...

Locking - Hi, I'm using SQL Server 2005 Standard Edition. When I open my database and tyr to expand the tables sections on...

SQL 2005 / Sharepoint Database Corruption - Hi Everyone, I am looking at my event logs and found this one that is of particular interest to me. BackupIoRequest::WaitForIoCompletion:...

tables data changes question - I have 6 tables tbl1,tbl2-6 I need to write a program to determine if any changes were made to these tables. Option...

INSERT TRIGGER - "ApprovedBy" is a field in my table. When this field is not empty or null during an insert, I want...

From enterprise to standard edition - what will we lose? - I know on the face of it the answer may appear to be no, this is not a safe move!...

SQL Server 2005 : SQL Server 2005 Security

Hello and I need help to create a user - Hello :) I am admin on a SQL server. To be honest I don't know much about that role, but I...

SQL Server 2005 : SS2K5 Replication

Synchronizing database of offline application with asp.net website - I have an asp.net website hosted on a shared hosting server. There is an offline version of the same website...

XML parsing: line 1, character 38, unable to switch the encoding - I have a merge replication set up with 100s of subscribers sending data to a publisher (only one way, think...

SQL Server 2005 : SQL Server 2005 Performance Tuning

Problems of performance in SQL Server 2000 - I am new as DBA, I need to know which are the best practices for SQL Server 2000, what can...

SQL Server 2005 : SQL Server 2005 Integration Services

DTSX packages - have to hard code login information ? - I am new to SSIS DTSX package. [u]Question 1[/u] I have developed some DTSX packages in my company. But when I deliver...

IP address of Server that runs SSIS - Hi, I will try to be as clear as possible.. with as much as i know. We have a clustered SQL Server...

Scheduling DTS package in SQL Server 2005 - Hi, I have sql server 2005 on which in legacy folder there are DTS packages which are transfered from SQL...

Calliing Web Service in Script Component - I am trying to calling a web service in using script component but getting Error 30002: Type 'Microsoft.Vsa.VsaModule' is not...

Using winrar to extract zipped files through the command line - I have an SSIS package that is going to be extracting zipped files, so my question is does anyone know...

Convert date into several fields correctly - Hi guys, i need your suggestions about converting a date field. The source is csv flat where ssis loads the date...

What's best way to assign permissions needed for SSIS package - I am setting up many IS packages to load data from flat files to tables. I have connection managers set...

Using Type cast in Conditional Split - Hi, any one knows how to use Type Cast in Conditional Split? Basically I have a column called Property and...

SQL Server 2005 : T-SQL (SS2K5)

WITH(INDEX(ind1)) syntax, how do i join indexes? - Im using the WITH(INDEX(indexName)) syntax to help me reproduce execution plans purposfully, so as to use them as a base...

Query between Servers - Hi all, I currently have 2 Dbs; lets call them DBLive and DBReport running on the same server. I have a stored...

Calling a UDF from a check constraint - Hello, I am creating a UDF to enforce a business rule: CREATE FUNCTION [dbo].[UDF_IsValidEntryDate] (@Record_Id Int, @Entry_Date SmallDateTime) RETURNS Bit AS BEGIN DECLARE @btValidEntry As Bit SELECT @btValidEntry...

Detach a remote database from a server - I am in an urgent need of some help I have a database named timetable on server1(domain 1) and have the...

How to list all table's collation? - Hello all! How can I list all the table's collation in one Database? Some of the columns in the tables have a...

Assigning value to scalar variable from select statement - How do I set the value of a variable in a function to a scalar value extracted from a table? For...

SQL QUERY HELP - ALTER PROC prodTool.CalculateTaxablePrice --@productId int, --@taxablePrice decimal = 0 AS --IF(EXISTS(Select PackageID FROM ProductPackage WHERE PackageID =41806)) --BEGIN DECLARE @sumPhysical int DECLARE @sumAllProducts int WITH ProductTaxable(ProductOption, DeliveryType,...

I think the Max Function is what I need - I have a query SELECT A.SOLD_TO_CUST_ID, C.NAME1, DATEDIFF(DAY, (CONVERT(CHAR(10),B.STATUS_DT,121)),GETDATE()), A.PYMNT_TERMS_CD, A.ORDER_NO,C.SETID,C.CUST_ID FROM PS_ORD_HEADER A, PS_ORD_HOLD_AUDIT B, PS_CUSTOMER C WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT ...

Input Variables - Hi, I'm trying to figure out how to "conditionally" require a couple of input parameters. Based on the @timeframe the user...

I want to get Distinct Values From Table - Hi All, My Query returns onecolumn consider, Column1 -------- Value1, Value2 Value1, Value3 Value1, Value2 Value4, Value5 [b]my requirement is to get all the distinct values in the column1[/b] Column1 --------- Value1 Value2 Value3 Value4 Value5 is...

How to go to the next item in a while loop on hitting an error? - I have some code (included at bottom) which basically does the following: for all dbs in SQLSvr installation if database != system/demo...

Inserting a value in an ordered string - I am looking for a way to insert a value into a string while preserving the order of the string....

SQL Server 2005 : SQL Server Newbies

Installing SQL Server 2005 Management Studio on a client - Our Infrastructure/Development team have run off and installed SQL Server 2005 on several servers each with its own database. I...

Importing .xls into SQL table using BCP - Hi All, I have output wmi data into a .xls spreadsheet successfully using a powershell script. I now want to import...

SELECT dependant on data in fields - I think this is a real Newbie question but I'm uncertain where to start. I have listed below a CREATE...

while ((select * from x ) is not null) - Hi I have to do a loop like while ((select * from x ) is not null) and then delete the first row I...

Automatic Restore of database - We are using MS Sql 2005 SP2. Have a need to backup 9 databases (full recovery) and be able to...

SQL Server 7,2000 : Administration

Mass Chaning DTS Password - Dear all, I am ask by the management to change all password in our system regularly, this includes DTS password, Do...

Need some help...changed domain and now SQL is buggered up. - We have a domain that is getting out dated and isn't necessary. So our plan was to migrate the system...

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. - Hello! We have old sql-server 2000 and 4 IIS servers. Those 4 are on 2 load balancing cluster hosting IIS6 web...

clustered index hell - I have to support a large (100 gig+) database with about 230 users. It is 3rd party. They have almost...

SQL Server 7,2000 : General

Inserting Data dynamically - Hello, I wanted to know is there any way to get column names dynamically while insertnig data to a table while...

Selecting from temp table outside SP? - Hi I have a SP that has been running for 408 hours, computing Citrix statistics. The SP writes to a temporary...

SQL Server 7,2000 : Security

SQL impact when dropping Windows users that created dbs, SSIS... - Not sure if I understand the security implications of dropping a Windows user on a SQL server running in mixed...

SQL Server 7,2000 : T-SQL

Select from String - I need to select only a part of a text string.... I have the following 3 rows... Provider PraNum="3802078" Funder DisplayName="Health" MemMAPlan="41807"...

sql for Login and logout details of sql logins in mssql2000 - Hi, Can any body help me? I need a Tsql which gives the details of Login and Logout of MSSQL2000 users...

Tsql for Login and logout details of sql logins in mssql2000 - Hi, Can any bodyhelp me? I need a Tsql which gives the details of Login and Logout of MSSQL2000 users other...

Tricky T-SQL - Hi!, I hoped someone can help me regarding this problem in T-SQL. I doing this since yesterday and later they need...

cross tab - [code] IF OBJECT_ID('TempDB..#tblInv','U') IS NOT NULL DROP TABLE #tblInv CREATE TABLE #tblInv ( ID INT , PartNo VARCHAR(10) NOT NULL, TranType VARCHAR(7) NOT NULL, Quantity INT NOT NULL ) insert...

I need a Script for scripting out all dts but in .BAS - I need a Script to script out all dts but in .BAS who can help me?? thank you............

SQL Server 2008 (Katmai) : SQL Server 2008 - General

Cost - SQL Server Enterprise Edition 2008 - Hi friends, we are already having SQL server 2005 enterprise edition. How much do we need to spent to upgrade enterprise...

Need some help here...SQL Server Ad-Hoc Access ... - Well, So far I cannot seem to find a way to get SQL Server to see anything besides it's own little...

Basic setup question - Hello! Is it possible to do 2-node active/active sql-2008 cluster with SQL-server strandards (with enteprice windows server)? How it is differend from...

Upgrade SSAS from 2005 to 2008 - I'd like to upgrade my databases from SSAS 2005 to SSAS 2008 to take advantage of all the new features...

How to get start and end value from a sequence of numbers - Grouped by a different field. - Hi All, I have a requirement to obtain the start value and end value of a sequence based on a particular...

SQL Server 2008 (Katmai) : T-SQL (SS2K8)

What is the equivalent of Lead / Lag (Oracle Analytics) in SQL Server 2008 - Hi, Could any one point me to which functionality of SQL Server 2008, does Lead / Lag of Oracle Analytics map to...

SQL Server 2008 (Katmai) : SQL Server Newbies

Formulas and Formats - Hi, I am a newbie to this enviroment and I just wondering if any one could guide me to a reference...

Career : Employers and Employees

Help getting started - I like database work. I have been playing around with access and sql server. I can kind of fumble my...

Programming : Connecting

Connecting MS Access to a SQL 2005 Express - I have connected my Access ADP to a SQL 2005 Express receding in a ordinary desktop PC in the same...

SQLServerCentral.com : Anything that is NOT about SQL!

Are the posted questions getting worse? - Is it me, or are the posted questions getting worse these days? I just read a post by someone apparently in...

Reporting Services : Report Development

How to suppress labels of a category group in a chart - I want to display a bar chart with to category groups on the X-axis. The parent category group A has...

Data Warehousing : Data Transformation Services (DTS)

sending failure notfi after Transormation task failure - Hey guys, I have DTS task which need to send a failure email notification of the data tranformation task between text...