Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : sqlserver

¡¾ÇóÖú¡¿sqlserver¿ÉÒÔ´´½¨Ö»ÓеǼȨÏÞµÄÓû§Âð

SqlServer´´½¨Óû§Ê±Ä¬ÈϾ͸³ÓèÁËÒ»¸öpublic½ÇÉ«¡£
ÎÒÊÇ·ñ¿ÉÒÔ´´½¨Ò»¸öÓû§£¬ÈÃÕâ¸öÓû§Ö»ÓеǼµÄȨÏÞ£¬Ã»ÓÐÆäËûµÄȨÏÞ£¡

ÎÒµÄÊý¾Ý¿âÊÇSqlServer2000

SQL code:
--Ìí¼ÓµÇ¼ wh1,ÉèÖÃÃÜÂëΪ123,ĬÈÏÊý¾Ý¿â
EXEC sp_addlogin 'wh1','123'


ÕâÑù´´½¨ÒÔºó¾ÍÖ»ÓеǼµÄȨÏÞ

ÒýÓÃ
public½ÇÉ«²»¿ÉÒÔÈ¥µôµ ......

vs Á¬½Ó sqlserver ²åÈëÊý¾Ý´úÂë¡¢¡¢¡¢¡¢¡¢Çó¾È

C# code:

//Ôö¼ÓÒ»ÌõÊý¾Ý¡£¡£¡£¡£¡£
public int AddAdmin(string UID, string PWD)
{
string sql = "insert into Admin(_uid,_pwd)values(@UID,@PWD)";
SqlParameter[] parameters = new SqlParameter[2];
parameters[0] = new SqlParameter("@UID", UID);
......

sqlserver ´æ´¢¹ý³ÌʵÏÖÎÞÏÞ¼¶·ÖÀà²éѯ

´ó¼ÒºÃÏÖÔÚÓÐ Ò»¸öÎÞÏÞ¼¶·ÖÀà±í  ÎÒÏë²éѯÈÎÒâÒ»¸ö·ÖÀàÏÂÃæËùÓеÄ×ÓÀࣨÎÞÏÞ¼¶µÄ£©¸ÃÈçºÎʵÏÖÄØ

ÓÃÊ÷Óڽṹ

http://blog.csdn.net/soft_wsx/archive/2009/09/04/4521091.aspx

½á¹¹£¬¼Ç¼
......

Ôõô»ñÈ¡sqlserver×îºó²åÈëÐÐÄÚµÄ×ֶΣ¿

Ö÷¼üÊÇuniqueidentifierÀàÐÍ£¬Ã»ÓÐ×ÔÔö×ֶΡ£¡£

ÕâÑùÓ¦¸ÃÔõô»ñÈ¡£¿


L@_@K
SQL code:
SELECT ISNULL(SCOPE_IDENTITY(), -1) AS [SCOPE_IDENTITY]

°´Ê±¼äÅÅÐò
»ò
guid²»Òª×Ô¶¯Éú³É
ÔÚÌí¼ÓµÄʱºò ÔÚ´úÂëÀïн¨Ò»¸öguid


µ¹ÐðÈ¡×îºóµÄÒ»Ìõ¼Ç¼

¹Ø×¢

ÒýÓÃ
µ¹ÐðÈ¡×îºóµÄÒ»Ìõ¼Ç ......

Çë°ïæ½âÊÍÒ»ÏÂsqlserver¿Í»§¶Ëͳ¼ÆµÄÐÅÏ¢

ÏÂÃæÊÇÎÒµÄͳ¼ÆÐÅÏ¢£º

¿Í»§¶ËÖ´ÐÐʱ¼ä 10:28:48
²éѯÅäÖÃÎļþͳ¼ÆÐÅÏ¢
  INSERT¡¢DELETE ºÍ UPDATE Óï¾äµÄÊýÄ¿ 0 0.0000
  INSERT¡¢DELETE »ò UPDATE Óï¾äÓ°ÏìµÄÐÐÊý 0 0.0000
  SELECT Óï¾äµÄÊýÄ¿ 1 1.0000
  SELECT Óï¾ä·µ»ØµÄÐÐÊý 264 264.0000
  ÊÂÎñÊý ......

SqlServerÖÐ×Ö·ûÐÍת»»ÎªÊý×ÖÐͳöÏîµÄÎÊÌâ

SqlServerÖÐ×Ö·ûÐÍת»»ÎªÊý×ÖÐͳöÏîµÄÎÊÌâ

select  @rno=rno from deleted;
convert(numeric,@rno);
@rno=@rno/1000;

ÏûÏ¢ 156£¬¼¶±ð 15£¬×´Ì¬ 1£¬¹ý³Ì t2£¬µÚ 11 ÐÐ
¹Ø¼ü×Ö 'convert' ¸½½üÓÐÓï·¨´íÎó¡£
select  @rno=rno from deleted;
set @rno = cast(@rno as numeric)
......
×ܼǼÊý:322; ×ÜÒ³Êý:54; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [38] [39] [40] [41] 42 [43] [44] [45] [46] [47]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ