½â¾ö sql server 2005 expressÖÐsa²»ÄܵǼ
1.ʹÓÃManagement Studio Express£¬ÓÓWindowsÉí·ÝÑéÖ¤”µÇ¼£¬Ñ¡ÖÐSQL·þÎñÆ÷Ãû£¬ÓÒ»÷Êó±êÑ¡ÔñÊôÐÔ£¬ÔÚ·þÎñÆ÷ÊôÐÔÑ¡ÏîÒ³Ã棬ѡÔñ“°²È«ÐÔ”£¬½«·þÎñÆ÷Éí·ÝÑéÖ¤ÓÉ “WindowsÉí·ÝÑéÖ¤”¸ÄΪ“SQL ServerºÍWindowsÉí·ÝÑéÖ¤”£¬µ¥»÷È·¶¨¡£
2.ʹÓÃSQL Server 2005ÍâΧӦÓÃÅäÖÃÆ÷£¬Ñ¡Ôñ“·þÎñºÍÁ¬½ÓµÄÍâΧӦÓÃÅäÖÃÆ÷”£¬Ñ¡SQL Express-->Database Engine-->·þÎñ£¬ÏÈÍ£Ö¹£¬ÔÙÆô¶¯£¬ÖØÆôSQL Server·þÎñÆ÷¡£
3.Ôٻص½Management Studio Express£¬Ñ¡Ôñ“°²È«ÐÔ”-->µÇ¼Ãû-->sa£¬ÓÒ»÷Êó±ê£¬ÔڵǼÊôÐÔ-saÒ³Ã棬ѡÔñ״̬£¬½«µÇ¼ÓÉ“½ûÓÔ¸ÄΪ“ÆôÓÔ£¨´Ëʱ¿ÉÉèÖÃsaµÇ¼ÃÜÂë»òÈ¡ÏûµÇ¼ÃÜÂ룬ÔÚ³£¹æÑ¡ÏîÖУ©£¬µ¥»÷È·¶¨¡£
Ïà¹ØÎĵµ£º
²Î¼û¡¶SQL Sever 2005 Êý¾Ý¿â»ù´¡¼°Ó¦Óü¼Êõ½Ì³ÌÓëʵѵ¡· ÖÜÆæ
SQL ServerÖÐÓÐÎåÖÖÔ¼ÊøÀàÐÍ£¬·Ö±ðÊÇCHECKÔ¼Êø¡¢DEFAULTÔ¼Êø¡¢PRIMARY KEYÔ¼Êø¡¢FOREIGN KEYÔ¼ÊøºÍUNIQUEÔ¼Êø¡£
1. CHECKÔ¼Êø£º
CHECKÔ¼ÊøÓÃÓÚÏÞÖÆÊäÈëÒ»Áлò¶àÁеÄÖµµÄ·¶Î§£¬Í¨¹ýÂß¼±í´ïʽÀ´ÅжÏÊý¾ ......
CREATE proc [dbo].[proc_DeleteTemplet] (@templeId varchar(15),@errorMessage varchar(50) output)
as
begin
declare @error int
set @error =0
begin tran
delete from tc_templet_Head where fBillNo=@templeId
set @error=@error+@@error
delete from tc_templet_ ......
Ò»¡¢Çé¿ö˵Ã÷
sql server 2000ÒÔÇ°µÄ°æ±¾£¬ÀýÈç7.0Ò»°ã²»´æÔÚ¶à¸ö°æ±¾£¬Ö»Óбê×¼°æ¸ú×ÀÃæ°æ£¬Óû§Èç¹û²»Çå³þ¸Ãװʲô°æ±¾µÄ»°£¬¿É°´°²×°ÉϵÄ
°²×°ÏȾöÌõ¼þָʾ°²×°£¬Ò»°ãÔÚWIN2000 ·þÎñÆ÷°æÉÏ×°±ê×¼°æ£¬ÆäËûµÄϵͳװ×ÀÃæ°æµÄ¾Í¿ÉÒÔ£»¶øSQL Server 2000°²×°ÎÊÌâ¾Í±È½Ï´ó£¬Ê±³£
¼ûµ½µÄÎÊÌâÈçÏ£º
......
һֱûÓÐÕÒµ½Ò»Öֺõķ½·¨À´ÒýÓÃÓзµ»ØÖµµÄ´æ´¢¹ý³ÌµÄ·½·¨£¬Ê¹ÎÒÔÚÌí¼ÓÊý¾ÝÖÐ×ßÁ˲»ÉÙµÄÍä·£¬×î½ü£¬ÔÚ²éÔÄÁË´óÁ¿µÄ×ÊÁÏÖ®ºó£¬ÖÕÓÚÔÚ΢ÈíµÄÒ»¸öʵÀýÖÐÕÒµ½ÁËÒ»ÖÖÁ¼ºÃµÄ·½·¨¡£
Ê×ÏȱàдºÃÒ»Óзµ»ØÖµµÄ´æ´¢¹ý³Ì
create procedure proc_name
@para1 nchar(20), --ÊäÈë²ÎÊý
@ ......