# Monday, May 30, 2005

The Software Developers Conference in the Netherlands has begun. Today I show how to prevent SQL Injection Attacks in ASP .NET as well as other cool tricks. Lots of RDs here and lots of happy attendees. As usual at SDC I will show something very new and cool. I will show off some of the new SQL Server Management Objects (SMO) in the keynote tonight. Ill give you a preview here.

The SMO object model is a logical continuation of the work done in SQL-DMO. SMO is feature-compatible with SQL-DMO, containing many of the same objects. . To achieve maximum data definition language (DDL) and administrative coverage for SQL Server 2005, SMO adds more than 150 new classes. The primary advantages of SMO are in its performance and scalability. SMO has a cached object model, which allows you to change several properties of an object before effecting the changes to SQL Server. As a result, SMO makes fewer round trips to the server, and makes its objects more flexible. SMO also has optimized instantiation, meaning that you can partially or fully instantiate objects. You can load many objects quickly by not instantiating all the properties of the objects. To get started you have to set a reference to it and pull in the namespace:

using Microsoft.SqlServer.Management.Smo;

Now I will show you how to programitically do a database restore. You start with getting the SMO objects: Server and Restore.

Server svr = new Server();

Restore res = new Restore();

Now take a look at how easy you can do a restore, just a few lines of code:

res.Database = “AdventureWorks“;

res.Action = RestoreActionType.Database;

res.Devices.AddDevice(“c:\mybackup.bak“, DeviceType.File);

res.ReplaceDatabase = true;


There is a lot more that you can do with SMO, but this shows you how easy it is to manage your server from code. A very cool thing to do it put some of the server monitor stuff into an ASP .NET page for viewing your server stats from a remote location.

More on SMO to come...


posted on Monday, May 30, 2005 7:32:15 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] Trackback
# Saturday, May 28, 2005

That is the title of Richard and my Monday night keynote at the Software Developers Confrence in the Netherlands. Well I think it is now: “Estaban, splain dis Jukon to me!“ where we talk all about SQL Server 2005 in bad Spanish accents. To tell you the truth we have no idea what we are going to talk about, we do know that it will  be fun, contain beer and technical content. Confrences in the Netherlands rock.

Off to the Red Lights...

posted on Saturday, May 28, 2005 7:33:16 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [1] Trackback
# Wednesday, May 25, 2005

At TechED 2005 US in Orlando, you will not want to miss the GrokTalks. Trust me. They break the mold and do not follow the MS party line. Stay tuned...

posted on Wednesday, May 25, 2005 5:12:06 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] Trackback
# Monday, May 16, 2005

24 states have laws barring interstate shipments of wine. This is done to protect state industry. It is foolish. This means if I travel to Napa and visit a vinyard that is small they can't ship me wine unless they are “doing business in New York State”. Might as well move back to the Soviet Union.

Anyway, today the Supreme Court agreed with me and overturned a NY and Michigan law.

posted on Monday, May 16, 2005 1:29:05 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [2] Trackback
# Thursday, May 12, 2005

Today at 2 p.m. Nepal time, Ed Viesturs, reached the summit of Annapurna. He has failed in the past, but by getting here he has become the first American to climb all 14 of the world's 8,000-meter peaks (and all without oxygen, having been there I know how hard that is!). In a call from the summit, Ed said that it's "one of the happiest days of my life, one of the hardest days of my life."

Congratulations Ed!

posted on Thursday, May 12, 2005 3:59:08 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [104] Trackback
# Friday, April 29, 2005
DBA304  Advanced Querying Techniques, Tips & Tricks Using Transact-SQL
Speaker(s): Richard Campbell, Stephen Forte
Session Type(s): Breakout
Track(s): Database Administration
Day/Time: Monday, June 6 3:15 PM - 4:30 PM Room: S 310 A
Take your querying to the next level! This session gets away from the fundamentals of SQL queries and into the hard stuff. See two experts in SQL Server compare and contrast querying techniques between SQL Server 2000 and SQL Server 2005. This session has a series of real world examples to show how creative SQL queries can generate solutions in record time. Some techniques you'll learn include how to do crosstab queries that take seconds to execute instead of hours, exploiting sub-queries and taking advantage of self-joining. Along the way, get some insight into how SQL servers work, as well as how SQL Server 2005 is going to make advanced querying even easier.
posted on Friday, April 29, 2005 8:13:37 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [1] Trackback
# Thursday, April 21, 2005

We are losing another great RD to the mother ship. The great and wonderful Malek (This doesn’t suck) Kemmou will be starting a new job in less than two weeks: he will be the Technology Architect – Application Platform for Microsoft Middle East and Africa based in Istanbul, Turkey. The Middle East and North Africa region is gaining a very talented architect with a background not only in MS but competitive technologies, so he will be able to provide the best solutions in an area desperate for some technological horsepower. Malek brings his tremendous experience to the role and will help revitalize a region of the world where technology is just starting to make an impact.

On Sunday afternoon, Goksin, Malek and I are going have an orange badge to blue ceremony and throw our orange badges into the Bosphorus as a sign of unity with our buddy. (I am not sure how we are going to explain how we need replacement badges to our local office, but that is a problem for Monday.)

Good luck my friend!

posted on Thursday, April 21, 2005 8:14:33 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [1] Trackback
# Wednesday, April 20, 2005


The 2005 North Africa Developers Conference in Algiers, Algeria is over. Boy was it a smashing success. Over 2,200 developers attended and more had to be turned away due to space restrictions. I pushed hard for Microsoft to go into Algiers to make a statement, so I am glad it worked.


I had standing room only in all of my 4 sessions. I met several students, professionals and even lots of open source folks who wanted to see what Microsoft was all about.


While my French has improved since the first NDC, my sessions were still interpreted and all went well. I was the ONLY speaker from the United States, I hope I made a good impression (early feedback says so and I did have standing room only in my talks!)


After the conference we went to the roof of the convention center overlooking Algiers and the beautiful Mediterranean for a reception with government officials and the attendees. I used my limited French to talk with the mayor of Algiers about the tall building in New York and my running and biking in Central Park.


There were several RD there including the very reclusive Frecnh RDs, but some tequila got Pierre (aka ALL CAPS) Couzy to open up some more. We had a blast. All the RDs there were:


Me :)




Sylvain Duford

Pierre Couzy (ALL CAPS)

Yann Faure

Eric Groise


Off to Istanbul next.

posted on Wednesday, April 20, 2005 11:57:23 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [2] Trackback