SQL SERVER ´æ´¢¹ý³Ì¼òµ¥°¸Àý
Ò»¡¢¼òµ¥ÊµÀý
1.Ê×ÏÈÀ´Ò»¸ö×î¼òµ¥µÄ´æ´¢¹ý³Ì°É
CREATE PROCEDURE dbo.testProcedure_AX
AS
select userID from USERS order by userid desc
×¢:dbo.testProcedure_AXÊÇÄã´´½¨µÄ´æ´¢¹ý³ÌÃû,¿ÉÒÔ¸ÄΪ:AXzhzµÈ,±ð¸ú¹Ø¼ü×Ö³åÍ»¾ÍÐÐÁË,ASÏÂÃæ¾ÍÊÇÒ»ÌõSQLÓï¾ä.
2.ÈçºÎÔÚASP.NETÖе÷ÓÃÕâ¸ö´æ´¢¹ý³Ì?
public static string GetCustomerCName(ref ArrayList arrayCName,ref ArrayList arrayID)
{
SqlConnection con=ADConnection.createConnection();
SqlCommand cmd=new SqlCommand("testProcedure_AX",con);
cmd.CommandType=CommandType.StoredProcedure;
con.Open();
try
{
SqlDataReader dr=cmd.ExecuteReader();
while(dr.Read())
{
if(dr[0].ToString()=="")
{
arrayCName.Add(dr[1].ToString());
}
}
con.Close();
return "OK!";
}
catch(Exception ex)
&nbs
Ïà¹ØÎĵµ£º
#region µÃµ½ËùÓб¾µØÍøÂçÖпÉʹÓõÄSQL·þÎñÆ÷Áбí
/// <summary>
/// µÃµ½ËùÓб¾µØÍøÂçÖпÉʹÓõÄSQL·þÎñÆ÷Áбí
/// </summary>
/// <param name="p_strServerList">·þÎñÆ÷Áбí</param& ......
·½·¨Ò»
µÚÒ»²½£ºµÇÈësql/plus Ö´ÐÐÃüÁÎÞÏȺó˳Ðò£©
set time on; (˵Ã÷£º´ò¿ªÊ±¼äÏÔʾ£©
set autotrace on; (˵Ã÷£º´ò¿ª×Ô¶¯·ÖÎöͳ¼Æ£¬²¢ÏÔʾSQLÓï¾äµÄÔËÐнá¹û£©
set autotrace traceonly; (˵à ......
[תÔØ]http://www.cnblogs.com/cn_wpf/£¬·Ç³£¸ÐлNineteen@newsmth µÄ·Ö·ÖÏí¡£
дÓÐЧÂʵÄSQL²éѯ£¨I£©
´óÐÍϵͳµÄÉú²ú»·¾³£¬Ò»°ãÇé¿öÏ£¬ÎÒÃÇÆÀ¼ÛÒ»Ìõ²éѯÊÇ·ñÓÐЧÂÊ£¬¸ü¶àµÄÊǹØ×¢Âß¼IO(ÖÁÓÚΪʲô£¬»ØÍ·²¹Ò»Æª)¡£ÎÒÃdz£Ëµ£¬“Òª½¨±ëº·µÄË÷Òý”¡¢“Ҫд¸ßЧµÄSQL”£¬Æäʵ×îÖÕÄ¿µÄ¾ÍÊÇÔÚÏà ......
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE data ......
ѧ»áÊý¾Ý¿âÊǺÜʵÓÃD~~¼Ç¼һЩ³£ÓõÄsqlÓï¾ä...ÓÐÈëÃÅÓÐÌá¸ßÓмû¶¼Ã»¼û¹ýµÄ...ºÃÈ«...ÊÕ²ØÏÂ...
Æäʵһ°ãÓõľÍÊDzéѯ,²åÈë,ɾ³ýµÈÓï¾ä¶øÒÑ....µ«Ñ§Ñ§´æ´¢¹ý³ÌÊǺÃÊÂ...ÒÔºóÊý¾Ý·½ÃæµÄ¶«Î÷¾Í²»ÓÃÔÚ³ÌÐòÀï¸ãà¶..¶øÇÒ³ÌÐòÓëÊý¾Ý¿âÖ»ÒªÒ»¸öÀ´»ØͨѶ¾Í¿ÉÒԸ㶨ËùÓÐÊý¾ÝµÄ²Ù×÷....
Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
Create DAT ......