摘要:测试环境SQL Server 2012 select a.definition , b.name,b.is_disabled from sys.sql_modules a inner join sys.triggers b on a.object_id=b.object_id --所有的触发器 se
阅读全文
随笔分类 - SQL Server
MS SQL相关
摘要:SQL Server 1.使用row_number分页 declare @PageSize int = 5 declare @PageIndex int = 1 select * from (select ROW_NUMBER() over(order by SId) RowId,Student.*
阅读全文
摘要:来源:http://www.itpub.net/thread-193247-1-1.html 先保存,以后研究一下 1 *--获取连接SQL服务器的信息 2 3 所有连接本机的:操作的数据库名,计算机名,用户名,网卡物理地址,IP地址,程序名 4 -*/ 5 6 /*--调用示例 7 --显示所有本
阅读全文
摘要:1 --这样是不行的 2 select sys.dm_exec_sql_text(most_recent_sql_handle) from sys.dm_exec_connections 3 4 --这个可以 5 select text from sys.dm_exec_connections a
阅读全文