大家都知数据库表中的列可以自增长,但是有时候我们需要插入数据的时候会指定这一列的数据. 这时候我们可以很简单的利用sql语句来执行新增一条的数据,如下: set IDENTITY_INSER 表名 on insert into 表名(列1,列2,...)values (值1,值2,...); 当然咯,不能忘记还原这一列的自增长啊 Set IDENTITY_INSERT 表名 OFF 我们大家都只知道,批量插入语句有一条比较简单的SQL insert into 表1 select 列1,列2,..
if __name__== "__main__" 的意思(作用)python代码复用 转自:大步's Blog http://www.dabu.info/if-__-name__-__main__-mean-function-python-code-reuse.html 有人在学习python脚本时会发现有的脚本下面有几行代码; 1 2 if __name__== "__main__": main() 不明白其中的意思,其实这就是方便我们代码复用的,我们可以在