![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sqlServer
acycwf
......
展开
-
通过经纬度计算两点位置的距离
通过经纬度计算两点位置的距离原创 2020-07-28 17:06:26 · 490 阅读 · 0 评论 -
sql 循环写法
1.while 循环declare @orderNum varchar(255)create table #ttableName(id int identity(1,1),Orders varchar(255))declare @n int,@rows intinsert #ttableName(orders) select orderNum from pe_Orders where orderId<50--select @rows=count(1) from pe_Orderssel原创 2022-03-23 10:56:18 · 5382 阅读 · 0 评论 -
sql行转列
sql行转列原创 2022-03-23 10:45:44 · 206 阅读 · 0 评论 -
sql server 查询所有表名及注释
SELECT DISTINCT d.name, f.valueFROM syscolumns a LEFT JOIN systypes b ON a.xusertype= b.xusertype INNER JOIN sysobjects d ON a.id= d.id AND d.xtype= 'U' AND d.name<> 'dtproperties' LEFT JOIN syscomments e ON a.cdef...转载 2021-11-11 09:16:21 · 1794 阅读 · 1 评论 -
sql 查看表字段和注释
------sqlserver 查询某个表的列名称、说明、备注、类型等SELECT 表名 = case when a.colorder=1 then d.name else '' end, 表说明 = case when a.colorder=1 then isnull(f.value,'') else '' end, 字段序号 = a.colorder, 字段名 = a.name, 标识 = case when COLU...转载 2021-09-20 00:35:30 · 1357 阅读 · 0 评论 -
sql 查询死锁和消灭死锁
select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName from sys.dm_tran_locks where resource_type='OBJECT'declare @spid intSet @spid = 52 --锁表进程declare @sql varchar(1000)set @sql='kill '+cast(@spid as varchar)exec(@sql).原创 2021-05-09 21:16:09 · 131 阅读 · 0 评论 -
数据库死锁查询sql
USE [milaibao]GO/****** Object: StoredProcedure [dbo].[sp_who_lock] Script Date: 11/21/2019 15:59:41 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER PROCEDURE [dbo].[sp_who_lock...原创 2019-11-21 16:01:11 · 581 阅读 · 0 评论