随笔分类 - SQL
摘要:--查询表和视图select * from information_schema.tables--查询视图select * from information_schema.views--查询数据库所有表select * from sysobjects where xtype= 'U' and status> 0sp_tables 或: select * from INFORMATION_SCHEMA.TABLES 或: select * from sysobjects where xtype= 'U ' and status> 0sysobjects
阅读全文
摘要:(1)INSERTINTO SELECT语句语句形式为:Insert into Table2(field1,field2,...) select value1,value2,... from Table1要求目标表Table2必须存在,由于目标表Table2已经存在,所以我们除了插入源表Table1的字段外,还可以插入常量。(2)SELECTINTO FROM语句语句形式为:SELECT vale1, value2 into Table2 from Table1要求目标表Table2不存在,因为在插入时会自动创建表Table2,并将Table1中指定字段数据复制到Table2中。
阅读全文

浙公网安备 33010602011771号