我的SQL数据库中有一个表A,想将A复制为A1,A2,A3....,用SELECT * FROM A INTO A1语句复制,无法将A表中的索引、字段的默认属性(如aa 为 real 默认为0)等一起复制到目的表中,请问高手,用SQL语句有什么好的解决方法吗?

解决方案 »

  1.   

    直接用表复制的 SQL 命令
      

  2.   

    直接用表复制的 SQL 命令
    *************怎么做? create table aa as select * from a1?
      

  3.   

    直接运行下面的SQL语句就行select * into a1 from a
    select * into a2 from a
    select * into a3 from a
    select * into a4 from a
      

  4.   

    如果不行 就创建表
    **************
    '工程--->引用--->Microsoft ActiveX Data Object 2.x(版本号)    Dim CN   As New ADODB.Connection                '定义数据库的连接
        Dim Rs   As New ADODB.Recordset
        CN.ConnectionString = "Provider=sqloledb;Data Source=pmserver;Initial Catalog=northwind;User Id=sa;Password=sa;"    CN.Openstrsql = "CREATE TABLE [DownClass] ([id] [int] IDENTITY (1, 1) NOT NULL ," & _
           "[classname] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ," & _
           "CONSTRAINT [PK_DownClass] PRIMARY KEY  CLUSTERED" & _
           "( [id] )  ON [PRIMARY] ) ON [PRIMARY]"    '执行建表语句
        cn.execute strsql