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,conn);
TotalRecords = rs('RecordCount');
}
function baoming()
{
//¼ÆËã×ܵÄÒ³Êý
TotalPages = (((TotalRecords % PageSize) == 0) ? (TotalRecords / PageSize)
: (TotalRecords / PageSize + 1));
//»ñÈ¡´«²Î¹ýÀ´µÄÒ³Êý
var toppage;
var home = Request.Form("home");
var up = Request.Form("up");
var uppage = parseInt(Request.Form("uppage"));
var down = Request.Form("down");
var downpage = parseInt(Request.Form("downpage"));
if(home=="Ê×Ò³")
{
CurPageNum = 1;
}else if(up=="ÉÏÒ»Ò³")
{
toppage = uppage;
//Response.Write("<mce:script type="text/javascript"><!--
alert('"+toppage+"');
// --></mce:script>");
CurPageNum = toppage-1;
//Response.Write("<mce:script type="text/javascript"><!--
alert('"+CurPageNum+"');
// --></mce:script>");
if(CurPageNum <= 0)
{
CurPageNum = 1;
}
}else if(down=="ÏÂÒ»Ò³")
{
toppage = downpage;
//Response.Write("<mce:script type="text/javascript"><!--
alert('"+toppage+"');
// --></mce:script>");
CurPageNum = toppage+1;
//Response.Write("<mce:script type="text/javascript"><!--
alert('"+CurPageNum+"');
// --></mce:script>");
if (CurPageNum >= TotalPages)
{
CurPageNum = TotalPages;
}
}
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 top "+PageSize+" truename,activeid,chrtel,CONVERT(varchar(30),dtappenddate,20) as dtappenddate from baoming where id not in(select top "+(PageSize*(CurPageNum-1))+" id from baoming order
Ïà¹ØÎĵµ£º
ugmbbc·¢²¼ÓÚ 2009-11-14 09:41:43| 7628 ´ÎÔĶÁ ×ÖÌ壺´ó С ´òÓ¡Ô¤ÀÀ
var ReTitle = '»Ø¸´:Google ÅÅÃûÖÐµÄ 10 ¸ö×îÖøÃûµÄ JavaScript ¿â';
¸ÐлCOMSHARP CMSµÄͶµÝ
ÐÂÎÅÀ´Ô´:tripwiremagazine.com
JavaScript ÊÇ Web ¿ª·¢ÓëÉè¼ÆÖв»¿É»òȱµÄ¶«Î÷£¬²»¹ÜÊÇÒ»¸ö¼òµ¥µÄÍøÒ³»¹ÊÇÒ»¸öרҵµÄÕ¾µã£¬Ò²²»¹ÜÄãÊǸßÊÖ»¹ÊDzËÄñ ......
µÚÒ»ÖÖ 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 ±íÖе±Ö®Ç°ÓмǼµÄʱºò·¢ÏÖ±íÉè¼ÆµÄ²»ºÏÀíÒª¼Ó×ֶΣ¬
µ«ÊÇalter table Skating_Consumption add MemberCardId numeric(9)Ö»ÄܼӿÉΪ¿ÕµÄ×ֶΣ¬
½â¾ö°ì·¨£¬
µÚÒ»¡¢¼Ó¸öΪ¿ÕµÄ×Ö¶Î
µÚ¶þ¡¢¸üбíÖмǼÕâ¸ö×Ö¶ÎΪij¸öÖµ
µÚÈý¡¢ÔÙ¸ü¸Ä±í×Ö¶ÎΪ·Ç¿Õ
Óï¾ä
alter table Skating_Consumption add MemberCardId nu ......
Ë÷ÒýµÄÖØÒªÐÔ
Êý¾Ý¿âÐÔÄÜÓÅ»¯ÖÐË÷Òý¾ø¶ÔÊÇÒ»¸öÖØÁ¿¼¶µÄÒòËØ£¬¿ÉÒÔ˵£¬Ë÷ÒýʹÓò»µ±£¬ÆäËüÓÅ»¯´ëÊ©½«ºÁÎÞÒâÒå¡£
¾Û´ØË÷Òý
(Clustered Index)ºÍ·Ç¾Û´ØË÷Òý
(Non- Clustered Index)
×îͨË׵ĽâÊÍÊÇ:¾Û´ØË÷ÒýµÄ˳Ðò¾ÍÊÇÊý¾ÝµÄÎïÀí´æ´¢Ë³Ðò£¬¶ø¶Ô·Ç¾Û´ØË÷ÒýµÄË÷Òý˳ÐòÓëÊý¾ÝÎïÀíÅÅÁÐ˳ÐòÎ޹ء£¾ÙÀýÀ´Ëµ£¬Äã·µ½Ð»ª×ÖµäµÄº ......
²é¿´ÊÇ·ñÇø·Ö´óСд-Ö´Ðд洢¹ý³Ìsys.sp_server_info
exec sys.sp_server_info
²é¿´µÚ18ÐÐCOLLATION_SEQ-collationÊôÐÔ
charset=cp936 collation=Chinese_PRC_CS_AS
csΪÇø·Ö´óСд£¬CIΪ²»Çø·Ö´óСд
½«Çø·Ö´óСд¸ÄΪ²»Çø·Ö´óСд
alter database yourDB COLLATE Chinese_PRC_CI_AS
½«²»Çø·Ö´óСд¸ÄΪÇø·Ö´óСд
......