【Sql Server】数据库常用的语句

    记录下数据库常用的一些语句,太基础的就不写了

1.分页的几种写法

2.表关联操作

3.分组相关

4.查看死锁正在执行的的进程

--查看
select object_name(resource_associated_entity_id) as tableName, request_session_id as pid from sys.dm_tran_locks
where resource_type = 'OBJECT'

--查看具体的语句或者存储过程什么的
DBCC INPUTBUFFER(1401)

--杀死进程
kill PID

猜你喜欢

转载自blog.csdn.net/cccc1ssss2/article/details/106875646