The Temple of Fu

code, systems and games

Archive for June 2010

Truncate and DBCC

leave a comment »

So while developing some applications I have the need to clean a table and reset identity fields. Let it be known that if any of the fields are foreign keys in other tables those tables need truncated as well, working from last linked table forward to the Primary key table.

In the below example make sure to put in place of myDatabase and myTable your database that contains the table to be truncated. =]


use myDatabase
truncate table myTable


use myDatabase
DBCC CHECKIDENT ('myTable', RESEED, 0)

Advertisements

Written by lordfu

June 25, 2010 at 2:25 pm

Posted in Database, MSSQL

theZe* Clan

leave a comment »

Anyone that knows me knows that I have been a member of Head Hunter Gaming clan for the last few years. Well due to some differences within that clan a few of us decided it was best to leave. So not one to be down and out for very long we resurrected the theZe* Clan (pronounced these) and we are actively seeking new members. We are a fun and competitive gaming clan (focus on fun). If you like the FPS series Battlefield then give us a shout!

theze clan dot com we ❤ Battlefield

Written by lordfu

June 18, 2010 at 9:42 am

Posted in Games