--insert触发器 createtriggertri_insert onstudent forinsert as declare@student_idchar(10) select@student_id=s.student_idfrom studentsinnerjoininsertedi ons.student_id=i.student_id if@student_id='000000000... Read More
begn transactiondeclare @errorsum intset @errorsum=0执行语句set @errorsum=@errorsum+@@error执行语句set @errorsum=@errorsum+@@errorif(@errorsum<>0)beginrollback transactionendelsebegincommit transactione... Read More
public IList GetArticleAll(int startRowIndex, int maximumRows, string sortstr) { int pa1 = (startRowIndex - 1) * maximumRows + 1; int pa2 = startRowIndex * maximumRo... Read More
/*scroll表示可随意移动游标指针(否则只能向前),dynamic表示可以读写游标(否则游标只读)*/ DECLARE E1cursor cursor scroll dynamic /* 声明游标,默认为FORWARD_ONLY游标 */ FOR SELECT name FROM test OPEN E1cursor /* 打开游标 */ dec... Read More
SELECT s.id,s.name,s.tid,t.typename,c.counts,c.time into #abc FROM foods as s INNER JOIN foodtype as t ON s.tid = t.id INNER JOIN foodcount as c ON s.id=c.fid exec p_qry #abc,typename,[time],count... Read More
/*SELECT s.id,s.name,s.tid,t.typename,c.counts,c.time into #abc FROM foods as s INNER JOIN foodtype as t ON s.tid = t.id INNER JOIN foodcount as c ON s.id=c.fid*/ drop table #abc declare @sql varc... Read More