sql数字转英文
create function decodehundred(@hundredstring varchar(300) )
returns varchar(1000)
as
begin
declare @tmp varchar(1000),@decodehundred varchar(1000)
set @decodehundred = ''
declare @strno1 varchar(1000)
select @strno1 = 'One Two Three Four Five ' +
'Six Seven Eight Nine Ten ' +
'Eleven Twelve Thirteen Fourteen Fifteen '+
'Sixteen Seventeen Eighteen Nineteen '
declare @strtens1 varchar(1000)
set @strtens1 = 'Ten Twenty Thirty Forty Fifty ' +
'Sixty Seventy Eighty Ninety '
declare @unit4 varchar(10)
set @unit4 = 'Hundred'
if len(@hundredstring) > 0 and len(@hundredstring) <= 3
begin
if len(@hundredstring) = 1
begin
set @tmp = cast(@hundredstring as int)
if @tmp <> 0
set @decodehundred =
&
相关文档:
---返回表达式中指定字符的开始位置
select charindex('c','abcdefg',1)
---两个字符的值之差
select difference('bet','bit')
---字符最左侧指定数目
select left('abcdef',3)
---返回字符数
select len('abcdefg')
--转换为小字符
select lower('ABCDEFG')
--去左空格后
select ltrim(' &nbs ......
行列转换
create table test(id int,name varchar(20),quarter int,profile int)
insert into test values(1,'a',1,1000)
insert into test values(1,'a',2,2000)
insert into test values(1,'a',3,4000)
insert into test values(1,'a',4,5000)
insert into test values(2,'b',1,3000)
insert into test values(2, ......
启动 MS SQL SERVER (2000 -2008都适用):
cmd>net start mssqlserver
启动 非缺省实例:
cmd>net start mssql$[instance name]
注:命令行需要有Administrator权限。
停止SQLSERVER 服务器:
cmd>net stop mssqlserver
cmd>net stop mssql$[instance name] ......
语法:
isnull(check_expression,replacement_expression)
参数check_expression与replacement_expression类型需相同
返回值:
若check_expression为null,则返回replacement_expression
若check_expression不为null,则返回check_expression ......