Skip to content
Permalink
Browse files

mejorando sintaxis para sqlserver

faltaba un ")"
  • Loading branch information...
dalacost committed Mar 8, 2019
1 parent d93e1b4 commit d1a2dadeb14a56e8fe7b7bc19baf0927ab1012d4
Showing with 5 additions and 5 deletions.
  1. +2 −2 BD/SQLServer_utf8/BDCUT_CL__SQLServer_utf8__generado.sql
  2. +3 −3 SCRIPT/formatos/sqlserver.json
@@ -17,8 +17,8 @@ Autor: Roberto Bufadel Silva <jjzd2w@gmail.com>
*************************************************************/

CREATE TABLE region(REGION_ID int NOT NULL DEFAULT '0', REGION_NOMBRE varchar(50) DEFAULT NULL,PRIMARY KEY (REGION_ID) );
CREATE TABLE provincia (PROVINCIA_ID int NOT NULL DEFAULT '0', PROVINCIA_NOMBRE varchar(23) DEFAULT NULL, PRIMARY KEY (PROVINCIA_ID), PROVINCIA_REGION_ID int FOREIGN KEY REFERENCES region(REGION_ID);
CREATE TABLE comuna (COMUNA_ID int NOT NULL DEFAULT '0', COMUNA_NOMBRE varchar(20) DEFAULT NULL, COMUNA_PROVINCIA_ID int FOREIGN KEY REFERENCES provincia (PROVINCIA_ID), PRIMARY KEY (COMUNA_ID);
CREATE TABLE provincia (PROVINCIA_ID int NOT NULL DEFAULT '0', PROVINCIA_NOMBRE varchar(23) DEFAULT NULL, PRIMARY KEY (PROVINCIA_ID), PROVINCIA_REGION_ID int FOREIGN KEY REFERENCES region(REGION_ID) );
CREATE TABLE comuna (COMUNA_ID int NOT NULL DEFAULT '0', COMUNA_NOMBRE varchar(20) DEFAULT NULL, COMUNA_PROVINCIA_ID int FOREIGN KEY REFERENCES provincia (PROVINCIA_ID), PRIMARY KEY (COMUNA_ID) );

INSERT INTO region(REGION_ID, REGION_NOMBRE) VALUES(1, 'Tarapacá');
INSERT INTO region(REGION_ID, REGION_NOMBRE) VALUES(2, 'Antofagasta');
@@ -29,8 +29,8 @@
},
"pre": [
"\nCREATE TABLE ${regionesTable}(${regionId} int NOT NULL DEFAULT '0', ${regionName} varchar(50) DEFAULT NULL,PRIMARY KEY (${regionId}) );\n",
"CREATE TABLE ${provinciasTable} (${provinciaId} int NOT NULL DEFAULT '0', ${provinciaName} varchar(23) DEFAULT NULL, PRIMARY KEY (${provinciaId}), ${provinciaRegionId} int FOREIGN KEY REFERENCES ${regionesTable}(${regionId});\n",
"CREATE TABLE ${comunasTable} (${comunaId} int NOT NULL DEFAULT '0', ${comunaName} varchar(20) DEFAULT NULL, ${comunaProvinciaId} int FOREIGN KEY REFERENCES ${provinciasTable} (${provinciaId}), PRIMARY KEY (${comunaId});\n\n"
"CREATE TABLE ${provinciasTable} (${provinciaId} int NOT NULL DEFAULT '0', ${provinciaName} varchar(23) DEFAULT NULL, PRIMARY KEY (${provinciaId}), ${provinciaRegionId} int FOREIGN KEY REFERENCES ${regionesTable}(${regionId}) );\n",
"CREATE TABLE ${comunasTable} (${comunaId} int NOT NULL DEFAULT '0', ${comunaName} varchar(20) DEFAULT NULL, ${comunaProvinciaId} int FOREIGN KEY REFERENCES ${provinciasTable} (${provinciaId}), PRIMARY KEY (${comunaId}) );\n\n"
],
"regiones": "INSERT INTO ${regionesTable}(${regionId}, ${regionName}) VALUES(${_id}, '${_name}');\n",
"pre-provincias": [
@@ -41,4 +41,4 @@
"\n"
],
"comunas": "INSERT INTO ${comunasTable}(${comunaId}, ${comunaName}, ${comunaProvinciaId}) VALUES (${_id}, '${_name}', ${_provinciaId});\n"
}
}

0 comments on commit d1a2dad

Please sign in to comment.
You can’t perform that action at this time.