存储过程第一句
use pubs报错
Could not locate entry in sysdatabases for database 'pubs'. No entry found with that name. Make sure that the name is entered correctly.?????

解决方案 »

  1.   

    我的代码.有什么错吗
    use pubs
    if exists(select [name] from sysobjects where [name] = '#titles')
    drop procedure #titles
    gocreate procedure #titles @titles nchar(10),@name nchar(10)
    as
    insert into tb_test values (@titles,@name)
    go
      

  2.   

    如果不这样写.总提示
    There is already an object named '#titles' in the database.
      

  3.   

    use pubs
    go--加一个gocreate proc t
    as
    select 1 as col
      

  4.   

    use pubs 
    GO 
    .....
      

  5.   


    use [pubs]
    go 
    if exists(select [name] from sysobjects where [name] = '#titles') 
    begin
    drop procedure #titles 
    end
    go create procedure #titles @titles nchar(10),@name nchar(10) 
    as 
    begin
    insert into tb_test values (@titles,@name) 
    end
    go
      

  6.   

    创建存储过程的时候需要begin...end
    最近出现好几个类似的情况了,
    都是begin end没有写的.