- 博客(4)
- 收藏
- 关注
转载 导入导出大全
一、打開另外一個數據庫 1. 打開SQL server2000的另一個數據庫的表 (1). select * from openrowset('sqloledb','sprogram';'develop';'11111','select * from kind') (2). select * from openrowset('sqloledb','190.1.1.247';'develop';
2013-08-07 13:55:38
867
转载 SQL Server中行列转换 Pivot UnPivot
SQL Server中行列转换 Pivot UnPivot PIVOT用于将列值旋转为列名(即行转列),在SQL Server 2000可以用聚合函数配合CASE语句实现 PIVOT的一般语法是:PIVOT(聚合函数(列) FOR 列 in (…) )AS P 完整语法: table_source PIVOT( 聚合函数(value_column) FOR pivot_c
2013-07-10 14:12:02
477
原创 数据库中数据导入前的验证并且转换代码.
if object_id('sp_insert_data','p')is not null drop proc sp_insert_data go create proc sp_insert_data as begin begin try begin tran declare @message1 varchar(max) decl
2013-05-08 15:10:34
835
转载 Sql Server数据库性能优化需注意哪些地方
1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如: select id from t where num is null 可以在num上设置默认值0,确保表中num列没有null值,然后这样查询: sele
2013-05-02 09:17:50
516
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅