Windows Live Writer which IMO is the best software for blog posting has been missing a desirable feature. i.e. to backup posts, pages, settings etc. Today I found about Windows Live Writer Backup application on CodePlex. This little application will backup your posts and blog settings. The application is a RC at this stage.
Given the popularity of Windows Live Writer, I see a good uptake for this application.
You can download Windows Live Writer Backup here.
It feels good when you find a hidden gem on www. Through a link trail which I cannot remember now I somehow landed up on SQL Server 2008 Jumpstart site. Here you can access training material which is categorised into four tracks.
- Database Infrastructure Track
- Business Intelligence Track
- Developer Track
- Application Compatibility & Upgrade Track,
Each of the tracks have reading material, demos and Hands on Labs. I think this is great source to get skilled up on SQL Server 2008 from the comfort of your home / office.
Here is the link to SQL Jumpstart site.
This one always gets me off guard so I’m posting this here for more than anything else to remind me. The issue occurs when you configure your MOSS environment which is normally done after installing MOSS. The issue is that while inserting sample data the wizard throws an error which says “Failed to create sample data”. The reason this occurs is because you’ve not configured MSDTC properly. Here are the steps to resolve the problem picked up from this link.
To resolve this issue, configure the security settings for the Microsoft Distributed Transaction Coordinator (DTC) to use the Allow Remote Clients setting. To do this, follow these steps:
- Click Start, point to Administrative Tools, and then click Component Services.
- In the left pane of the Component Services snap-in, expand Component Services, and then expand Computers.
- Right-click My Computer, and then click Properties.
- Click the MSDTC tab, and then click Security Configuration under Transaction Configuration.
- Under Security Settings, click to select the Network DTC Access check box, if it is not already selected. Then, click to select the Allow Remote Clients check box
- Click OK.
- When you receive the message that states that the DTC service will be stopped and restarted, click Yes to confirm that you want to continue.
- Click OK when you receive the message that the DTC service was restarted.
- Click OK.
Once the above steps have been executed, running the wizard inserts sample data without any problem.
In SQL Server 2008 you can find if a database is online of offline by querying databases system view. A simple query such as this one gives me a list of all databases on my server and the second column shows if the database is online or offline.
SELECT Name, state_desc
FROM sys.databases
On my server I have a database called LinqToSqlLab which is currently offline.
SQL Server by default follows Windows password policy requirements for SQL Server Login accounts. This forces you to follow the same policy for SQL Server logins as you would for windows logins and this is a good thing. But sometimes you want to bypass that validation maybe to get a test login in place. You can do this by using CHECK_POLICY = OFF. For example when I try to create a login using this statement I get an error.
CREATE LOGIN test_user WITH PASSWORD = 'password123'
Msg 15118, Level 16, State 1, Line 1
Password validation failed. The password does not meet Windows policy requirements because it is not complex enough.
The error itself tells me that my password does not meet policy requirements. The policy on my machine requires me to have at-least one upper case letter in my password. To bypass this requirement I can execute this statement which will create my SQL Login.
CREATE LOGIN test_user WITH PASSWORD = 'password123', CHECK_POLICY = OFF
You should however use this with caution because password policies are there for a reason i.e. to make your environment more secure.
If you are creating a SQL Server login using a script then it is advisable to check if the login you are creating already exists. If you do not do this then SQL Server will throw an error. For example if I execute this statement when a login with name test_user already exists, I will get the following error.
CREATE LOGIN test_user WITH PASSWORD = 'Password123'
Msg 15025, Level 16, State 1, Line 1 The server principal 'test_user' already exists.
To avoid this a check can be used before creating the login. One way to do this is to write a statement like this.
IF NOT EXISTS(SELECT name FROM master.dbo.syslogins WHERE name = 'test_user') BEGIN CREATE LOGIN test_user WITH PASSWORD = 'Password123' END
The above statement will check for the login and it will only create it if the login does not already exist. This works but it is not the best way to do it in SQL Server 2008. The problem is that we are querying master.dbo.syslogins which is available only for backward compatibility and as per Microsoft it will be removed in future versions. So the best way to do a check before creating a login is to use sys.sql_logins or sys.server_principals system view. Our statement can be re-written in following two ways.
IF NOT EXISTS(SELECT name FROM sys.server_principals WHERE name = 'test_user') BEGIN CREATE LOGIN test_user WITH PASSWORD = 'Password123' END
OR
IF NOT EXISTS(SELECT name FROM sys.sql_logins WHERE name = 'test_user') BEGIN CREATE LOGIN test_user WITH PASSWORD = 'Password123' END
This approach will ensure that your script will work in future versions of SQL Server when Microsoft decides to remove master.dbo.syslogins.
To do this you will need to add references to System.Drawing and System.Windows.Forms. Make sure that you have following using statements:
using System; using System.Drawing; using System.Drawing.Imaging; using System.Windows.Forms;
In your method add this code. It will take a screenshot of your primary screen and save it to a file.
Bitmap bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height); Graphics graphics = Graphics.FromImage(bitmap as Image); graphics.CopyFromScreen(0, 0, 0, 0, bitmap.Size); bitmap.Save(@"c:\temp\screenshot.bmp", ImageFormat.Bmp);
I found this very interesting.
When you install Oracle, a user by the name of Scott is always created for you. This users’ password is Tiger. The user is actually named after Bruce Scott who was one of the first employees at Oracle and Tiger was his cat’s name.
Database Mail configuration settings can be retrieved using sysmail_help_configure_sp stored procedure. Like other database mail object, this stored procedure also resides in msdb database. Running the stored procedure on my machine gives the following results.
sysmail_help_configure_sp

You can easily get information on how much space a table is using by executing sp_spaceused stored procedure. Executing the following query on AdventureWorks database shows me how much space Person.Contact table is using. Information presented is detailed which includes the number of rows, reserved space, index size, space used by data and any unused space in kilo-bytes.
exec sp_spaceused [Person.Contact]

This famous picture of the main crew at Microsoft Corporation in 1978 is perhaps one of the most famous photos of Microsoft employees of that time. The picture is mostly seen with the slogan “Would you have invested?” This photo also made it to Museum Of Hoaxes website which lists facts about people in the photo. While the accuracy of the numbers mentioned is questionable as there is no hard fact and information on the time it was calculated is missing, it however makes an interesting read. From Museum Of Hoaxes:
Bill Gates: Still with Microsoft as it’s chairman and chief software architect. His fortune is somewhere in the range of $50 billion.
Paul Allen: Left Microsoft in 1983 but remains a senior strategy advisor to the company. Worth around $25 billion.
Bob O’Rear: Left Microsoft in 1983. Is now a cattle rancher and is worth around $100 million.
Bob Greenberg: Left Microsoft in 1981 and then helped launch those Cabbage Patch Dolls that were so popular in the 1980s. Last time anyone checked, he was worth around $20 million.
Jim Lane: Left Microsoft in 1985. Now has his own software company and is worth around $20 million.
Gordon Letwin: Left Microsoft in 1993 and now devotes himself to environmental causes. Is worth around $20 million.
Steve and Marla Wood: They both left Microsoft in 1980 and Marla then sued the company for sex discrimination. They’re worth around $15 million.
Bob Wallace: Left Microsoft in 1983. Worth around $5 million.
Andrea Lewis: Was Microsoft’s first technical writer. Left the company in 1983. Worth around $2 million.
Marc McDonald: Was Microsoft’s first employee. Left the company in 1984, but recently rejoined the company when Microsoft bought Design Intelligence, the company he was working for. Has the honor of getting to wear badge number 00001. Probably worth at least $1 million.
Today I am starting a series of posts in which I will post some interesting tit-bits about Microsoft. Mostly past stuff. I will prefix these posts with “Microsoft Museum” and tag them the same for easy search ability. The idea is to have light hearted and interesting posts about Microsoft. The ones that you read and go “…oh yes, I remember that…”. Hope you enjoy them.
So here is the first piece for my museum. Back in February 2004 Neowin broke the story that Windows 2000 and NT 4 source code was leaked on the internet. The story was legitimized by Microsoft posting a response on their site which went something like this:
REDMOND, Wash., Updated, Feb. 20, 2004 — On Thursday, February 12, Microsoft became aware that portions of the Microsoft Windows 2000 and Windows NT 4.0 source code were illegally made available on the Internet. Subsequent investigation has shown this was not the result of any breach of Microsofts corporate network or internal security, nor is it related to Microsofts Shared Source Initiative or its Government Security Program, which enable our customers and partners, as well as governments, to legally access Microsoft source code. Microsoft reaffirms its support for both the Shared Source Initiative and the Government Security Program.
Microsoft continues to work closely with the U.S. Federal Bureau of Investigation and other law enforcement authorities on this matter. Microsoft source code is both copyrighted and protected as a trade secret. As such, it is illegal to post it, make it available to others, download it or use it. Microsoft will take all appropriate legal actions to protect its intellectual property. These actions include communicating both directly and indirectly with those who possess or seek to possess, post, download or share the illegally disclosed source code.
Top Posts
- LINQ To SQL Tutorial
- LINQ To SQL Join On Multiple Conditions
- Code Sample: Programmatically Download File Using C#
- Windows 7 Control Panel In Classic Mode
- More Details Emerge On Microsoft Master Certification
- Use SqlConnection With LINQ To SQL
- Free Icons And Images With Visual Studio 2008
- Capture XML In WCF Service
- Dynamic Sort With LINQ
- StyleCop Tutorial
Tags
.Net 2010 ADO.NET ASP.NET Azure Blogging Books Browsers C# Certification Cloud Computing Code Snippets Community Data Services Eclipse Entity Framework Google IDE Java LINQ Mac Microsoft Museum NetBeans Office Oracle REST SharePoint Silverlight SQL Server T-SQL Tips Tools Training Visual Studio Visual Studio 2010 WCF Web Windows Windows 7 Windows Forms Windows Live WMI WPF XAML

