一.查看SQL Server 2005版本号 SELECT @@VERSION 显示以下信息: Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 5.2 (Build 3790: Service Pack 2) SELECT SERVERP
每个地区递归层级可能不一致,数据表(table)存放最小层级地区 area --地区层级表 id name f_id leve 1 中国 0 1 2 湖北 1 2 3 武汉 2 3 ... --测试数据 with area(id,"name",f_id,leve) as ( ,, union all ,, union all ,, union all ,, union all ,, union all ,, union all ,, union all ,, union all ,,
1.查询数据库中所有用户表名:用户表总数. select name from dbo.sysobjects where OBJECTPROPERTY(id,N'IsUserTable')=1 select COUNT(name) from dbo.sysobjects where OBJECTPROPERTY(id,N'IsUserTable')=1
以下是执行的sql代码,只拿简单读取数据举例,其他详细的,请自行查看 reconfigure RECONFIGURE GO GO SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;Database=C:\Users\beige\Desktop\sqltoexcel\Data.xlsx;hdr=yes;imex=1', ICD$) Go SELECT * FROM OPENROWSET('Microsoft.ACE.OL