is there standard sql that works in all database -


as seen below syntax different different database .isnt there standard way works in databases. there tool convert sql sql

sqlserver2005:

 create table table01 (    field01  int  primary key identity(1,1)    ) 

sqlite:

create table table01 (   field01  integer primary key autoincrement not null unique ); 

the "query" part of sql (commonly called dml - data manipulation language) reasonably standardized, , queries written on 1 database run on database if no "vendor enhancement" features used. "create database bits" parts of sql (often known ddl - data definition language) not standardized, , every database out there little differently. so, you've discovered, statements such create table written 1 database not work without tweaking on database.

<soapbox>
in opinion thing. ddl defines can created in database. if vendors use exactly same ddl, products going exactly same in terms of features support. example, in order allow table inheritance in postgresql there must way define how 1 table inherits another, , definition must part of how table defined, either part of create table statement or in other fashion, has ddl statement. thus, purely functional reasons (because postgresql supports feature databases not) ddl in postgresql must different in other databases. similar situation arises in mysql because allows use of different isam engines different capabilities. similar situations arise in oracle...and in sql server...and <your favorite database here>.

standards double-edged sword. 1 one hand they're great thing, because provide "standard" way of doing something. on other hand they're terrible thing because purpose of standard provide "standard" way of doing something, way of saying "create stagnation , inhibit innovation".
</soapbox>

share , enjoy.


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -