1.在数据库中新建两张测试表 创建用户表 use eftest go if exists(select * from sysobjects where name='UserInfo') drop table UserInfo create table UserInfo( ID ,) primary key, UserName ) not null, Sex ) default '男', age int ) go 创建订单表 use eftest go if exists (select * fr
今天在网上查了下,根据旧表创建新表的SQL语句,网上给了两个答案 create table tab_new like tab_old (使用旧表创建新表) create table tab_new as select col1,col2- from tab_old definition only 两个语句都试了一下,报错了. 正确的方法是 select * into newtable from oldtable; 如果不想导记录,只想生成表结构 :select * into newtable f
Microsoft SQL Server 表创建,查看,修改及删除 创建表 创建普通表 use 数据库名称 go create table 表名称( 列1 ) not null, 列2 ) not null, 列3 ) not null, 列4 ), 列5 smalldatetime not null, 列6 text) Go 复制表结构 select * into ta3 from ta1 where 1<>1; select top 0 * into tb4 from ta1; 创建临时表