摘要:
在执行跨服务器查询之前,运行 exec sp_configure 'show advanced options',1 reconfigure exec sp_configure 'Ad Hoc Distributed Queries',1 reconfigure 查询结束后,运行 exec sp_configure 'Ad Hoc Distributed Queries',0 reconfigur... 阅读全文
摘要:
行列互转 create table test(id int,name varchar(20),quarter int,profile int) insert into test values(1,'a',1,1000)insert into test values(1,'a',2,2000)insert into test values(1,'a',3,4000)insert into test... 阅读全文
摘要:
一些不错的sql语句,自己根据需要收藏吧,分给多点哦:)1、说明:复制表(只复制结构,源表名:a 新表名:b) (Access可用)法一:select * into b from a where 1<>1法二:select top 0 * into b from a 2、说明:拷贝表(拷贝数据,源表名:a 目标表名:b) (Access可用)insert into b(a, b, c) sele... 阅读全文
摘要:
SQL触发器实例讲解1 SQL触发器实例1 定义: 何为触发器?在SQL Server里面也就是对某一个表的一定的操作,触发某种条件,从而执行的一段程序。触发器是一个特殊的存储过程。 常见的触发器有三种:分别应用于Insert , Update , Delete 事件。 我为什么要使用触发器?比如,这么两个表: Create Table Student( --学生表 StudentID int p... 阅读全文