|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
DBaaS并不意味着解决方案提供者要让自己失业。与其他系统一样,在实施DBaaS解决方案时,客户可能需要部署、迁移、支持、异地备份、系统集成和灾难恢复等方面的帮助。复制代码代码以下:
setANSI_NULLSON
setQUOTED_IDENTIFIERON
go
--=============================================
--Author:华岭
--Createdate:2008-10-28
--Description:将表数据天生Insert剧本
--Demo:execpCreateInsertScriptBexmCodeType,dictypeid=61
--=============================================
alterproc[dbo].pCreateInsertScript(@tablenamevarchar(256),@connvarchar(400))
as
begin
setnocounton
declare@sqlstrvarchar(4000)
declare@sqlstr1varchar(4000)
declare@sqlstr2varchar(4000)
select@sqlstr=selectinsert+@tablename
select@sqlstr1=
select@sqlstr2=(
select@sqlstr1=values(+
select@sqlstr1=@sqlstr1+col++,+,@sqlstr2=@sqlstr2+name+,from(selectcase
whena.xtype=173thencasewhen+a.name+isnullthenNULLelse+convert(varchar(+convert(varchar(4),a.length*2+2)+),+a.name+)+end
whena.xtype=104thencasewhen+a.name+isnullthenNULLelse+convert(varchar(1),+a.name+)+end
whena.xtype=175thencasewhen+a.name+isnullthenNULLelse+++replace(+a.name+,,)+++end
whena.xtype=61thencasewhen+a.name+isnullthenNULLelse+++convert(varchar(23),+a.name+,121)+++end
whena.xtype=106thencasewhen+a.name+isnullthenNULLelse+convert(varchar(+convert(varchar(4),a.xprec+2)+),+a.name+)+end
whena.xtype=62thencasewhen+a.name+isnullthenNULLelse+convert(varchar(23),+a.name+,2)+end
whena.xtype=56thencasewhen+a.name+isnullthenNULLelse+convert(varchar(11),+a.name+)+end
whena.xtype=60thencasewhen+a.name+isnullthenNULLelse+convert(varchar(22),+a.name+)+end
whena.xtype=239thencasewhen+a.name+isnullthenNULLelse+++replace(+a.name+,,)+++end
whena.xtype=108thencasewhen+a.name+isnullthenNULLelse+convert(varchar(+convert(varchar(4),a.xprec+2)+),+a.name+)+end
whena.xtype=231thencasewhen+a.name+isnullthenNULLelse+++replace(+a.name+,,)+++end
whena.xtype=59thencasewhen+a.name+isnullthenNULLelse+convert(varchar(23),+a.name+,2)+end
whena.xtype=58thencasewhen+a.name+isnullthenNULLelse+++convert(varchar(23),+a.name+,121)+++end
whena.xtype=52thencasewhen+a.name+isnullthenNULLelse+convert(varchar(12),+a.name+)+end
whena.xtype=122thencasewhen+a.name+isnullthenNULLelse+convert(varchar(22),+a.name+)+end
whena.xtype=127thencasewhen+a.name+isnullthenNULLelse+convert(varchar(6),+a.name+)+end
whena.xtype=48thencasewhen+a.name+isnullthenNULLelse+convert(varchar(6),+a.name+)+end
whena.xtype=165thencasewhen+a.name+isnullthenNULLelse+convert(varchar(+convert(varchar(4),a.length*2+2)+),+a.name+)+end
whena.xtype=167thencasewhen+a.name+isnullthenNULLelse+++replace(+a.name+,,)+++end
elseNULL
endascol,a.colid,a.name
fromsyscolumnsawherea.id=object_id(@tablename)
anda.xtype189anda.xtype34anda.xtype35anda.xtype36
)torderbycolid
select@sqlstr=@sqlstr+left(@sqlstr2,len(@sqlstr2)-1)+)+left(@sqlstr1,len(@sqlstr1)-3)+)from+@tablename+where1=1and+isnull(@con,)
print@sqlstr
exec(@sqlstr)
setnocountoff
end
DBaaS系统其实具有更大的市场机遇:像其他云服务一样,DBaaS意味着更短的销售周期,更少的启动费用,持续不断的收入,也意味着比之前更多的客户。 |
|