sql 2005 强制使用执行计划 T—SQl
select * from tt t inner loop join ss s with(nolock) on s.c=t.c
使用 nested join
select * from tt t inner merge join ss s with(nolock) on s.c=t.c
使用 merge join
select * from tt t inner hash join ss s with(nolock) on s.c=t.c
使用 hash jion
nolock 不允许锁
Microsoft SQL Server sometimes uses hash and merge joins when querying large tables when uncomplicated nested loop joins would result in better performance and less server impact. In many such cases, query times go from many milliseconds to many seconds because hash table joins require that large amounts of data be processed and temporarily stored, and merge joins require sorting and then processing similarly large amounts of data.
This is fine for one-time administrative "fact finding" queries where you don't have or want the indices needed to optimize the query, and you're willing to wait the seconds or minutes it takes to get results.
For day-in-and-day-out application queries, however, you don't want your database engine to be hashing or sorting hundreds of thousands or millions of rows, especially when the end result is only a small number of rows.
相关文档:
SQL函数 left()、charindex()的使用
1、left()
LEFT (<character_expression>, <integer_expression>)
返回character_expression 左起 integer_expression 个字符。
2.charindex()
返回字符串中某个指定的子串出现的开始位置。
CHARINDEX (<’substring_expression’>, <expressio ......
MySQL导出和导入SQL脚本
导出sql脚本:
mysqldump -u 用户名 -p 数据库名 > 存放位置
mysqljump -u root -p test > c:\a.sql
导入sql脚本:
要建环境变量或者在bin的目录下,mysql这个命令才能识别。
test是你要导进去的数据库名字,要提前建好~~
mysql -u 用户名 -p 数据库名 < 存放位置
mysqljump -u ro ......
1)
#pragma warning(disable:4146)
#import "C:\Program Files\Common Files\System\ADO\msado15.dll"
named_guids rename("EOF","adoEOF"), rename("BOF","adoBOF")
#pragma warning(default:4146)
using namespace ADODB;
2)
#pragma warning(disable:4146) ......
首先启动SQL SERVER的服务
连接后 在数据库上右键
选择附加。。。
点击 添加。。。
在跳出框内找到你的MDF文件位置 选中 添加进去
相同文件夹内的LDF文件自动加上
完成~~(*^__^*) 嘻嘻……
OK啦 呵呵
初学初学~希望也能帮到其他像我一样的初学者
大家一起加油吧!O(∩_∩)O~ ......