From: | "Yoel Mc Lennan" <yoelnatanael(at)hotmail(dot)com> |
---|---|
To: | <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Convertir SQL a POSTGRES complejo o herramienta similar a DatatierGenerator pero para PostgreSql |
Date: | 2007-03-15 15:04:56 |
Message-ID: | BAY129-DAV13F2EB108E9E3527C5CC92CC720@phx.gbl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Guenas gente, a ver si alguien me tira una idea para esto?, estoy como perro
en bote....
quiero convertir esta código escrito para SQL a postgres, no se por donde
empezar, me parece que estoy frito no?
en realidad quiero adaptar el DatatierGenerator for Enterprise Library
(escrito para usar con SQL a Postgres), si alguien conoce una erramienta que
haga algo parecido y sirva para Postgresql, creo que me ahorrare dolores de
cabeza. (basicamente es un programa para generar las PL de insert, update,
get, etc.. de las tablas elegidas.)
Gracias.
Yoel Mc Lennan.
SELECT
TABLE_CATALOG,
TABLE_SCHEMA,
TABLE_NAME,
TABLE_TYPE,
ExtendedProperty.value AS ProgrammaticAlias
FROM
INFORMATION_SCHEMA.TABLES
LEFT JOIN ::FN_LISTEXTENDEDPROPERTY('ProgrammaticAlias', 'user', 'dbo',
'table', default, default, default) AS ExtendedProperty ON
INFORMATION_SCHEMA.TABLES.TABLE_NAME = ExtendedProperty.objname
WHERE
TABLE_TYPE = 'BASE TABLE'
AND TABLE_NAME != 'dtProperties'
AND TABLE_CATALOG = '#DatabaseName#'
---
SELECT
INFORMATION_SCHEMA.COLUMNS.*,
COL_LENGTH('#TableName#', INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME) AS
COLUMN_LENGTH,
COLUMNPROPERTY(OBJECT_ID('#TableName#'),
INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME, 'IsComputed') AS IsComputed,
COLUMNPROPERTY(OBJECT_ID('#TableName#'),
INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME, 'IsIdentity') AS IsIdentity,
COLUMNPROPERTY(OBJECT_ID('#TableName#'),
INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME, 'IsRowGuidCol') AS IsRowGuidCol,
ExtendedProperties.value AS ProgrammaticAlias
FROM
INFORMATION_SCHEMA.COLUMNS
LEFT JOIN ::fn_listextendedproperty('ProgrammaticAlias', 'user', 'dbo',
'table', '#TableName#', 'column', default) AS ExtendedProperties ON
INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME = ExtendedProperties.objname
WHERE
INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = '#TableName#'
From | Date | Subject | |
---|---|---|---|
Next Message | JOSE CODARLUPO | 2007-03-15 15:07:21 | acerac de union |
Previous Message | Marcos Renedo | 2007-03-15 15:02:03 | whit oids |