摘要:
SQL2008 表达式:是常量、变量、列或函数等与运算符的任意组合。 1. 字符串函数 函数 名称 参数 示例 说明 ascii(字符串表达式) select ascii('abc') 返回 97 返回字符串中最左侧的字符的ASCII 码。 char(整数表达式) select char(100) 阅读全文
摘要:
1 if exists(select * from sys.objects where name='test') 2 drop table test 3 go 4 create table test 5 ( 6 id varchar(30), --流水号,日期(8位)+流水号(4位) 7 name varchar(10) --其他字段 ... 阅读全文
摘要:
convert(char(20),getdate(),120)则是对日期字段,进行格式化转换成字符格式的函数 --declare 声明变量 declare @get_time varchar(20)set/select @get_time=CONVERT(VARCHAR(10),GETDATE(), 阅读全文
摘要:
1 USE MASTER 2 GO 3 4 DECLARE @dbname SYSNAME 5 SET @dbname = 'ReportServer' --这个是要删除的数据库库名 6 7 DECLARE @s NVARCHAR(1000) 8 DECLARE tb CURSOR LOCAL 9 FOR ... 阅读全文