争怎路由网/应用软件/内容

更改自定义数据分类精度

应用软件2024-04-25 阅读
数据库,简而言之可视为电子化的文件柜——存储电子文件的处所,用户可以对文件中的数据进行新增、截取、更新、删除等操作。所谓“数据库”是以一定方式储存在一起、能与多个用户共享、具有尽可能小的冗余度、与应用程序彼此独立的数据集合。
/*--修改自定义数据类型精度的示例
     自定义数据类型一旦被引用,就不能再修改和删除,如果要修改数据的精度,就非常麻烦,下面的示例演示了如何修改
     假设要修改的自定义变量名为aa
--*/
--1.修改自定义变量类型的名称
exec sp_rename ’aa’,’aa_bak’,’USERDATATYPE’
go
--2.新增自定义变量(按新的精度)
EXEC sp_addtype N’aa’, N’numeric(20,2)’, N’not null’
go
--3.修改表,使用新增的自定义变量
declare @s varchar(8000)
declare tb cursor local 
for select ’alter table [’+object_name(a.id)+’] alter column [’
 +a.name+’] aa’
from syscolumns a join systypes b on a.xusertype=b.xusertype
where b.name=’aa_bak’
open tb
fetch next from tb into @s
while @@fetch_status=0
begin
 exec(@s)
 fetch next from tb into @s
end
close tb
deallocate tb

全新的路由器不仅让你更稳定快速地连接无线网络,更可以让家中的智能设备连接在一起。



……

相关阅读