Skip to content

Commit

Permalink
mejorando sintaxis para sqlserver
Browse files Browse the repository at this point in the history
faltaba un ")"
  • Loading branch information
dalacost committed Mar 8, 2019
1 parent d93e1b4 commit d1a2dad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions BD/SQLServer_utf8/BDCUT_CL__SQLServer_utf8__generado.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
6 changes: 3 additions & 3 deletions SCRIPT/formatos/sqlserver.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -41,4 +41,4 @@
"\n"
],
"comunas": "INSERT INTO ${comunasTable}(${comunaId}, ${comunaName}, ${comunaProvinciaId}) VALUES (${_id}, '${_name}', ${_provinciaId});\n"
}
}

2 comments on commit d1a2dad

@jjzd2w
Copy link

@jjzd2w jjzd2w commented on d1a2dad May 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pueden agregarme en la referencia de autores por favor.

@dalacost
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

veo que estas en la lista y en las referencias https://github.com/knxroot/bdcut-cl/blob/master/AUTHORS.md :)

Please sign in to comment.