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

SQL Server´æ´¢¹ý³ÌµÄÃüÃû±ê×¼


ÔÚ±¾ÎÄÖУ¬´ËʾÀý±ê×¼À¶Í¼µÄ´æ´¢¹ý³ÌÃüÃû·½·¨Ö»ÊÊÓÃÓÚSQLÄÚ²¿£¬¼ÙÈçÄãÕýÔÚ´´½¨Ò»¸öеĴ洢¹ý³Ì£¬»òÊÇ·¢ÏÖÒ»¸öûÓа´ÕÕÕâ¸ö±ê×¼¹¹ÔìµÄ´æ´¢¹ý³Ì£¬¼´¿ÉÒԲο¼Ê¹ÓÃÕâ¸ö±ê×¼¡£
×¢ÊÍ£º¼ÙÈç´æ´¢¹ý³ÌÒÔsp_ Ϊǰ׺¿ªÊ¼ÃüÃûÄÇô»áÔËÐеÄÉÔ΢µÄ»ºÂý£¬ÕâÊÇÒòΪSQL Server½«Ê×ÏȲéÕÒϵͳ´æ´¢¹ý³Ì£¬ËùÒÔÎÒÃǾö²»ÍƼöʹÓÃsp_×÷Ϊǰ׺¡£
´æ´¢¹ý³ÌµÄÃüÃûÓÐÕâ¸öµÄÓï·¨£º
[proc] [MainTableName] By [FieldName(optional)] [Action]
[ 1 ] [ 2 ] [ 3 ]¡¡¡¡[ 4 ]
(1) ËùÓеĴ洢¹ý³Ì±ØÐëÓÐǰ׺'proc'. ËùÓеÄϵͳ´æ´¢¹ý³Ì¶¼ÓÐǰ׺"sp_", ÍƼö²»Ê¹ÓÃÕâÑùµÄǰ׺ÒòΪ»áÉÔ΢µÄ¼õÂý¡£
(2) ±íÃû¾ÍÊÇ´æ´¢¹ý³Ì·ÃÎʵĶÔÏó¡£
(3) ¿ÉÑ¡×Ö¶ÎÃû¾ÍÊÇÌõ¼þ×Ӿ䡣 ÀýÈ磺
procClientByCoNameSelect, procClientByClientIDSelect
(4) ×îºóµÄÐÐΪ¶¯´Ê¾ÍÊÇ´æ´¢¹ý³ÌÒªÖ´ÐеÄÈÎÎñ¡£  
Èç¹û´æ´¢¹ý³Ì·µ»ØÒ»Ìõ¼Ç¼ÄÇôºó׺ÊÇ£ºSelect
Èç¹û´æ´¢¹ý³Ì²åÈëÊý¾ÝÄÇôºó׺ÊÇ£ºInsert
Èç¹û´æ´¢¹ý³Ì¸üÐÂÊý¾ÝÄÇôºó׺ÊÇ£ºUpdate
Èç¹û´æ´¢¹ý³ÌÓвåÈëºÍ¸üÐÂÄÇôºó׺ÊÇ£ºSave
Èç¹û´æ´¢¹ý³Ìɾ³ýÊý¾ÝÄÇôºó׺ÊÇ£ºDelete
Èç¹û´æ´¢¹ý³Ì¸üбíÖеÄÊý¾Ý (ie. drop and create) ÄÇôºó׺ÊÇ£ºCreate
Èç¹û´æ´¢¹ý³Ì·µ»ØÊä³ö²ÎÊý»ò0£¬ÄÇôºó׺ÊÇ£ºOutput
Àý×Ó£º
Ò»¸ö½ö½ö·µ»ØÒ»¸öÊä³ö²ÎÊýµÄ´æ´¢¹ý³Ì:
ALTER PROCEDURE procClientRateOutput
         @pstrClientID VARCHAR(6) = 'CABLE',
         @pstrCategoryID VARCHAR(6) = '<All>',
         @pstrEmpID VARCHAR(6)='AC',
         @pdteDate datetime = '1996/1/1',
         @curRate MONEY OUTPUT
AS
-- Description: Get the $Rate for this client and this employee
--          and this category from Table ClientRate
SET @curRate = (
                SELECT TOP 1 Rate
                from ClientRate
 &n


Ïà¹ØÎĵµ£º

½â¾öSQL ServerתACCESS×Ô¶¯±àºÅÎÊÌâ


1.´ò¿ªSQL server enterprise mananger “ÆóÒµ¹ÜÀíÆ÷”
ÔÚÄãÒªµ¼³öµÄSQLÊý¾Ý¿âÉÏÊó±êÓÒ¼ü²Ëµ¥£ºËùÓÐÈÎÎñ-¡·µ¼³öÊý¾Ý
2.»Ø³öÏÖÒ»¸öµ¼³öÏòµ¼´°¿Ú¡£
Ñ¡Ôñ±»µ¼³öµÄÊý¾ÝÔ´£¬ÎªÄã¸Õ²ÅËùÑ¡ÔñµÄÊý¾Ý¿â£¬Èç¹û·¢ÏÖ²»¶ÔÓ¦×ÔÐÐÐ޸ġ£
3.½øÈëµ¼³öµ½Ä¿±êÊý¾ÝÔ´µÄÑ¡Ôñ£¬ÕâÀïÎÒÃÇҪת³ÉACCESSµÄÊý¾Ý¿â¡£×¢ÒâÑ¡ÔñÊý¾ÝÔ´ÀàÐÍÎ ......

[ÊÕ£] ÓÃsqlite Ö´Ðбê×¼ sql Óï·¨

http://www.umgr.com/blog/PostView.aspx?bpId=36294
 1. Ö´ÐÐsqlÓï¾ä
int sqlite3_exec(sqlite3*£¬ const char *sql£¬ sqlite3_callbacksql Óï·¨
£¬ void *£¬  char **errmsg );
Õâ¾ÍÊÇÖ´ÐÐÒ»Ìõ sql Óï¾äµÄº¯Êý¡£
µÚ1¸ö²ÎÊý²»ÔÙ˵ÁË£¬ÊÇÇ°Ãæopenº¯ÊýµÃµ½µÄÖ¸Õ롣˵ÁËÊǹؼüÊý¾Ý½á¹¹¡£
µÚ2¸ö²ÎÊýconst char ......

SQLÓï¾äÓÅ»¯·½·¨

1.Ö»²éѯÐèÒªµÄÁУ¬²»ÓÃ*
2.INÊʺÏÓÚÍâ±í´ó¶øÄÚ±íСµÄÇé¿ö£»EXISTSÊʺÏÓÚÍâ±íС¶øÄÚ±í´óµÄÇé¿ö 1¡¢Éý¼¶Ó²¼þ
2¡¢¸ù¾Ý²éѯÌõ¼þ,½¨Á¢Ë÷Òý,ÓÅ»¯Ë÷Òý¡¢ÓÅ»¯·ÃÎÊ·½Ê½£¬ÏÞÖƽá¹û¼¯µÄÊý¾ÝÁ¿¡£
3¡¢À©´ó·þÎñÆ÷µÄÄÚ´æ
4¡¢Ôö¼Ó·þÎñÆ÷CPU¸öÊý
5¡¢¶ÔÓÚ´óµÄÊý¾Ý¿â²»ÒªÉèÖÃÊý¾Ý¿â×Ô¶¯Ôö³¤£¬Ëü»á½µµÍ·þÎñÆ÷µÄÐÔÄÜ ......

[ת]SQL 2005ÖÐ×Ô¶¯Éú³ÉÊý¾Ý×Öµä

create proc [dbo].[GenerateDataDictionary] as
begin
--»ñÈ¡Êý¾Ý±íÃû
declare  @tableid int
declare mycursor Cursor
for select object_id from sys.objects where type='U' and name<>'dtproperties'
--»ñÈ¡×Ö¶ÎÃû³Æ¡¢±êʶ¡¢×Ö¶ÎÐòºÅ¡¢Õ¼ÓÃ×Ö½ÚÊý¡¢Ð¡ÊýλÊý¡¢ÔÊÐí¿Õµ ......

ÊÕ¼¯µÄÓÖÒ»µÀÓÐȤµÄSQLÌâ

×÷Õß: ÈýÊ®¶øÁ¢Ê±¼ä£º2009Äê10ÔÂ15ÈÕ 21:59:51±¾Îijö×Ô ¡°inthirties£¨ÈýÊ®¶øÁ¢£©¡±²©¿Í£¬×ªÔØÇëÎñ±Ø×¢Ã÷×÷Õߺͱ£Áô³ö´¦http://blog.csdn.net/inthirties/archive/2009/10/15/4673268.aspx °Ñ´ÎÐò²»¶ÔµÄÁÐÕÒ³öÀ´ ÇëÎÊ ÏÂÃæµÄ±í¸ÃÈçºÎÅÅÐò£¿ÎÒÓÐÏÂÃæµÄ±í¡£´ÎÐòÈçÏ ÆäÖеÚ5¸ö¼Ç¼ºÍµÚ6Ìõ¼Ç¼´ÎÐòµßµ¹ÁË¡£Õâ¸ö±íÊý¾ÝÁ¿±È½Ï ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ