![](https://oss-emcsprod-public.modb.pro/pdf/bef93d71-50c7-4b32-86e2-3313ed8b0fff/bg2.jpg)
对待移植系统进行分析,确定需要移植的数据库对象,给出移植列表,给用户确认,作为移
植的依据,给出
SQLServer
的统计脚本
2.2.1 统计 SQLServer 数据库基础信息
--统计编码格式
SELECT COLLATIONPROPERTY('Chinese_PRC_Stroke_CI_AI_KS_WS',
'CodePage')
--936 简体中文GBK
--950 繁体中文BIG5
--437 美国/加拿大英语
--932 日文
--949 韩文
--866 俄文
--65001 unicode UFT-8
2.2.2 统计 SQLServer 数据中的对象以及表数据量
a. 根据指定用户统计用户下的各对象类型和数目
select type,COUNT(*) from sys.all_objects where schema_id=1 and
parent_object_id=0 and is_ms_shipped=0 group by type;
b. 统计指定用户下所有的对象,并记录到新的记录表中
create table sql_objects(obj_owner varchar(100),obj_name
varchar(100),obj_type varchar(50));
insert into sql_objects select DB_NAME(),name,type from sys.all_objects
where schema_id=1 AND type IN ('U','V','FN','P','TR');
select * from sql_objects;
文档被以下合辑收录
评论