sql server取得表字段

      学习笔记 2005-9-28 8:46
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO

CREATE FUNCTION DCL(@tab NVARCHAR(500))
    RETURNS @ColumnsTable TABLE
    (
        name NVARCHAR(500)
    )
AS
    BEGIN
        INSERT @ColumnsTable
        SELECT syscolumns.name
        FROM sysobjects join syscolumns ON sysobjects.id=syscolumns.id
        WHERE sysobjects.name=@tab
        RETURN
    END

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commenttime}{commentauthor}

{CommentUrl}
{commentcontent}