Monthly Archives: September 2010

C# String Format examples for Double

From http://www.csharp-examples.net/string-format-double/ The following examples show how to format float numbers to string in C#. You can use static method String.Format or instance methods double.ToString and float.ToString. Digits after decimal point This example formats double to string with fixed number … Continue reading

Posted in .NET | Tagged , | Leave a comment

Reseed an Identity column in SQL 2008

In SQL 2000/2005, I used to be able to change the seed of an identity field in table designer. It will just prompt a message saying this table and a few other table (if having FK on) will be modified. … Continue reading

Posted in SQL | Tagged | Leave a comment

Scan stored procedures source script

Want to remove an obsolete table column but don’t want to break any views that may still reference it? SELECT v.NAME, c.[text] FROM syscomments c, sys.VIEWS v WHERE v.OBJECT_ID=c.id AND c.TEXT LIKE ‘%MY FIELD%’ The above is just for the … Continue reading

Posted in SQL | Tagged | Leave a comment

Email notification in MS SQL 2005/2008

A few undocumented steps, on top of the obvious ones, before being able to send email notifications Database Mail -> Configuration -> Manage profile security, make sure there is at least one public and default profile. SQL Server Agent -> … Continue reading

Posted in SQL | Leave a comment