EXEMPLO_1212310
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
sp_tipocampo
Parameters
Name
Type
Mode
@IDTABELA
int
IN
@NOMECAMPO
nvarchar
IN
@TIPO
varchar
INOUT
Definition
--UpgUpgradeServer CREATE PROCEDURE SP_TIPOCAMPO @IDTABELA INT,@NOMECAMPO SYSNAME, @TIPO VARCHAR(100) OUTPUT AS SELECT @TIPO = ( SELECT (CASE WHEN (SYSTYPES.NAME = 'varchar' OR SYSTYPES.NAME = 'char') THEN SUBSTRING(SYSTYPES.NAME,1,20)+ '(' + LTRIM(REPLACE(STR((SYSCOLUMNS.LENGTH )), '-1', 'MAX') + ')') ELSE SUBSTRING(SYSTYPES.NAME,1,20) END) FROM SYSCOLUMNS , SYSTYPES WHERE SYSCOLUMNS.XTYPE = SYSTYPES.XTYPE AND SYSCOLUMNS.XUSERTYPE = SYSTYPES.XUSERTYPE AND SYSCOLUMNS.ID=@IDTABELA AND SYSCOLUMNS.NAME=@NOMECAMPO)