In this issue

Featured Contents

Editorial

Featured Script

 
 advertisement
 
SQL Monitor Custom metrics from SQL Server MVPs
SQL Monitor is the only tool with a free library of custom metrics from SQL Server MVPs. Find new metrics for your servers.
 
SQL Compare Compare and sync databases with SQL Compare
“SQL Compare is fast, extremely easy to use, full-featured and affordable. I wouldn't bother messing around with anything else.” Adam Machanic, SQL Server MVP. Download a 14-day free trial.
 
SQL Backup New! Safeguard your SQL backups
Protect your backups from onsite disaster with SQL Backup Pro and a Hosted Storage account from Red Gate. Learn more.

In This Issue

An Introduction to the SQLCMD Mode in SSMS (SQL Spackle)

Using SQLCMD Mode in SSMS is easy. This short piece will show you how to get started. More »


Introduction to SQL Server Filtered Indexes

SQL Server filtered indexes can save space and improve performance if they are used properly. Under what circumstances can they be used? When are they most effective, and what sort of performance gain or space-saving is likely? How does a filtered index affect the choice of execution plan? Seth Delconte explores these questions with practical experiments. More »


From the SQLServerCentral Blogs - Five Ways to Improve Your Productivity with SSMS

For most DBAs, Management Studio is the primary work tool. That’s why properly using it can save a-lot of time and... More »


Editorial - Microsoft Research

I've always thought that the idea of investing in research products was a good one in many industries. Some of the companies that were very successful across the last hundred years were those that invested in learning about the technologies and processes in their industries. From these ideas and inventions, engineers have built the products that companies sell and which enrich our lives. Government and academia have also helped fuel the advance of technology in America, but it takes business interests to provide the practical implementations of innovations that can be bought and sold.

There are people that think corporations like Microsoft and Google should focus on their core businesses and maximize their profits. However I think the investments that these companies make in various research areas allow them to learn about new opportunities that may become products at some point. It can be hard to determine if a technology area is viable for products, and the targeted research these companies engage in can help them improve existing products, or invent new ones.

I think that having research areas enables diverse opportunities that may help attract, or retain, some extremely talented employees. I know I'd love the chance to take a sabbatical for a year and work on a research project of some sort. The top talent at many large companies may want to work in a theoretical area for a period of time, and companies may find very talented academics that might want to try working on more practical endeavors.

I was watching this keynote from Microsoft Research and it was amazing to me how much of an effort Microsoft is putting into their research. They claim they are the number one organization doing basic research in computer science. They publish more research, and funding more graduates student hours of work than any other single institution. Considering how large some universities are, this quite a commitment to research. It's one that I hope they continue in the years to come.

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


The Voice of the DBA Podcasts

We publish three versions of the podcast each day for you to enjoy.

Everyday Jones

The podcast feeds are available at sqlservercentral.mevio.com. 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.

You can also follow Steve Jones on Twitter:

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


Question of the Day

Today's Question:

In the batch 

-- statement #1
create table #QotD1 (Id int, timestamp timestamp)

-- statement #2
insert into #QotD1 (Id)

select top 10 id from sys.sysobjects

-- statement #3
select id, timestamp into #QotD2 from #QotD1 

-- statement #4
select * 
 from #QotD1 q1 
  join #QotD2 q2 on q1.timestamp = q2.timestamp

-- statement #5
delete #QotD2
 
-- statement #6
insert into #QotD2 (Id, timestamp)

select id, timestamp from #QotD1 

-- statement #7
select * 
 from #QotD1 q1 
  join #QotD2 q2 on q1.timestamp = q2.timestamp

-- statements #8
drop table #QotD1
drop table #QotD2
Which of the following is true (select 8):

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

This question is worth 4 points in this category: T-SQL. 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.

SQL Backup and Restore

A DBA's tasks, from day-to-day, are rarely constant; with one exception: the need to ensure each and every day that any database in their charge can be restored and recovered, in the event of error of disaster. In this book, you'll discover how to perform each of these backup and restore operations using SQL Server Management Studio (SSMS), basic T-SQL scripts and Red Gate's SQL Backup tool.

Get it from Amazon in print  or download the ebook for free from Red Gate


Yesterday's Question of the Day

Below is a table which has one column with identity property. How do I insert values in this table without changing the identity property of the column?

CREATE TABLE TableA(ID INT IDENTITY (1,1))

Answer: INSERT INTO TableA DEFAULT VALUES

Explanation: The correct answer is INSERT INTO TableA DEFAULT VALUES

Ref: technet.microsoft.com/en-us/library/ms174335.aspx

» Discuss this question and answer on the forums

Microsoft® SQL Server® 2012 Step by Step

Teach yourself the programming fundamentals of SQL Server 2012—one step at a time. Ideal for beginning SQL Server database administrators and developers, this tutorial provides clear guidance and practical, learn-by-doing exercises for building database solutions that solve real-world business problems.

Get your copy from Amazon today.


Featured Script

Shrink DB and Log

Used this and shrunk a 176GB in under 20 secs to 105 MB 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

Login failed for user - Microsoft SQL Server, Error: 4064 - Hello, When I click on properties of a database, users, tables, or any object within SQL Server Management Studio, I get...

SQL Server 2005 : Backups

Operating system error 23 in SQL - I scheduled daily backup on tape and it was working fine for two weeks.Last night the backup failed and threw...

SQL Server 2005 : CLR Integration and Programming.

Problem with SQLCLR in VS 2012 / Net 4.5 - Hello guys, I have problem that I can't resolve .. I want to make simple store procedure using .net 4.5 and [b]I...

SQL Server 2005 : SQL Server 2005 General Discussion

sql service broker - Hi Need help on getting code and info on service broker (for sql server 2005 only) for auditing DML commands. Respond if any. Thanks

SQL Server 2008 : SQL Server 2008 - General

Sorting Records Going Into New Table. - I am having problems ordering records to go into another table. The following is my code: [code] USE EURUSD GO SELECT * INTO NEWTABLE FROM OLDTABLE ORDER BY...

Post Transaction Log Full - I had a development database set to 'simple' recovery model which ran into a full transaction log error while executing...

What happens if SSMS is force-closed by an RDP logoff while adding a column? - So I was tasked with adding an Identity column to a very large table this weekend. Yesterday it failed because...

Speed issue with SQL Server 2008 compared to SQL 2000 - We have built a new virtual server with Hyper-V and 64bit windows 2008R2 with 3 processors and 12 GB of...

SQL FOREIGN KEY conflict help! - I have two tables and I keep getting an FK conflict error on some of the data being inserted and...

Archiving - Hi I want to archive the data of a 400G table,what is the best way of archiving? My table has a clustered...

sql server query problem - hi friends i have small doubt in sql server plz tell me how to solve i have 2 tables and...

SSMS Stored procedure help - Hi professionals. We have software written by a 3rd party vendor and I am trying to read one of there stored...

SQL Server 2008R2 'Web Edition' License Query - Hi All I have what seemingly is a pretty basic query however dont seem to beable to get a definative answer...

SQL Server 2008 : T-SQL (SS2K8)

Multiple reference to a single column - I have created 3 table in which in T3 table I am referencing the ID columns of table T1 and...

Possible to use tored proc to kill all queries running longer than 2 hours AND are blocking other queries - Is it possible to use a stored procedure to kill all queries running longer than 2 hours AND are blocking?...

How to create a frequency report - Hi, I have two tables containing test results in categorical scale. Table one contains PCR results for some factors (P1, P2,...

How to sum in SQL removing varchar - Hi All, I am trying to sum of amount (data type varchar) column but I am getting error error converting data...

How to do this type of insert? - I'm sorry if this question has been asked here, but I couldn't find. I am new to sql and need...

convert a PLSQL to T_SQL for a function - I would like to convert a function from PL-SQL to T_SQL, not sure about the syntax, Any one can help?, code...

COLLATION Between two databases, checking on which collate to use - DATABASE A SQL_Latin1_General_CP850_BIN DATABASE B SQL_Latin1_General_CP1_CI_AS TEMPDB SQL_Latin1_General_CP1_CI_AS UPDATE DATABASEA.TABLE1 SET XXDT = A.COMPLT_DT -1 FROM DATABASEB.TABLE2 A INNER JOIN DATABASEA.TABLE1 B ON A.ID = B.ID COLLATE Latin1_General_CI_AS WHERE A.ID...

SQL Server 2008 : SQL Server Newbies

Backup and recovery for the accidental DBA - Hello - I am not a DBA, let's start with that...but I have acquired the task of backup up a db...

SQL Server 2008 : Security (SS2K8)

How to prevent ANY use of xp_CmdShell? - Please forget whether or not you're pro or con on the subject of the use of xp_CmdShell for just a...

SQL Server 2008 : SQL Server 2008 Administration

Rebuild Indexes - Hello Everyone I am rebuilding the indexes on a database every week. I am getting complaints that the database is being...

High CPU Issue - Hi, We have a high CPU issue, it's almost 80 - 90% and sometimes close to 100%. I will be trying to Rebuild...

The database principal owns objects in the database and cannot be dropped - Hi guys, Recently we got this error: The database principal owns objects in the database and cannot be dropped. The database version...

Career : Certification

2005 to 2012 certification upgrade? - Hi All, back in 2009 I did the SQL Server 2005 Database Developer MCITP certification, but never got around to upgrading...

Programming : Connecting

New tO SQL - Need help to Install SQL + BI - I need to install sql 2008 with BI tools.Apprently the one I have was not connecting to adventureworks and so...

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...

Data Warehousing : Data Transformation Services (DTS)

DTS Run and non-English Charecters - I import data from Progress to SQLSERVER 2000 with DTS run utility (or DTS package which is same). When I...

DTS Run and non English Charecters - I import data from Progress to SQLSERVER 2000 with DTS packages.