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

»ñÈ¡sqlserverÖÐÊý¾Ý¿âµ±Ç°Á¬½ÓÊý

ÈçºÎ²é¿´SQL SERVERÊý¾Ý¿âµ±Ç°Á¬½ÓÊý
1.ͨ¹ý¹ÜÀí¹¤¾ß
¿ªÊ¼->¹ÜÀí¹¤¾ß->ÐÔÄÜ£¨»òÕßÊÇÔËÐÐÀïÃæÊäÈë mmc£©È»ºóͨ¹ýÌí¼Ó¼ÆÊýÆ÷Ìí¼Ó SQL µÄ³£ÓÃͳ¼Æ È»ºóÔÚÏÂÃæÁгöµÄÏîÄ¿ÀïÃæÑ¡ÔñÓû§Á¬½Ó¾Í¿ÉÒÔʱʱ²éѯµ½Êý¾Ý¿âµÄÁ¬½ÓÊýÁË¡£²»¹ý´Ë·½·¨µÄ»°ÐèÒªÓзÃÎÊÄÇ̨¼ÆËã»úµÄȨÏÞ£¬¾ÍÊÇҪͨ¹ýWindowsÕË»§µÇ½½øÈ¥²Å¿ÉÒÔÌí¼Ó´Ë¼ÆÊýÆ÷¡£
2.ͨ¹ýϵͳ±í²éѯ
 
SELECT * from
[Master].[dbo].[SYSPROCESSES] WHERE [DBID] IN ( SELECT
[DBID]
from
[Master].[dbo].[SYSDATABASES]
WHERE
NAME='DBName'
)
DBName ÊÇÐèÒª²é¿´µÄÊý¾Ý¿â£¬È»ºó²éѯ³öÀ´µÄÐÐÊý£¬¾ÍÊǵ±Ç°µÄÁ¬½ÓÊý¡£²»¹ýÀïÃ滹ÓÐһЩ±ðµÄ״̬¿ÉÒÔ×ö²Î¿¼Óá£
ÀýÈ磺Á¬µ½masterÕâ¸öÊý¾Ý¿âдÈçÏÂÓï¾ä
select * from sysprocesses where dbid in (select dbid from sysdatabases where name='MyDatabase')
½«ËùÓÐÁ¬½ÓMyDatabaseÕâ¸öÊý¾Ý¿âµÄÁ¬½Ó¼Ç¼¶¼Çó³öÀ´¡£
sysprocessesÕâ¸ö±í¼Ç¼ËùÒÔÁ¬½Óµ½SQL SERVERÊý¾Ý¿âµÄÁ¬½Ó¡£
3.ͨ¹ýϵͳµÄ´æ´¢¹ý³ÌÀ´²éÕÒ
 
SP_WHO 'UserName'
UserName Êǵ±È»µÇ½SqlµÄÓû§Ãû£¬Ò»°ã³ÌÐòÀïÃ涼»áʹÓÃÒ»¸öUserNameÀ´µÇ½SQLÕâÑùͨ¹ýÕâ¸öÓû§Ãû¾ÍÄܲ鿴µ½´ËÓû§ÃûµÇ½֮ºóÕ¼ÓõÄÁ¬½ÓÁË¡£
Èç¹û²»Ð´UserName£¬ÄÇô·µ»ØµÄ¾ÍÊÇËùÓеÄÁ¬½Ó¡£
 


Ïà¹ØÎĵµ£º

oracleºÍsqlserver²éѯʱ×èÈûÇé¿ö

1.oracle»·¾³
create table test
(
id number(4),
name varchar2(20)
)
ÔÚÒ»¸ösessionÖÐ
insert into test values(1,'aa');
ÔÚÁíÒ»¸ösessionÖÐ
select * from test1;
²éѯû±»×èÈû
2.sqlserver»·¾³
ÔÚÒ»¸ösessionÖÐ
insert into test values(1,'aa');
ÔÚÁíÒ»¸ösessionÖÐ
select * from test1;
²éѯ±»×èÈû(Ê ......

SQLSERVERÓû§È¨ÏÞ¹ÜÀíÊý¾Ý¿â

Óû§È¨ÏÞ¹ÜÀí
Ò»¡¢·þÎñÆ÷µÇ¼ÕʺźÍÓû§ÕʺŹÜÀí
1.SQL Server·þÎñÆ÷µÇ¼¹ÜÀí
²»¹ÜʹÓÃÄÄÖÖÈÏ֤ģʽ£¬Óû§¶¼±ØÐëÏȾ߱¸ÓÐЧµÄÓû§µÇ¼Õʺš£SQL ServerÓÐÈý¸öĬÈϵÄÓû§µÇ¼Õʺţº¼´sa¡¢Builtin\administratorsºÍguest¡£saÊÇϵͳ¹ÜÀíÔ±(system administrator)µÄ¼ò³Æ£¬ÊÇÒ»¸öÌØÊâµÄÓû§£¬ÔÚSQL ServerϵͳºÍËùÓÐÊý¾Ý¿âÖÐÓ ......

SQLServerÖÐÎÄ´¦Àí

Ê×ÏȲå¾äÌâÍâ»°£º´´½¨Ò»¸ö×ÔÈ»Êý±íNums¡£ÕâÊÇ¡¶SQL Server 2005¼¼ÊõÄÚÄ»£ºT-SQL²éѯ¡·Ò»ÊéµÄ½¨Òé¡£
ÔÚSQL Server 2005ÖУ¬¿ÉÒÔ½èÓÃROW_NUMBERÅÅÃûº¯ÊýÇáËÉÉú³ÉÎÒÃÇËùÐèµÄ×ÔÈ»Êý±í£º
--×ÔÈ»Êý±í1-1M
CREATE TABLE Nums(n int NOT NULL PRIMARY KEY CLUSTERED)
WITH B1 AS(SELECT n=1 UNION ALL SELECT n=1), --2
B2 AS( ......

SQLserverÖÐÓÃconvertº¯Êýת»»ÈÕÆÚ¸ñʽ

SQLserverÖÐÓÃconvertº¯Êýת»»ÈÕÆÚ¸ñʽ
2008-01-23 15:47
SQLserverÖÐÓÃconvertº¯Êýת»»ÈÕÆÚ¸ñʽ2008-01-15 15:51SQLserverÖÐÓÃconvertº¯Êýת»»ÈÕÆÚ¸ñʽ
SQL ServerÖÐÎÄ°æµÄĬÈϵÄÈÕÆÚ×Ö¶Îdatetime¸ñʽÊÇyyyy-mm-dd Thh:mm:ss.mmm
ÀýÈç:
select getdate()
2004-09-12 11:06:08.177
ÕûÀíÁËÒ»ÏÂSQL ServerÀïÃæ¿ÉÄÜ ......

ʹÓÃJavaScriptÁ¬½ÓSqlServerÊý¾Ý¿â¡£Ö´ÐÐCRUD²Ù×÷¡£

function db()
{
//»î¶¯±àºÅ
var activeid = Request.Form("activeid");
//̞
var username = Request.Form("username");
//ÊÖ»úºÅÂë
var mobile = Request.Form("mobile");
var conn= Server.CreateObject("ADODB.connection");
var rs= Serve ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ