rt  
如果不存在,则创建,存放,则打开,
求sql语句

解决方案 »

  1.   

    IF EXISTS(SELECT 1 FROM SYSOBJECTS WHERE ID=OBJECT_ID('RT'))
    DROP TABLE TR
    GO
      

  2.   

    if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[users]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    CREATE TABLE [dbo].[Users] (
    [cUserCode] [varchar] (10) NOT NULL
    ) ON [PRIMARY]
    GO
      

  3.   

    if object_id('[tb]') is not null drop table [tb]
    go 
    create table [tb]([col] varchar(1))
    insert [tb]
    select 'a'
      

  4.   

    if object_id('tb') is not null
      drop table tb
      

  5.   

    if OBJECT_ID('tb') is not null 
    drop table tb
    go
    create table tb(a nvarchar(100))
    insert tb
    select 'E14N85C1' union all
    select 'O20D58E42F56'
    go
      

  6.   

    if object_id(N'tb',N'U') is not null
    drop table tb
      

  7.   

    IF EXISTS(SELECT 1 FROM SYSOBJECTS WHERE ID=OBJECT_ID('RT'))
    select * from rt
    else
    begin 
    create table rt()
    insert rt values()
    end
      

  8.   


    if object_id('tableName') is not null
    drop table tableName
    create table tableName
    (
    )
     
      

  9.   


    if exists (select *from sysobjects
    where [name]='tst')
    return
    else
    create  table tst(p INT)
      

  10.   

    IF EXISTS(SELECT 1 FROM SYSOBJECTS WHERE ID=OBJECT_ID('tablename'))
    DROP TABLE TR
    GO
      

  11.   

    IF EXISTS(SELECT 1 FROM SYSOBJECTS WHERE ID=OBJECT_ID('tablename'))
    或者看一下。。