Wednesday, 10th March 2010.

Posted on Tuesday, 21st July 2009 by chris

If you are using an identity column on your SQL Server tables, you can set the next insert value to whatever value you want. An example is if you wanted to start numbering your ID column at 1000 instead of 1.
It would be wise to first check what the current identify value is. We can [...]

Posted in SQL | Comments (2)

Posted on Friday, 10th October 2008 by chris

–测试数据
CREATE   TABLE   tb(ID   char(3),PID   char(3),Name   nvarchar(10))
INSERT   tb   SELECT   ‘001′,NULL   ,’山东省’
UNION   ALL   SELECT   ‘002′,’001′,’烟台市’
UNION   ALL   SELECT   ‘004′,’002′,’招远市’
UNION   ALL   SELECT   ‘003′,’001′,’青岛市’
UNION   ALL   SELECT   ‘005′,NULL   ,’四会市’
UNION   ALL   SELECT   ‘006′,’005′,’清远市’
UNION   ALL   SELECT [...]

Tags:
Posted in SQL | Comments (0)