SQL生成随机字符串
declare @str varchar(50)
declare @i int
set @str = ''
set @i=0
while @i<50
begin
set @str = @str + char(33 + cast(ceiling(rand() * 80) as int))
set @i = @i+1
end
select @str
相关文档:
SQL 常用语句以及函数之一
SELECT --从数据库表中检索数据行和列
INSERT --向数据库表添加新数据行
DELETE --从数据库表中删除数据行
UPDATE --更新数据库表中的数据
--数据定义
CREATE TABLE --创建一个数据库表
DROP TABLE --从数据库中删除表
......
MS SQL Server查询优化方法
作者:xmllover 2007-11-29
查询速度慢的原因很多,常见如下几种
1、没有索引或者没有用到索引(这是查询慢最常见的问题,是程序设计的缺陷)
2、I/O吞吐量小,形成了瓶颈效应。
3、没有创建计算列导致查询不优化。
4、内存 ......
在SQL Server 2005 Express 上附加从另外一台电脑Copy过来的数据库后,数据库为“只读”。
解决办法:
打开 SQL Server Configuration Manager, 打开SQL Server SQLEXPRESS 的属性
在内置帐号处,把“网络服务”改成“本地系统”,重新启动SQL Server 2005 Express 后,再附加数据 ......
http://www.sql-server-performance.com/tips/clustered_indexes_p1.aspx
As a rule of thumb, every table should have a clustered index. Generally, but not always, the clustered index should be on a column that monotonically increases--such as an identity column, or some other column where the value is ......
我定义了一个 textarea:
<tr bgcolor="#CCCCCC" align="center" valign="bottom">
<td align="right" valign="top" class="style1" >文章内容:</td>
&nbs ......