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

SqlServerÈ«¾Ö±äÁ¿±¸Íü


È«¾Ö±äÁ¿ÊÇSQL ServerϵͳÄÚ²¿ÊÂÏȶ¨ÒåºÃµÄ±äÁ¿£¬²»ÓÃÓû§²ÎÓ붨Ò壬¶ÔÓû§¶øÑÔ£¬Æä×÷Ó÷¶Î§²¢²»¾ÖÏÞÓÚijһ³ÌÐò£¬¶øÊÇÈκγÌÐò¾ù¿ÉËæÊ±µ÷Óá£È«¾Ö±äÁ¿Í¨³£ÓÃÓڴ洢һЩSQL ServerµÄÅäÖÃÉ趨ֵºÍЧÄÜͳ¼ÆÊý¾Ý¡£
SQL ServerÒ»¹²ÌṩÁË30¶à¸öÈ«¾Ö±äÁ¿£¬±¾½ÚÖ»¶ÔһЩ³£ÓñäÁ¿µÄ¹¦ÄܺÍʹÓ÷½·¨½øÐнéÉÜ¡£È«¾Ö±äÁ¿µÄÃû³Æ¶¼ÊÇÒÔ@@¿ªÍ·µÄ¡£
£¨1£©@@CONNECTIONS
¼Ç¼×Ô×îºóÒ»´Î·þÎñÆ÷Æô¶¯ÒÔÀ´£¬ËùÓÐÕë¶ÔÕą̂·þÎñÆ÷½øÐеÄÁ¬½ÓÊýÄ¿£¬°üÀ¨Ã»ÓÐÁ¬½Ó³É¹¦µÄ³¢ÊÔ¡£
ʹÓÃ@@CONNECTIONS¿ÉÒÔÈÃϵͳ¹ÜÀíÔ±ºÜÈÝÒ׵صõ½½ñÌìËùÓÐÊÔͼÁ¬½Ó±¾·þÎñÆ÷µÄÁ¬½ÓÊýÄ¿¡£
£¨2£©@@CUP_BUSY
¼Ç¼×ÔÉÏ´ÎÆô¶¯ÒÔÀ´³¢ÊÔµÄÁ¬½ÓÊý£¬ÎÞÂÛÁ¬½Ó³É¹¦»¹ÊÇʧ°Ü£¬¶¼ÒÔmsΪµ¥Î»µÄCPU¹¤×÷ʱ¼ä¡£
£¨3£©@@CURSOR_ROWS
·µ»ØÔÚ±¾´Î·þÎñÆ÷Á¬½ÓÖУ¬´ò¿ªÓαêÈ¡³öÊý¾ÝÐеÄÊýÄ¿¡£
£¨4£©@@DBTS
·µ»Øµ±Ç°Êý¾Ý¿âÖÐtimestampÊý¾ÝÀàÐ͵ĵ±Ç°Öµ¡£
£¨5£©@@ERROR
·µ»ØÖ´ÐÐÉÏÒ»ÌõTransact-SQLÓï¾äËù·µ»ØµÄ´íÎó´úÂë¡£
ÔÚSQL Server·þÎñÆ÷Ö´ÐÐÍêÒ»ÌõÓï¾äºó£¬Èç¹û¸ÃÓï¾äÖ´Ðгɹ¦£¬Ôò½«·µ»Ø@@ERRORµÄֵΪ0£¬Èç¹û¸ÃÓï¾äÖ´Ðйý³ÌÖз¢Éú´íÎó£¬Ôò½«·µ»Ø´íÎóµÄÐÅÏ¢£¬¶ø@@ERROR½«·µ»ØÏàÓ¦µÄ´íÎó±àºÅ£¬¸Ã±êºÅ½«Ò»Ö±±£³ÖÏÂÈ¥£¬Ö±µ½ÏÂÒ»ÌõÓï¾äµÃµ½Ö´ÐÐΪֹ¡£
ÓÉÓÚ@@ERRORÔÚÿһÌõÓï¾äÖ´Ðкó±»Çå³ý²¢ÇÒÖØÖã¬Ó¦ÔÚÓï¾äÑéÖ¤ºóÁ¢¼´¼ì²éËü£¬»ò½«Æä±£´æµ½Ò»¸ö¾Ö²¿±äÁ¿ÖÐÒÔ±¸Êºó²é¿´¡£
ʾÀý£º
ÔÚ“pubs”Êý¾Ý¿âÖÐÐ޸ēauthors”Êý¾Ý±íʱ£¬ÓÃ@@ERROR¼ì²âÏÞÖÆ²éѯ³åÍ»¡£
ͼ1  ÐÞ¸ÄÊý¾Ýʱ¼ì²â´íÎó
SQLÓï¾äÈçÏ£º
USE pubs
GO
UPDATE authors SET au_id = '172 32 1176'
WHERE au_id = '172-32-1176'
IF @@ERROR = 547
print 'A check constraint violation occurred'
£¨6£©@@FETCH_STATUS
·µ»ØÉÏÒ»´ÎʹÓÃÓαêFETCH²Ù×÷Ëù·µ»ØµÄ״ֵ̬£¬ÇÒ·µ»ØÖµÎªÕûÐÍ¡£
±í1  @@FETCH_STATUS·µ»ØÖµµÄÃèÊö
ÀýÈ磬µ½ÁË×îºóÒ»ÐÐÊý¾Ýºó£¬»¹Òª½Ó×ÅÈ¡ÏÂÒ»ÐÐÊý¾ÝµÈ£¬·µ»ØµÄֵΪ−2£¬±íʾ·µ»ØµÄÖµÒѾ­¶ªÊ§¡£
£¨7£©@@IDENTITY
·µ»Ø×î½üÒ»´Î²åÈëµÄidentityÁеÄÊýÖµ£¬·µ»ØÖµÊÇnumeric¡£
ʾÀý£º
ÔÚ“pugs”Êý¾Ý¿âÖеējobs”Êý¾Ý±íÖУ¬²åÈëÒ»ÐÐÊý¾Ý£¬²¢ÓÃ@@identityÏÔʾÐÂÐеıêʶֵ¡£SQLÓï¾äÈçÏ£º
USE pubs
INSERT INTO jobs (job_desc,min_lvl,max_lvl)
VALUES ('Accountant',12,125)
SELECT @@IDENTITY AS 'Identity'
£¨8£©@@IDLE
·µ»ØÒÔmsΪµ¥Î»¼ÆËãSQL Server·þÎñÆ÷×Ô


Ïà¹ØÎĵµ£º

Êý¾Ý½»»»Ñ§Ï°¶þ£ºasp.net C# ¶Ô sqlserver±íµÄ²Ù×÷

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient; ......

sqlserver »ù´¡ÖªÊ¶´óÕûÀí

SQL-Structured Query Language
--(¿ªÆôSQL·þÎñ£ºnet start mssqlserver)
--(ÔÚÃüÁîÐÐÖÐÊäÈë'sqlwb'ÃüÁî¿É´ò¿ªSQL¹ÜÀíÆ÷ )
--(Èç¹ûÒªÖ´ÐжàÌõÃüÁîÖеÄÒ»Ìõ,Êó±êÑ¡¶¨ºóÔÙ°´F5Ö´ÐÐ)
create database sales                   ......

SQLServerºÍOracleµÄ³£Óú¯Êý¶Ô±È

1.¾ø¶ÔÖµ 
S:select abs(-1) value
O:select abs(-1)  value from dual
2.È¡Õû(´ó) 
S:select ceiling(-1.001) value  
O:select ceil(-1.001)  value from dual
3.È¡Õû£¨Ð¡£© 
S:select floor(-1.001) value  
O:select floor(-1.001)  value from dual
4.È ......

SQLServerÖÐÅúÁ¿²åÈëÊý¾Ý·½Ê½µÄÐÔÄܶԱÈ

×òÌìÏÂÎç¿ìϰàµÄʱºò£¬ÎÞÒâÖÐÌýµ½¹«Ë¾Á½Î»Í¬ÊÂÔÚ̽ÌÖÅúÁ¿ÏòÊý¾Ý¿â²åÈëÊý¾ÝµÄÐÔÄÜÓÅ»¯ÎÊÌ⣬¶ÙʱÀ´ÁËÐËȤ£¬°Ñ×Ô¼ºµÄÏë·¨ÏòÁ½Î»Í¬ÊÂ˵ÁËһϣ¬ÓÚÊÇÓÐÁ˱¾ÎÄ¡£
¹«Ë¾¼¼Êõ±³¾°£ºÊý¾Ý¿â·ÃÎÊÀࣨxxx.DataBase.Dll£©µ÷Óô洢¹ý³ÌʵÏÖÊý¾Ý¿âµÄ·ÃÎÊ¡£
¼¼Êõ·½°¸Ò»£º
ѹËõʱ¼äϳÌÐòԱд³öµÄµÚÒ»¸ö°æ±¾£¬½ö½öΪÁËÍê³ÉÈÎÎñ£¬Ã»ÓÐ´Ó³Ì ......

sqlserverºÍmysqlµÄÐÐתÁÐͨÓô洢¹ý³Ì

sqlserverÖУº
  1 /*
  2 1 * Description:¶ÔÊý¾Ý±í½øÐÐÐÐÁÐת»»
  3 2 * Author:llf
  4 3 * µ÷ÓÃ˵Ã÷£ºexec SP_RowChangeCol 'ѧÉú³É¼¨±í','ÐÕÃû','¿Î³Ì','·ÖÊý','desc',0,0,'where Äê¼¶=''Ò»Äê¼¶'''
& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ