Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎĵµ£º

PythonÁ¬½ÓSqlServerÁ·Ï°¼Ç¼


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 ºÍJSP Á¬½ÓSqlServer Êý¾Ý¿â

µÚÒ»ÖÖ 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);
// ......

SQLServerË÷Òýµ÷ÓÅʵ¼ù£¨1£©

Ë÷ÒýµÄÖØÒªÐÔ
Êý¾Ý¿âÐÔÄÜÓÅ»¯ÖÐË÷Òý¾ø¶ÔÊÇÒ»¸öÖØÁ¿¼¶µÄÒòËØ£¬¿ÉÒÔ˵£¬Ë÷ÒýʹÓò»µ±£¬ÆäËüÓÅ»¯´ëÊ©½«ºÁÎÞÒâÒå¡£
¾Û´ØË÷Òý
(Clustered Index)ºÍ·Ç¾Û´ØË÷Òý
(Non- Clustered Index)
×îͨË׵ĽâÊÍÊÇ:¾Û´ØË÷ÒýµÄ˳Ðò¾ÍÊÇÊý¾ÝµÄÎïÀí´æ´¢Ë³Ðò£¬¶ø¶Ô·Ç¾Û´ØË÷ÒýµÄË÷Òý˳ÐòÓëÊý¾ÝÎïÀíÅÅÁÐ˳ÐòÎ޹ء£¾ÙÀýÀ´Ëµ£¬Äã·­µ½Ð»ª×ÖµäµÄº ......

JavaScriptÁ¬½ÓSqlServer²¢ÊµÏÖ·ÖÒ³(¶þ)

//×ܼǼÊý
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, ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ