加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

PowerDeisnger16下导出到sqlserver2005以上出现sysproperties错

发布时间:2020-12-12 13:30:16 所属栏目:MsSql教程 来源:网络整理
导读:---------------------------------TableComment------------------------------ [if exists (select 1? ? ? ? ? ? ? from ?sys.extended_properties ? ? ? ? ? ?where ?major_id = object_id('[%QUALIFIER%]%TABLE%')? ? ? ? ? ? ? and ? minor_id = 0)? be
---------------------------------TableComment------------------------------
[if exists (select 1?
? ? ? ? ? ? from ?sys.extended_properties
? ? ? ? ? ?where ?major_id = object_id('[%QUALIFIER%]%TABLE%')?
? ? ? ? ? ? and ? minor_id = 0)?
begin?
? ?[%OWNER%?[.O:[execute ][exec ]]sp_dropextendedproperty [%R%?[N]]'MS_Description',?
? ?[%R%?[N]]'user',[%R%?[N]]%.q:OWNER%,[%R%?[N]]'table',[%R%?[N]]%.q:TABLE%?
:declare @CurrentUser sysname?
select @CurrentUser = user_name()?
[.O:[execute ][exec ]]sp_dropextendedproperty [%R%?[N]]'MS_Description',[%R%?[N]]@CurrentUser,[%R%?[N]]%.q:TABLE%?
]?
end?




][%OWNER%?[.O:[execute ][exec ]]sp_addextendedproperty [%R%?[N]]'MS_Description',?
? ?[%R%?[N]]%.q:COMMENT%,[%R%?[N]]%.q:TABLE%?
:select @CurrentUser = user_name()?
[.O:[execute ][exec ]]sp_addextendedproperty [%R%?[N]]'MS_Description',[%R%?[N]]%.q:TABLE%?
]?
---------------------------------ColumnComment-----------------------------
[if exists (select 1
? ? ? ? ? ? from ?sys.extended_properties
? ? ? ? ? ?where ?major_id= object_id('[%QUALIFIER%]%TABLE%')
? ? ? ? ? ? and ? value = [%R%?[N]]%.q:COMMENT%)
begin
? ?[%OWNER%?[.O:[execute ][exec ]]sp_dropextendedproperty [%R%?[N]]'MS_Description',[%R%?[N]]%.q:TABLE%,[%R%?[N]]'column',[%R%?[N]]%.q:COLUMN%
:declare @CurrentUser sysname
select @CurrentUser = user_name()
[.O:[execute ][exec ]]sp_dropextendedproperty [%R%?[N]]'MS_Description',[%R%?[N]]%.q:COLUMN%
]


end




][%OWNER%?[.O:[execute ][exec ]]sp_addextendedproperty [%R%?[N]]'MS_Description',
? ?[%R%?[N]]'user',[%R%?[N]]%.q:COLUMN%
:select @CurrentUser = user_name()
[.O:[execute ][exec ]]sp_addextendedproperty [%R%?[N]]'MS_Description',[%R%?[N]]%.q:COLUMN%

]



视图改动如下:

原先的脚本:

[if exists (select 1
? ? ? ? ? ? from ?sysproperties
? ? ? ? ? ?where ?id = object_id('[%QUALIFIER%]%VIEW%')
? ? ? ? ? ? and ? type = 3)
begin
? ?[%OWNER%?[.O:[execute ][exec ]]sp_dropextendedproperty [%R%?[N]]'MS_Description',?
? ?[%R%?[N]]'user',[%R%?[N]]%.q:VIEW%
:declare @CurrentUser sysname
select @CurrentUser = user_name()
[.O:[execute ][exec ]]sp_dropextendedproperty [%R%?[N]]'MS_Description',[%R%?[N]]'view',[%R%?[N]]%.q:VIEW%
]
end




][%OWNER%?[.O:[execute ][exec ]]sp_addextendedproperty [%R%?[N]]'MS_Description',?
? ?[%R%?[N]]%.q:COMMENT%,[%R%?[N]]%.q:VIEW%
:select @CurrentUser = user_name()
[.O:[execute ][exec ]]sp_addextendedproperty [%R%?[N]]'MS_Description',[%R%?[N]]%.q:VIEW%
]

改为:

[if exists (select 1 ? ? ? ? ? ? from ?sys.extended_properties ? ? ? ? ? ?where ?major_id = object_id('[%QUALIFIER%]%VIEW%') ? ? ? ? ? ? and ? minor_id = 3)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读