| |||
Re: Contar columnas USE MiBD IF EXISTS (SELECT * FROM sysobjects WHERE name = N'numberColumns')DROP FUNCTION numberColumns GO CREATE FUNCTION numberColumn(@Tabla varchar(50)) RETURNS INT AS BEGIN DECLARE @numberColumn int,@ID int SELECT @ID=ID FROM SYSOBJECTS WHERE NAME=@Tabla SELECT @numberColumn=COUNT(*)FROM SYSCOLUMNS WHERE ID=@ID RETURN(@numberColumn) END
__________________ GuzZpaWn |