Friday, March 30, 2007

SQL Server 2005 Books Online Scoped Search Provided By search.live.com

Check out the new Books On Line search provided by live.com. The link below provides a scoped search of Books Online. It will only return entries for the online version of Books On Line.

http://search.live.com/macros/sql_server_user_education/booksonline

Thursday, March 29, 2007

TEMPDB and SQL Server 2005 Tip

When upgrading to SQL server 2005 you already know that you have to rebuild your indexes and update the statistics. In addition to that, create 1 data file per CPU core for the TEMPDB (Dual core counts as 2 CPUs; logical procs (hyperthreading) do not)
This will make a big difference, SQL Server 2005 uses the tempdb different than 2000, by adding more files you will see a dramatic performance improvement for big queries

Our queries on SQL Server 2005 ran slower than on 2000, by adding more files the queries are twice as fast than on the SQL Server 2000 box now

This behaviour is documented here: http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/storage-top-10.mspx

Look at number 7 (Consider configuration of TEMPDB database)
and number 8 (Lining up the number of data files with CPU’s has scalability advantages for allocation intensive workloads. )

Wednesday, March 28, 2007

A list of SQL Server 2005 Whitepapers and SQL Server 2000 Whitepapers

Kimberly Tripp compiled a nice list of all the top whitepapers available for SQL Server 2000 and SQL server 2005. Some of them are written by Bob Beauchemin and some of them are written by Kimberly herself. The number of available whitepapers for SQL server 2005 is 29 at this moment.

Get them all here: http://www.sqlskills.com/whitepapers.asp

Sunday, March 25, 2007

How Not To Do Search Engine Optimization

Just ask Alex Chiu. This is what he wrote:

" Google controls 50% of the world's searches. This famous website is so controversial that it has been banned by the most popular search engine in the world 'Google'. That's right. You cannot find alexchiu.com in Google system. Some very important people don't want you to know about Alex Chiu. Alex Chiu is on more than 30 TV interviews, 250 radio interviews, and in business ever since 1996. Yet AlexChiu.com cannot show up on Google? "

Why is that? Very simple, take a look at his site http://alexchiu.com/
At the bottom of the page you will find a text area with over a thousand keywords, some of these keywords are:
System Heart Aorta Arteries Arterioles Capillaries Venules Veins Vena cava Pulmonaryarteries Lungs veins Blood Digestive Mouth Pharynx Esophagus Stomach Pancreas Gallbladder

This list goes on and on.

End result? Banned by Google.

Saturday, March 24, 2007

SQL Server 2005 SP2 Has Added The OBJECT_SCHEMA_NAME Function, OBJECT_NAME Has Been Enhanced

SQL Server 2005 SP2 has an important enhancement to the OBJECT_NAME metadata function and a new OBJECT_SCHEMA_NAME metadata function. Because you pass object_id, and database_id to the OBJECT_NAME function it is not needed anymore to write dynamic SQL to get multi DB results.

The OBJECT_SCHEMA_NAME metadata function can be used to return the schema name of a schema-scoped object like a table or a view by specifying the object identifier and optional database identifier.

Read more about these 2 functions here, there is also SQL code available that show you how to use the functions on the site.

30 + Tools and Hacks for Gmail

This makeuseof site has some cool Gmail hacks and tools. There are FireFox Extensions, GreaseMonkey scripts,Desktop APPS & Web TOOLS and plain old tips and hacks. The ones that I like the best are Gmail attachment icons and label colors. below is an image of all these things in action

Link: http://www.makeuseof.com/tag/gmail-craze-30-tools-to-make-your-gmail-better/

Thursday, March 22, 2007

Microsoft SQL Server Samples and Community Projects On CodePlex

Codeplex is the project hosting site for Microsoft SQL Server Samples and Community Projects. This portal page for SQL Server on Codeplex catalogs samples included with Product Releases, samples from the community, and independent SQL Server Community projects.

Link: http://www.codeplex.com/SqlServerSamples

Make sure you check out the DBScript Utility

The Ten Most Asked SQL Server Related Programming Questions In Newsgroups

I have been participating in newsgroups/forums for about five years now and lately I have noticed that at least 60% of the questions are the same ten questions.
That is why I will create a blogpost that lists these ten questions and also provides an answer for them. I think that to write this will take me about a week.

Here is what I have so far

1 selecting only current day/yesterday from a table
2 adding days/weeks/years/months to dates
3 splitting string values
4 select * from one table that doesn't exist in another table
5 getting all rows from one table and only the latest from the child table
6 getting all characters until some character (charindex + left)
7 NULL stuff ( a bunch of stuff here dealing with nulls)
8 Row values to column (PIVOT)
9 Show 0001 as 1 and show 1 as 0001
10 CASE and checking for NULLs

I guess I could have added date display formatting. Did I miss any other obvious questions?

Wednesday, March 21, 2007

SQL Server Speaks Almost As Many Languages As I Do

Saw this error while running a job

Error Code: 4860
Cannot bulk load. The file "%ls" does not exist.
Massenladen ist nicht möglich. Die Datei "%1!" ist nicht vorhanden.
Chargement en bloc impossible. Le fichier "%1!" n'existe pas.
???????????????? "%1!" ???????? No se puede realizar la carga masiva......


This is the first time that I have seen a multi-language error. It appears that SQL Server 2005 is a multi-language 'speaker'.
So we have 4 languages in this error

English
Cannot bulk load. The file "%ls" does not exist.

German
Massenladen ist nicht möglich. Die Datei "%1!" ist nicht vorhanden.

French
Chargement en bloc impossible. Le fichier "%1!" n'existe pas.

Spanish
???????????????? "%1!" ???????? No se puede realizar la carga masiva (don't know what the deal is with those question marks, probabaly a missing font)


So I speak 2 of these languages and 2.5 other languages and also a dialect. But I can curse in many more ;-)

Tuesday, March 20, 2007

Microsoft Joins OpenAjax

OpenAjax Alliance, an open industry collaboration dedicated to developing and expanding Ajax, today announced that its membership has grown to 72 with the addition of Microsoft Corporation and 30 other companies.

"Microsoft is joining the OpenAJAX Alliance to collaborate with other industry leaders to help evolve AJAX-style development by ensuring a high degree of interoperability," said Keith Smith, group product manager of the Core Web Platform & Tools to UX Web/Client Platform & Tools team at Microsoft Corp. "By joining OpenAJAX, Microsoft is continuing its commitment to empower Web developers with technology that works cross-browser and cross-platform."

The newest OpenAjax Alliance members include: 24SevenOffice, ActiveGrid, ActiveState, Appeon, Aptana, Arimaan Global Consulting, Custom Credit Systems (Thinwire), ESRI, Getahead (DWR), Global Computer Enterprises, GoETC, Helmi Technologies, HR-XML, iPolipo, Isomorphic Software, JSSL, Lightstreamer, Microsoft, MobileAware, NetScript Technologies, OpenSpot, OpenSymphony (OpenQA), OpSource, OS3.IT, Redmonk, Tealeaf Technology, Teleca Mobile, Transmend, Visible Measures, Visual WebGui and Volantis Systems.

The Alliance is also announcing that the following members have all been awarded OpenAjax Interoperability certificates: Apache XAP, Dojo Foundation, ICEsoft, ILOG, Isomorphic, IT Mill, Lightstreamer, Open Link, Open Spot, Nexaweb, Software AG and TIBCO. The interoperability certificates represent progress by both OpenAjax Alliance and its members towards defining and achieving industry support for OpenAjax Conformance.

Read the press release here: http://www.marketwire.com/mw/release_html_b1?release_id=228535

Perfect SQL Developer Setup



Got this pic in the mail today. I have been working with a dual-monitor setup since 2001 but this is unquestionably better. Here is how I would use it.

Monitor1: Outlook, Word and Excel
Monitor2: Production SQL Servers
Monitor3: Staging and Development SQL Servers
Monitor4: Visual Studio, EditPlus, XML Spy, Sybase Power Designer, Visio, SQL Compare etc etc

You see, all work and no fun (makes Jack a dull boy)
Very SQLicious don’t you think? How would you use it?

Saturday, March 17, 2007

St. Patrick's Day Joke: Irish Daughter

An Irish daughter had not been home for over 5 years. Upon her return her father cussed her. "Where have ye been all this time? Why did ye not write to us, not even a line? Why didn't ye call? Can ye not understand what ye put yer old mum thru?

The girl, crying, replied, "Sniff, sniff... dad... I became a prostitute..."

Ye what!!? Out of here, ye shameless harlot! Sinner! You're a disgrace to this family."

OK, dad-- as ye wish. I just came back to give mum this luxurious fur coat, title deed to a ten bedroom mansion plus a savings certificate for $5 million. For me little brother, this gold Rolex and for ye daddy, the sparkling new Mercedes limited edition convertible that's parked outside plus a membership to the country club....(takes a breath). ... and an invitation for ye all to spend New Years Eve on board my new yacht in the Riviera, and..."

Now what was it ye said ye had become?" says dad.

Girl, crying again, "Sniff, sniff.... a prostitute dad! Sniff, sniff."

Oh! Be Jesus! Ye scared me half to death, girl! I thought ye said a Protestant'. Come here and give yer old man a hug!"

Google Buys Gapminder




If you work with data and are trying to visualize this data then you will appreciate Google's latest purchase Gapminder. Gapminder and Google share an enthusiasm for technology that makes data easily accessible and understandable to the world. Gapminder’s Trendalyzer software unveils the beauty of statistics by converting boring numbers into enjoyable interactive animations. I found Human Development Trends, 2005 the more interesting application (two screenshots are at the bottom of this post). This application shows you visually that the number of poorest people continues to increase while the richer are getting richer among other things. There is also another application available: Gapminder World, 2006. You can see a screenshot of that app at the top of this post. Click on the images to see a bigger image or better yet visit the URL to see these apps in action. Also make sure to visit http://www.gapminder.org/links/data/. this URL contains links to the following sites:

GeoHive - the World in Regions
Nationmaster
OECD Data
Social Watch
Statistics Sweden (Satistiska Centralbyrån)
Sustainable World
The World Factbook
United Nations Common Database (UNSCB)
UNESCO Institute for Statistics
World Bank: World Development Indicators
WorldHistory.com

These two images below are from the Human Development Trends, 2005 app.



Don't Know What To Say In Meetings?

So you have these boring meetings and you want to say stuff that sound smart but no one will understand what you talking about. What do you do? Well you use the Web Economy Bullshit Generator of course. This tool mixes a bunch of predefined verbs, adjectives and nouns. The result are gems like these


grow collaborative deliverables
disintermediate ubiquitous web-readiness
seize intuitive users
orchestrate integrated portals


So go ahead and give it a try: http://dack.com/web/bullshit.html

I could have sworn I saw some of these phrases in books ;-)

Thursday, March 15, 2007

Amazon Elastic Compute Cloud (Amazon EC2)



Okay we all know what Amazon Simple Storage Service (Amazon S3) is. Now there is a new service from Amazon called Amazon Elastic Compute Cloud (Amazon EC2). with S3 you use Amazon to store your data, images,whatever but with EC2 you use Amazon to do your computing for you.

From the site:

Amazon EC2 Functionality
Amazon EC2 presents a true virtual computing environment, allowing you to use web service interfaces to requisition machines for use, load them with your custom application environment, manage your network's access permissions, and run your image using as many or few systems as you desire.

To use Amazon EC2, you simply:
Create an Amazon Machine Image (AMI) containing your applications, libraries, data and associated configuration settings. Or use our pre-configured, templated images to get up and running immediately.

Upload the AMI into Amazon S3. Amazon EC2 provides tools that make storing the AMI simple. Amazon S3 provides a safe, reliable and fast repository to store your images.

Use Amazon EC2 web service to configure security and network access.

Use Amazon EC2 web service to start, terminate, and monitor as many instances of your AMI as needed.

Pay for the instance hours and bandwidth that you actually consume.

Service Highlights


Elastic
Amazon EC2 enables you to increase or decrease capacity within minutes, not hours or days. You can commission one, hundreds or even thousands of server instances simultaneously. Of course, because this is all controlled with web service APIs, your application can automatically scale itself up and down depending on its needs.


Completely Controlled
You have complete control of your instances. You have root access to each one, and you can interact with them as you would any machine. Each instance predictably provides the equivalent of a system with a 1.7Ghz x86 processor, 1.75GB of RAM, 160GB of local disk, and 250Mb/s of network bandwidth.


Designed for use with Amazon S3
Amazon EC2 works in conjunction with Amazon Simple Storage Service (Amazon S3) to provide a combined solution for computing and storage across a wide range of applications.


Reliable
Amazon EC2 offers a highly reliable environment where replacement instances can be rapidly and reliably commissioned. The service runs within Amazon's proven network infrastructure and datacenters.


Secure
Amazon EC2 provides web service interfaces to control network security. You define groups of instances and their desired accessibility.


Inexpensive
Amazon EC2 passes on to you the financial benefits of Amazon's scale. You pay a very low
rate for the compute capacity you actually consume. Compare this with the
significant up-front expenditures traditionally required to purchase and
maintain hardware, either in-house or hosted. This frees you from many of the
complexities of capacity planning, transforms what are commonly large fixed
costs into much smaller variable costs, and removes the need to over-buy "safety
net" capacity to handle periodic traffic spikes.


Get all the details here: http://www.amazon.com/gp/browse.html?node=201590011

Online Indexing Operations in SQL Server 2005 Whitepaper Available For Download

TechNet has made availabe a whitepaper that deals with Online Indexing Operations in SQL Server 2005. Introduced in SQL Server 2005 Enterprise Edition, the online index feature provides a powerful way to perform maintenance operations such as rebuilding or creating indexes in a production system without sacrificing DML concurrency. This paper provides a detailed discussion of the index process and provides guidelines and best practices for implementing this feature in a production environment.

Included in this document:

• Introduction

• Data Structures and Concepts

• Overview of the Online Index Build Algorithm

• Capacity Planning and Concurrency Considerations for Index Create and Rebuild Operations

• Online Index Best Practices

• Conclusion

• Appendix A: Performance Study

• Appendix B: Diagnostics

• Appendix C: Log Measurement Script

• Appendix D: Online Index Limitations


Download this whitepaper (Word doc,25 pages) here: http://www.microsoft.com/technet/prodtechnol/sql/2005/onlineindex.mspx

Did You Have Your Pie On Pi Day?




March 14th is Pi Day as the date 3/14 corresponds to the mathematical number pi.

The mathematical constant π is a transcendental (and therefore irrational) real number, approximately equal to 3.14159, which is the ratio of a circle's circumference to its diameter in Euclidean geometry, and has many uses in mathematics, physics, and engineering. It is also known as Archimedes' constant and as Ludolph's number

Here are the first 100 digits of PI

3.
1415926535 8979323846 2643383279 5028841971 6939937510 5820974944 5923078164 0628620899 8628034825 3421170679 8214808651

Wednesday, March 14, 2007

GMail Storage Will Be 3560 MB on April 1st 2012

Gmail's quota will continue to increase in the following years.

What to expect in the future:

2835 MB on April 1st 2007
2980 MB on April 1st 2008
3125 MB on April 1st 2009
3270 MB on April 1st 2010
3415 MB on April 1st 2011
3560 MB on April 1st 2012

As you can see, Gmail's storage will increase with 145 MB a year. Great for storing all that spam. Now I wish they could increase the message size to 20MB from the current 10MB.

More detail here: http://googlesystem.blogspot.com/2007/03/gmails-updated-quotas.html

Priceless Comment About Slashdot Users

It is all here:http://apple.slashdot.org/comments.pl?sid=44091&cid=4592270


Enough said.

How To Get The Database Name For The Current User Process

This question pops up frequent enough so here are 4 ways to return the database name for the current user process

First up is the fastest method. this will run on SQL Server 200 and 2005

SELECT DB_NAME()


Next up is getting the name by joining the sys.dm_exec_requests dmv and sys.sysdatabases. this runs on SQL Server 2005 only

SELECT s.name
FROM sys.dm_exec_requests d
JOIN sys.sysdatabases s on d.database_id = s.dbid
WHERE session_id = @@SPID

Here is something similar, this also runs only on SQL Server 2005

SELECT name
FROM sys.sysdatabases
WHERE dbid = DB_ID()


And we end with something that runs on both SQL Server 2005 and 2000
SELECT name
FROM master..sysdatabases
WHERE dbid = DB_ID()


But like I said before you should always use DB_NAME()

SQL Server 2005 Performance Dashboard Reports Available For Download

The SQL Server 2005 Performance Dashboard Reports are Reporting Services report files designed to be used with the Custom Reports feature introduced in the SP2 release of SQL Server Management Studio. The reports allow a database administrator to quickly identify whether there is a current bottleneck on their system, and if a bottleneck is present, capture additional diagnostic data that may be necessary to resolve the problem. For example, if the system is experiencing waits for disk IO the dashboard allows the user to quickly see which sessions are performing the most IO, what query is running on each session and the query plan for each statement.

Common performance problems that the dashboard reports may help to resolve include:
- CPU bottlenecks (and what queries are consuming the most CPU)
- IO bottlenecks (and what queries are performing the most IO).
- Index recommendations generated by the query optimizer (missing indexes)
- Blocking
- Latch contention

The information captured in the reports is retrieved from SQL Server's dynamic management views. There is no additional tracing or data capture required, which means the information is always available and this is a very inexpensive means of monitoring your server.

Reporting Services is not required to be installed to use the Performance Dashboard Reports.

Keep in mind that the SQL Server instance being monitored must be running SP2 or later.
So what are you waiting for? dowmload it and read the details here: http://www.microsoft.com/downloads/details.aspx?FamilyId=1D3A4A0D-7E0C-4730-8204-E419218C1EFC&displaylang=en

R.I.P Visual FoxPro

Where is the wake ;-) Finally this thing is about to die, no more having to deal with 40 tables because each FoxPro table has a 2GB limit. And don’t get me started with exclusively locked tables either. I think that I will listen to die, die my darling by Metallica while I finish this post. Here are some of the lyrics

Die, die, die my darling
Dont utter a single word
Die, die, die my darling
Just shut your Foxy eyes (I replaced pretty with Foxy)

So for all you FoxPro lovers, there is a great new site (so there is hope for you ;-)) VFP-Conversion

Think Outside the Fox-Den!

Monday, March 12, 2007

map of the world, based on the frequency of its locations mentioned in books.


Here is something interesting and it has to do with data. Inside Google Book Search has some neat maps of the world based on the frequency of its locations mentioned in books. From the site:
We've all seen views of the Earth from space, where the numerous pinpoints of light on the ground combine to yield a speckled map of the world. I wanted to show the Earth viewed from books, where individual mentions of locations in books combine to yield another interpretation of the globe. The intensity of each pixel is proportional to the number of times the location at a given set of coordinates is mentioned across all of the books in Google Books Search.


Here is the link: http://booksearch.blogspot.com/2007/03/earth-viewed-from-books.html

Saturday, March 10, 2007

Wladimir Klitschko Knocks Out Ray Austin In The Second Round

This is how I like my boxing fast and efficient. Wladimir Klitschko knocked out Ray Austin in the second round with a series of left hand punches. That is all there is to say about this fight

Scribd: The YouTube Of Documents

What is Scribd?
Scribd lets you publish and discover documents online. It is like a big online library where anyone can upload. We make use of a custom Flash document viewer that lets you display documents right in your Web browser. There are all sorts of other features that make it easy and fun to publish, convert, embed, analyze, and read documents.

Part of the idea behind Scribd is that everyone has a lot of documents sitting around on their computers that only they can read. With Scribd we hope to unlock this information by putting it on the web.

What kinds of documents can I publish on Scribd?
Literally, anything you can put in a Word (.doc), PDF (.pdf), text (.txt), PowerPoint (.ppt), Excel (.xls), Postscript (.ps), or LIT (.lit) file.

So go ahead and check it out: http://www.scribd.com/

Windows Server 2003 Service Pack 2 x64 Edition Release Candidate Available For Download

Microsoft Windows Server 2003 Service Pack 2 (SP2) Release Candidate (RC) is a cumulative service pack that provides the latest updates, security and stability enhancements, in addition to new features, feature updates and utility updates to the Windows Server 2003 operating system. SP2 helps secure your server and improve system reliability, security, and stability thereby ensuring the highest level of readiness to meet the ever increasing demands of today’s server operating systems.
Windows Server 2003 SP2 can be installed directly on the following operating systems:
Windows Server 2003 Editions (All 32-bit x86)
Windows Server 2003 Itanium-based Editions
Windows Server 2003 x64 Editions
Windows Server 2003 R2 Editions
Windows Server 2003 Storage Server R2 Edition
Windows Server 2003 Compute Cluster Edition
Windows Small Business Server 2003 R2
Windows XP Professional x64 Edition


Download it here: http://www.microsoft.com/downloads/details.aspx?familyid=AC8EDD44-96B3-4D11-9293-12970CD62FED&displaylang=en

Friday, March 09, 2007

how to save a whole heap of money on SQL Server 2000 licenses

I Just read this on the daily WTF (which got renamed to Worse Than Failure the other day)
An insurance company decides to install the trial version of SQL server 2000 on their production box because they don't want to pay the license. After 6 months they backup all the data, wipe out the hard drive (reimage) and install the trial version again, restore all the databases and are good to go for another 6 months...ROFL
Why not just use developer edition? You are violating the license anyway, it will at least save you the hassle of reinstalling every 6 months...
Link to original article is here http://worsethanfailure.com/Articles/SQL_on_Trial.aspx

Thursday, March 08, 2007

Can you solve Joe Celko's SQL puzzles? Three puzzles. Many answers.

ComputerWorld has posted three SQL puzzles that were written by Joe Celko on their website. These puzzles come from Joe Celko's latest book Joe Celko's SQL Puzzles and Answers, Second Edition

These are the puzzles:
Puzzle 1: FISCAL YEAR TABLES
Answer #1
Puzzle 4: SECURITY BADGES
Answer #1
Answer #2
Puzzle 9: AVAILABLE SEATS
Answer #1
Answer #2
Answer #3
Answer #4
Answer #5

the site has individual links to each puzzle and answer, the link to the puzzles is here: http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleId=9012350&source=NLT_APP&nlid=48
Let me know what you think and if you can come up with better/different answers.

Wednesday, March 07, 2007

Visual Studio 2005 Service Pack 1 Update for Windows Vista Available For Download

Get the download here: http://www.microsoft.com/downloads/details.aspx?FamilyId=90E2942D-3AD1-4873-A2EE-4ACC0AACE5B6&displaylang=en


Brief Description
The Visual Studio 2005 Service Pack 1 Update for Windows Vista addresses areas of Visual Studio impacted by Windows Vista enhancements.

Overview
If the machine participated in the Visual Studio 2005 Service Pack 1 Update for Windows Vista Beta, please be sure to uninstall the beta first.

During the development of Windows Vista, several key investments were made to vastly improve overall quality, security, and reliability from previous versions of Windows. While we have made tremendous investments in Windows Vista to ensure backwards compatibility, some of the system enhancements, such as User Account Control, changes to the networking stack, and the new graphics model, make Windows Vista behave differently from previous versions of Windows. These investments impact Visual Studio 2005. The Visual Studio 2005 Service Pack 1 Update for Windows Vista addresses areas of Visual Studio impacted by Vista enhancements.
Many of the Windows Vista enhancements are documented at the Windows Vista Development Center.

This download installs the Visual Studio 2005 Service Pack 1 Update for Windows Vista for the following Visual Studio SKUs:


Microsoft Visual Studio 2005 Tools for Office
Microsoft Visual Basic 2005 Express Edition
Microsoft Visual C++ 2005 Express Edition
Microsoft Visual C# 2005 Express Edition
Microsoft Visual J# 2005 Express Edition (English Only)
Microsoft Visual Web Developer 2005 Express Edition
Microsoft Visual Studio 2005 Premier Partner Edition
Microsoft Visual Studio 2005 Professional Edition
Microsoft Visual Studio 2005 Standard Edition
Microsoft Visual Studio 2005 Team Edition for Software Architects
Microsoft Visual Studio 2005 Team Edition for Software Developers
Microsoft Visual Studio 2005 Team Edition for Software Testers
Microsoft Visual Studio 2005 Team Suite
Microsoft Visual Studio 2005 Team Test Load Agent
Microsoft Visual Studio 2005 Team Test Load Controller
Microsoft Visual Studio 2005 Code Profiler
Microsoft Visual Studio 2005 Team Explorer

Tuesday, March 06, 2007

SQL Server 2005 Service Pack 2a?

SQL Server MVP Aaron Bertrand has posted a blog entry where he mentions that the time and build number have changed to 2007-03-05 and 9.00.3042.01. You can get the latest file here: http://www.microsoft.com/downloads/details.aspx?FamilyId=d07219b2-1e23-49c8-8f0c-63fa18f26d3a&DisplayLang=en

.NET Rocks Podcast: Paul Randal on SQL Server 2005 Performance and Recovery

.NET Rocks has made available their latest podcast. From the site:

"Microsoftee Paul Randal drops by for an engaging talk about his contributions
to the recoverability of SQL Server 2005, which are many (Can you say CHECKDB?).
An old friend of ours, and a fairly new friend of Paul's, busts in on the
conversation and makes a cameo appearance. "



Download the podcast here:http://dotnetrocks.com/default.aspx?showID=220

Monday, March 05, 2007

How To Make A FileGroup Read Only in SQL Server 2005

How to make a filegroup read only in SQL Server 2005? This question popped up today on tek-tips. This is how you do that: First we will create a new database named TestFilegroup. Next we will add a filegroup named Test1FG1 which contains a file named test1dat3.
The next step is to do an alter database modift filegroup readonly command
Here is the complete script

USE master
go

--Create New DB For Testing
CREATE DATABASE TestFilegroup
go


--Create FileGroup
ALTER DATABASE TestFilegroup
ADD FILEGROUP Test1FG1;

--Add file to fileGroup
ALTER DATABASE TestFilegroup
ADD FILE
(
NAME = test1dat3,
FILENAME = 'c:\t1dat3.ndf',
SIZE = 5MB,
MAXSIZE = 100MB,
FILEGROWTH = 5MB

)
TO FILEGROUP Test1FG1

--Make FileGroup ReadOnly
ALTER DATABASE TestFilegroup
MODIFY FILEGROUP Test1FG1 Read_Only;

Use Read_Only not ReadOnly because the keyword READONLY will be removed in a future version of Microsoft SQL Server. Avoid using READONLY in new development work, and plan to modify applications that currently use READONLY. Use READ_ONLY instead.




Now what happens when you try to create a table on filegroup Test1FG1?
USE TestFilegroup
GO
CREATE TABLE abc (id INT) ON Test1FG1

You will see the following error message
Server: Msg 1924, Level 16, State 2, Line 1
Filegroup 'Test1FG1' is read-only.

You can use sys.filegroups and check the is_read_only column to find out if a filegroup is read only
SELECT is_read_only
FROM sys.filegroups
WHERE name = 'Test1FG1'

Here is the result
is_read_only
------------
1




Using NTFS Compression with Read-Only User-defined Filegroups and Read-Only Databases
SQL Server 2005 supports NTFS compression of read-only user-defined filegroups and read-only databases. You should consider compressing read-only data in the following situations:
You have a large volume of static or historical data that must be available for limited read-only access.
You have limited disk space.

ASP.NET Library Site Launched

A friend of mine has started the ASP.NET Library site. The idea of this site is to provide ASP.NET articles, code and tips for professional ASP.NET developers. The site right now offers Resources, Articles and a Code Bank. Under Code Bank you can find the following:
Applications
Controls
Database
Email
HTML

So go ahead and check it out: http://aspnetlibrary.com/

Sunday, March 04, 2007

Arrays and Lists Article Updated For SQL Server 2005

SQL Server MVP Erland Sommarskog has updated his Arrays and Lists article and this new version deals exclusively with SQL Server 2005. This is a must read if you are a SQL Server developer. So what are you waiting for? Stop wasting your time here and start reading Arrays and Lists in SQL Server 2005

Friday, March 02, 2007

The Digg Effect

Someone posted The Sysinternals Troubleshooting Utilities have been rolled up into a single Suite of tools post on Digg and over a thousand people dugg the story. I got a massive amount of traffic, so much that I had to get a new counter for this blog because it stopped working when this blog got a total of 99999 hits. After all these diggs people started to add this post to del.icio.us and so far 183 people have added it to their delicious account. You can see all these people here: http://del.icio.us/url/9be2731b569601719d645d97e88254b4

Here is a graph of the pageviews



I promise that I WILL write a SQL post this weekend and it will be about partitioned functions It will show you how you can use $PARTITION to select data from a specific partition

Top 5 Post and Google Searches For Jan and Feb 2007

Usually I do this once a month but I decided to do it once every two months from now on, I guess you can call it lazyness. Here are the top 5 posts for January and February 2007 in terms of pageviews

1 The Sysinternals Troubleshooting Utilities have been rolled up into a single Suite of tools
2 Ten SQL Server Functions That You Hardly Use But Should
3 Clippy Is Not Dead, Clippy Is Alive.....On Linux
4 Increase Your Productivity With Query Analyzer
5 The Real Reason Why Condoleezza Rice Never Smiles

So two of these (Clippy and Condoleezza) have nothing to do with SQL Server.

Top Queries
These are searches that people typed in the Google search box on this site
I always keep track of these because it gives me some ideas of what to write
Here is the top list for the last 2 months, I left out the adult searches ;-)

None
did france pay brazil to win the cup
NotMyFault
query analyzer not view
sql login
saltrain
notmyfault
%disk read time
defrag
daylight saving SQL Express
maximum number database
openrowset
SQL queries
tree structure catalogue
rainbowfish children book
failed for login sa
jacobs
sysinternals
origin of the name jacobs

Top Ten Posts Of All Time

Here is the list of the ten most popular posts in terms of pageviews since I started collecting this info. Damn Clippy how did he/she get to number 6?

1 The Sysinternals Troubleshooting Utilities have been rolled up into a single Suite of tools
2 SQL Query Optimizations
3 Ten SQL Server Functions That You Hardly Use But Should
4 Five Ways To Return Values From Stored Procedures
5 Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection. SQL 2005
6 Clippy Is Not Dead, Clippy Is Alive.....On Linux
7 NULL Trouble In SQL Server Land
8 COALESCE And ISNULL Differences
9 Increase Your Productivity With Query Analyzer
10 Three Ways To Display Two Counts From a Table Side By Side

How Do I? video series focused on SQL Server 2005 Express

The http://www.asp.net/ site posted a great new "How Do I?" video series focused on SQL Server 2005 Express (which you can download and use completely for free).
So what is in this series?

#1 What is a Database?
(28 minutes, 15 seconds)

#2 Understanding Database Tables and Records
(24 minutes, 56 seconds)

#3 More about Column Data Types and Other Properties
(21 minutes, 37 seconds)

#4 Designing Relational Database Tables
(34 minutes, 10 seconds)

#5 Manipulating Database Data
(40 minutes, 20 seconds)

#6 More Structured Query Language
(23 minutes, 13 seconds)

#7 Understanding Security and Network Connectivity
(40 minutes, 59 seconds)

#8 Connecting your Web Application to SQL Server 2005 Express Edition
(1 hour, 5 minutes)

#9 Using SQL Server Management Studio
(40 minutes, 26 seconds)

#10 Getting Started with Reporting Services
(32 minutes, 51 seconds)

#11 Building and Customizing Reports in Business Intelligence Development Studio
(44 minutes, 50 seconds)

#12 Creating and Using Stored Procedures
(42 minutes, 34 seconds)

#13 Enabling Full-Text Search in your Text Data
(38 minutes, 25 seconds)

You can download all of these here: http://www.asp.net/learn/videos/default.aspx?tabid=63#sql

Enjoy