SQL Server 2008 Spatial, PostgreSQL/PostGIS 1.3
General Overview
FeatureSQL Server 2008 (RC0)MySQL 5.1/6PostgreSQL 8.3/PostGIS 1.3/1.4
OS
Windows XP, Windows Vista, Windows 2003, Windows 2008
Windows XP, Windows Vista, (haven't tested on 2008), Linux, Unix, Mac
Windows 2000+ (including Vista and 2003, haven't tested on 2008), Linux, Unix, Mac
Licensing
Commercial - Closed Source, Various levels of features based on version, Express version has full spatial support but limitation on database size and only use one processor.
Commercial Open Source (COSS), some parts GPL. Here is an interesting blog entry on the subject MySQL free software but not Open Source. The comments are actually much more informative than the article itself.
FLOSS (PostgreSQL is BSD, PostGIS is GPL Open Source - you can use for commercial apps but if you make changes to the core libraries of PostGIS, you need to give that back to the community)
Free GIS Data Loaders
shp dataloader for SQL Server 2008 developed by Morten Nielsen (doesn't yet work with RC0)
OGR2OGR, shp2mysql.pl script
included shp2pgsql, OGR2OGR, QuantumGIS SPIT, SHP loader for PostGIS also developed by Morten using SharpMap.NET various others
Commercial GIS Data Loaders
Manifold, Safe FME Objects, ESRI ArcGIS 9.3 (in a later service pack)
Safe FME Objects
Manifold, FME Objects, ESRI ArcGIS 9.3
Application drivers available specifically for spatial component
? Not yet - SharpMap.NET eventually and probably built into new ADO.NET 3.5+
GDAL C++, SharpMap via OGR, AutoCAD FDO
SharpMap.Net, JDBC postgis.jar included with postgis, JTS etc. tons for Java, GDAL C++, AutoCad FDO beta support
Free Object/Relational Mapping
NHibernateSpatial (this is a .NET object relational spatial mapper) - beta support
Hibernate Spatial - this is a java object relational mapper
NHibernateSpatial and HibernateSpatial
Free Desktop Viewers and Editors
Will be built into SQL Manager, but not available in RC0 and only useful for viewing
GvSig
OpenJump, QuantumGIS, GvSig, uDig
相关文档:
--查看CPU利用率
-- CREATE PROCEDURE sp_GetTop10_CPU () AS
BEGIN
SET NOCOUNT ON
DECLARE @cinterval char(8)
DECLARE @interval int
SET @cinterval = '00:00:10'
CREATE TABLE #thread
(
RUN INT NOT NULL,
SPI ......
create table #a
(
a int identity(1,1) primary key,
b int default(0) not null,
c nvarchar(20)
)
insert into #a(c)
select 'a' union all
select 'b' union all
select 'c' union all
select 'd' union all
select 'e'
select * from #a
alter table #a drop constraint DF__#a_____________b__12 ......
ORDER BY 排序
ASC 升序(默认)
DESC 降序
select * from s_emp order by dept_id , salary desc
部门号升序,工资降序
关键字distinct也会触发排序操作。
select * from employee order by 1; //按第一字段排序
NULL被认为无穷大。order by 可以跟别名。
select table_name ......
1. 说明:复制表(只复制结构,源表名:a,新表名:b)
SQL: select * into b from a where 1<>1;
2. 说明:拷贝表(拷贝数据,源表名:a,目标表名:b)
SQL: insert into b(a, b, c) select d, e, f from b;
&nb ......
在某些场合下,存储过程或触发器里的SQL语句需要动态生成。Oracle的DBMS_SQL包可以用来执行动态SQL语句。本文通过一个简单的例子来展示如何利用DBMS_SQL包执行动态SQL语句:
DECLARE
v_cursor NUMBER;
v_stat NUMBER;
& ......