例子:
declare @a varchar(max)
set @a=replicate(cast('a' as varchar(max)),10000)
select datalength(@a)
select @a
说明:
1.replicate,重复一个值N次,如:select replicate ('ABC', 30)
2.cast类型转换,如:select cast('2008-9-1' as smalldatetime)
例子:
declare @a varchar(max)
set @a=replicate(cast('a' as varchar(max)),10000)
select datalength(@a)
select @a
说明:
1.replicate,重复一个值N次,如:select replicate ('ABC', 30)
2.cast类型转换,如:select cast('2008-9-1' as smalldatetime)