sql 代码调试

  begin 
	--开启事务
	begin tran 
		--插入
		INSERT INTO [DICTIONARY] (TablName,Column_Id,Column_Name)
		--数据源
		select o.name,c.column_id,c.name   
		from  sys.all_columns c inner  join  sys.objects o
		on c.object_id=o.object_id 
		where o.name='v_job'
		--查询  这里查询结果 检查是否正确 再考虑是否执行提交
		select * from [DICTIONARY] order by Id desc
	--提交事务
	commit
  end 

  

posted @ 2015-11-09 15:50  sifo  阅读(233)  评论(0编辑  收藏  举报