Resetting the IDENTITY counter in SQL Server T-SQL

You’ve been there before.  You are busily testing your import routines and running up the Identity column in your main import table.  Before you know it the value is in the multi-millions and you just want to reset it back to 1.  The way to accomplish this is to use the DBCC CHECKIDENT command. For example: DBCC CHECKIDENT (SalesForce, reseed, … Read More

Disabling buttons on click for ASP.NET forms

Found some great tips in the simple-talk.com blog about disabling buttons on asp.net forms. If you ever created a form and had your users click on the submit button multiple times this is the code you have been looking for.  Be sure to check out Robyn Page’s comments for a method to block the whole form during the form submit … Read More

Using Virtual PC for Migrating to a new computer

The below information is taken from this post from here. I copied a majority of the text just in case his site disappears one day since this information is really valuable.  I would like to give credit to Ben Armstrong for providing invaluable information on the topics surrounding Virtual PC, Virtual Server and its benefits and pitfalls. One cool use … Read More

Getting date information into environment variables

If you have ever tried to script data downloads and log file manipulation you probably have run across the need to embed the date into a filename during a copy/move operation within a batch file.  I have never been able to find a built-in way to do this within Windows.  Here are a few lines that allows you to get … Read More

Creating Dates in SQL Server… FAST!

Found a great tip online on how to create a date in T-SQL in a very fast way.  The code looks like this: declare @year int, @month int, @day int select @year = 2006, @month = 1, @day = 16 select dateadd(month,((@Year-1900)*12)+@Month-1,@Day-1) This is especially useful when doing date comparisons in queries.  Many people use the convert function, but the … Read More