SqlServer ±í ½âËø
--spid:ËÀËøµÄ½ø³Ì,tableName :ËÀËøµÄ±í
select request_session_id spid,OBJECT_NAME(resource_associated_entity_id)tableName from sys.dm_tran_locks
where resource_type='OBJECT'
--spid:Òª½áÊøµÄ½ø³Ìid
kill spid
Ïà¹ØÎĵµ£º
import pymssql
#connect database
conn=pymssql.connect(host="192.168.1.28",user="boomink",password="boomink",
database="boomink")
cur=conn.cursor()
print '========================================'
cur.execute("exec Orders_GetTest1 @Valu ......
µÚÒ»ÖÖ JavaScriptÁ¬½ÓÊý¾Ý¿â£º
<mce:script language="JavaScript"><!--
// ´´½¨Êý¾Ý¿â¶ÔÏó
var objdbConn = new ActiveXObject("ADODB.Connection");
// DSN×Ö·û´®
var strdsn = "Driver={SQL Server};SERVER=192.168.0.210;UID=xhb;PWD=xhb;DATABASE=books";
// ´ò¿ªÊý¾ÝÔ´
objdbConn.Open(strdsn);
// ......
Ë÷ÒýµÄÖØÒªÐÔ
Êý¾Ý¿âÐÔÄÜÓÅ»¯ÖÐË÷Òý¾ø¶ÔÊÇÒ»¸öÖØÁ¿¼¶µÄÒòËØ£¬¿ÉÒÔ˵£¬Ë÷ÒýʹÓò»µ±£¬ÆäËüÓÅ»¯´ëÊ©½«ºÁÎÞÒâÒå¡£
¾Û´ØË÷Òý
(Clustered Index)ºÍ·Ç¾Û´ØË÷Òý
(Non- Clustered Index)
×îͨË׵ĽâÊÍÊÇ:¾Û´ØË÷ÒýµÄ˳Ðò¾ÍÊÇÊý¾ÝµÄÎïÀí´æ´¢Ë³Ðò£¬¶ø¶Ô·Ç¾Û´ØË÷ÒýµÄË÷Òý˳ÐòÓëÊý¾ÝÎïÀíÅÅÁÐ˳ÐòÎ޹ء£¾ÙÀýÀ´Ëµ£¬Äã·µ½Ð»ª×ÖµäµÄº ......
//×ܼǼÊý
function sumRecord()
{
var conn= Server.CreateObject("ADODB.connection");
var rs= Server.CreateObject("adodb.recordset");
conn.open("PROVIDER=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;PWD=123456;DATABASE=test");
var sql = "select count(*) as RecordCount from baoming";
rs.open(sql, ......