create table a(id int,col varchar(10))
insert a select 1,'111'
union all select 2,'222'
union all select 3,'333'
create table b(id int,col varchar(10))
insert b select 1,'1111'
union all select 2,'2222'
union all select 3,'3333'
go
create trigger test on a
for insert
as
insert b select * from inserted
go
select * from a
select * from b
go
insert a select 4,'444'
go
select * from a
select * from b
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[T_STONEKC]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[T_STONEKC]
GO
CREATE TABLE [dbo].[T_STONEKC] (
[id] [char] (10) COLLATE Chinese_PRC_CI_AS NOT NULL primary key,
[ck] [char] (10) COLLATE Chinese_PRC_CI_AS NOT NULL primary key,
[kcsl] [int] NULL default 0,
[jg] [float] NULL default 0
) ON [PRIMARY]
GO
'这是用VB写的一个连接与关闭连接的语句
Public Sub OpenOrCloseDataBaseConnection()
If Con.State = 1 Then
Con.Close
Else
Con.CursorLocation = adUseClient
Con.Open strConnectionString
End If
End Sub