关闭

动态创建数据库!

标签: 数据库collationsqldatabasego
786人阅读 评论(0) 收藏 举报
分类:

create proc pr_createdb
@DBNAME sysname,
@collation_name sysname,
@dNAME sysname,
@dFILENAME sysname,
@dSIZE int,
@dMAXSIZE int,
@dFILEGROWTH,
@lNAME sysname,
@lFILENAME sysname,
@lSIZE int,
@lMAXSIZE int,
@lFILEGROWTH
as
declare @sql varchar(8000)
set @sql='CREATE DATABASE '+ @DBNAME+' ON (
   NAME = '+@dNAME+',
   FILENAME = '''+@dFILENAME+''',
   SIZE = '+cast(@dSIZE as varchar(10))+',
   MAXSIZE = '+cast(@dMAXSIZE as varchar(10))+',
   FILEGROWTH = '+cast(@dFILEGROWTH as varchar(10))+' )
LOG ON (
   NAME = '+@lNAME+',
   FILENAME = '''+@lFILENAME+''',
   SIZE = '+cast(@lSIZE as varchar(10))+',
   MAXSIZE = '+cast(@lMAXSIZE as varchar(10))+',
   FILEGROWTH = '+cast(@lFILEGROWTH as varchar(10))+' )
COLLATE '+@collation_name

exec (@sql)

go

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:260441次
    • 积分:2971
    • 等级:
    • 排名:第11827名
    • 原创:62篇
    • 转载:53篇
    • 译文:0篇
    • 评论:50条
    最新评论