1、@@ROWCOUNT可以判斷上一行查詢(xún)操作得到的列數(shù); 2、給變量賦值用SET @Pr_id = 13; 3、察看是否有符合條件的記錄IF EXISTS (Select name FROM sysobjects Where name = 'reminder' AND type = 'TR');
說(shuō)明特別是第一個(gè),感覺(jué)在寫(xiě)Proce的時(shí)候,可以好好的運(yùn)用 Create Proc Add @n char(10) as Select a from Table1 where a = @n if(@@RowCount<>0) Begin Update .... End Else Begin Insert .......... End