SQL Server 2008 Administration in Action
作者:anotherbug 日期:2009-10-26
Microsoft SQL Server Tuning Tips
作者:anotherbug 日期:2009-02-17
Microsoft SQL Server Tuning Tips
The following excerpts are summaries from Microsoft sites on the topics of tuning SQL Server for large production environments. See URL at end for the full 94-page article. We found the following performance-tuning related extracts highlights the article. Judge fo...
The following excerpts are summaries from Microsoft sites on the topics of tuning SQL Server for large production environments. See URL at end for the full 94-page article. We found the following performance-tuning related extracts highlights the article. Judge fo...
ASP.NET 连接 SQL Server 2000, 7.0 数据库
作者:anotherbug 日期:2009-02-04
ASP.NET 连接 SQL Server 2000, 7.0 数据库
ODBC
--------------------------------------------------------------------------------
提示输入用户名密码的方式
你必须先设置连接对象的提示属性为"adPromptAlways",然后再使用链接字串链接到数据库。
oConn.Properties("Prompt") = adPromptAlways Driver={SQL Server};Server=myServerAddr...
ODBC
--------------------------------------------------------------------------------
提示输入用户名密码的方式
你必须先设置连接对象的提示属性为"adPromptAlways",然后再使用链接字串链接到数据库。
oConn.Properties("Prompt") = adPromptAlways Driver={SQL Server};Server=myServerAddr...
sqlserver STR
作者:anotherbug 日期:2009-02-01
STR
由数字数据转换来的字符数据。
语法
STR ( float_expression [ , length [ , decimal ] ] )
参数
float_expression
是带小数点的近似数字 (float) 数据类型的表达式。不要在 STR 函数中将函数或子查询用作 float_expression。
length
是总长度,包括小数点、符号、数字或空格。默认值为 10。
decimal
是小数点右边的位数。
返回类型
char
注释
如果为 STR 提供 length 和 decimal 参数值,则这些值应...
由数字数据转换来的字符数据。
语法
STR ( float_expression [ , length [ , decimal ] ] )
参数
float_expression
是带小数点的近似数字 (float) 数据类型的表达式。不要在 STR 函数中将函数或子查询用作 float_expression。
length
是总长度,包括小数点、符号、数字或空格。默认值为 10。
decimal
是小数点右边的位数。
返回类型
char
注释
如果为 STR 提供 length 和 decimal 参数值,则这些值应...
标签: Sqlserver
sqlserver sp_textcopy 写二进制数据
作者:anotherbug 日期:2009-02-01
SQLSERVER设置一周的第一天 SET DATEFIRST
作者:anotherbug 日期:2008-08-21
SET DATEFIRST
将一周的第一天设置为从 1 到 7 之间的一个数字。
语法
SET DATEFIRST { number | @number_var }
参数
number | @number_var
是一个整数,表示一周的第一天,可以是下列值中的一个。
值 一周的第一天是
1 星期一
2 星期二
3 星期三
4 星期四
5 星期五
6 星期六
7(默认值,美国英语) 星期日
注释
使用 @@DATEFIRST 函数检查 SET DATEFIRST 的当前设置。
SET DATEFIRST 的设置是在执...
将一周的第一天设置为从 1 到 7 之间的一个数字。
语法
SET DATEFIRST { number | @number_var }
参数
number | @number_var
是一个整数,表示一周的第一天,可以是下列值中的一个。
值 一周的第一天是
1 星期一
2 星期二
3 星期三
4 星期四
5 星期五
6 星期六
7(默认值,美国英语) 星期日
注释
使用 @@DATEFIRST 函数检查 SET DATEFIRST 的当前设置。
SET DATEFIRST 的设置是在执...
SQLServer日期计算
作者:anotherbug 日期:2008-08-07
一个月的第一天
2008-08-01 00:00:00.000
本周星期一
2008-08-04 00:00:00.000
一年第一天
2008-01-01 00:0...
CODE:
SELECT DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)
2008-08-01 00:00:00.000
本周星期一
CODE:
SELECT DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)
2008-08-04 00:00:00.000
一年第一天
CODE:
SELECT DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)
2008-01-01 00:0...
Java调用Sqlserver存储过程例子
作者:anotherbug 日期:2008-03-19
一朋友要个JAVA调存储过程例子。
[code]
private static final String ADD_XXX =
"{call pr_add_xxx(?,?,?,?,?,?,?,?,?)}";
public int addUserMoney(long uid, BigDecimal amount, int from_type,
BigDecimal in_money, long op_uid, String detail) {
Connection ...
[code]
private static final String ADD_XXX =
"{call pr_add_xxx(?,?,?,?,?,?,?,?,?)}";
public int addUserMoney(long uid, BigDecimal amount, int from_type,
BigDecimal in_money, long op_uid, String detail) {
Connection ...
Sequoia中不同DB的connectionTestStatement SQL
作者:anotherbug 日期:2007-11-28
Specify a value for the connectionTestStatement attribute. This SQL
statement is used by the controller after a failed request execution to check if the
connection is still valid. The connection test statement should not update the
database because if the connection is still valid, the database s...
statement is used by the controller after a failed request execution to check if the
connection is still valid. The connection test statement should not update the
database because if the connection is still valid, the database s...
标签: mysql SQL Sqlserver oracle sequoia postgresql Derby HSQL MaxDB Firebird InstantDB Interbase
Sqlserver存储过程中调用存储过程,得到输出参数
作者:anotherbug 日期:2007-11-21
Sqlserver高效分页存储过程
作者:anotherbug 日期:2006-12-20
每次只取所需要的记录
以下是列表存储过程
[code]
/*
查询用户物品
*/
CREATE PROCEDURE pr_get_user_goods_list
@uid bigint, -- 用户ID
@id bigint, -- 存放编号
@forward int -- 为0(首页)/1是下翻页,2/3(末页)上翻页
AS
begin
-- 首页
if @forward = 0
select top 20 id, user_id, goods_id, start_date, end_date, add_date, amount, get_type...
以下是列表存储过程
[code]
/*
查询用户物品
*/
CREATE PROCEDURE pr_get_user_goods_list
@uid bigint, -- 用户ID
@id bigint, -- 存放编号
@forward int -- 为0(首页)/1是下翻页,2/3(末页)上翻页
AS
begin
-- 首页
if @forward = 0
select top 20 id, user_id, goods_id, start_date, end_date, add_date, amount, get_type...
SQLSERVER 2000中大小写敏感的实现方式优化
作者:anotherbug 日期:2006-11-27
问题
数据库中存account内容为'aAa' ,注:account为主键
当用以下查询时
一般都提到以下两种方法来解决
或者
[code]
where convert(binary,account)=convert(binary,'aaa')
...
数据库中存account内容为'aAa' ,注:account为主键
当用以下查询时
CODE:
where account = 'aaa' 时能查询出来,此时SQLSERVER执行计划是Cluster index seek
一般都提到以下两种方法来解决
CODE:
where account = 'aaa' collate Chinese_PRC_CS_AI
或者
[code]
where convert(binary,account)=convert(binary,'aaa')
...
Sqlserver中利用系统存储过程sp_password修改密码
作者:anotherbug 日期:2006-11-15
在SQL查询分析器里执行
以上这句话将sa密码改为another
sp_password
添加或更改 Microsoft SQL Server 登录的密码。
语法
sp_password [ ][ @old = ] 'old_password' , ]
{ [ @new =] 'new_password' }
[ , ][ @loginame = ] 'login' ]
参数
[@old =] 'old_password'
是旧密码。old_password 为 s...
CODE:sp_password null,'another','sa'
以上这句话将sa密码改为another
sp_password
添加或更改 Microsoft SQL Server 登录的密码。
语法
sp_password [ ][ @old = ] 'old_password' , ]
{ [ @new =] 'new_password' }
[ , ][ @loginame = ] 'login' ]
参数
[@old =] 'old_password'
是旧密码。old_password 为 s...
jtds驱动与Sqlserver的类型对应表
作者:anotherbug 日期:2006-11-15
[code]
jTDS native type mapping
Below is the mapping between native SQL types and java objects.
Native type Java Object JDBC Type Comment
Numeric types
tinyint java.lang.Integer TINYINT
smallint java.lang.Integer SMALLINT
unsigned smallint java.lang.Integer INTEGER Sybase ...
jTDS native type mapping
Below is the mapping between native SQL types and java objects.
Native type Java Object JDBC Type Comment
Numeric types
tinyint java.lang.Integer TINYINT
smallint java.lang.Integer SMALLINT
unsigned smallint java.lang.Integer INTEGER Sybase ...






