摘要:
select语句中只能使用sql函数对字段进行操作(链接sql server),select 字段1 from 表1 where 字段1.IndexOf("云")=1;这条语句不对的原因是indexof()函数不是sql函数,改成sql对应的函数就可以了。left()是sql函数。select 字段...
阅读全文
posted @ 2014-08-18 14:38
Doris_丁
阅读(448)
推荐(0)
编辑
摘要:
对目前的数据库的运行状况有一个基本的了解SELECT TOP ( 10 )DB_NAME(a.dbid) AS dbname ,loginame ,spid ,cpu ,b.text ,lastwaittype ,waitresource ,a.[status] ,hostname AS WebSe...
阅读全文
posted @ 2014-08-18 14:05
Doris_丁
阅读(271)
推荐(0)
编辑
摘要:
--sql server中开启xp_cmdshell命令1、--允许配置高级选项EXEC sp_configure 'show advanced options', 1GORECONFIGUREGO2、--开启xp_cmdshell服务EXEC sp_configure 'xp_cmdshell',...
阅读全文
posted @ 2014-08-18 14:02
Doris_丁
阅读(1098)
推荐(1)
编辑
摘要:
导出的格式形如:use databasename;goSELECT 'databasename' AS 数据库名, a.name as '表名' , isnull(e.value,'') as '表注释', CONVERT(VARCHAR(19), a.create_date ,...
阅读全文
posted @ 2014-08-18 13:58
Doris_丁
阅读(301)
推荐(0)
编辑
摘要:
Round():函数返回一个数值,舍入到指定的长度或精度eg:--1) Round( 123.9994 , 3 ) ---->123.9990 Round( 123.9995 , 3 ) ---->124.0000 --3为需要舍入的位数--2) Round( 123.45, -2...
阅读全文
posted @ 2014-08-18 11:26
Doris_丁
阅读(439)
推荐(0)
编辑
摘要:
CAST和CONVERT:都是将一种数据类型转换成为另一种数据类型。CAST:CAST ( expression AS data_type [ ( length ) ] )EG: CAST(ListPrice AS varchar(12))cast(Round(SalesYTD / commissi...
阅读全文
posted @ 2014-08-18 11:02
Doris_丁
阅读(285)
推荐(0)
编辑