if exists (select 1 from sysobject where name = "sp_helpdb") is not null --判斷是否存在同名的儲存過程,如果有就刪除drop procedure sp_helpdb go create procedure sp_helpdb --建立名為sp_helpdb儲存過程as create database studb --在儲存過程裡建立資料庫on primary( --建立主檔案 name = studb_mdf, filename = "儲存路徑\studba_mdf,mdf", size = 3mb, maxsize = 100mb, filegrowth = 1mb)on log( --建立日誌檔案 name = studb_ldf, filename = "儲存路徑\studba_ldf,ldf", size = 3mb, maxsize = 200mb, filegrowth = 1mb)go
if exists (select 1 from sysobject where name = "sp_helpdb") is not null --判斷是否存在同名的儲存過程,如果有就刪除drop procedure sp_helpdb go create procedure sp_helpdb --建立名為sp_helpdb儲存過程as create database studb --在儲存過程裡建立資料庫on primary( --建立主檔案 name = studb_mdf, filename = "儲存路徑\studba_mdf,mdf", size = 3mb, maxsize = 100mb, filegrowth = 1mb)on log( --建立日誌檔案 name = studb_ldf, filename = "儲存路徑\studba_ldf,ldf", size = 3mb, maxsize = 200mb, filegrowth = 1mb)go