You must Sign In to post a response.
  • Category: SQL Server

    Generate dynamic sql script from Metadata


    I have a metadata table like below, I need to generate SQL table script from Metadata table.
    Please advice how to generate the 'create table script' form the metadata table for each tables.

    Metadata Table.
    TableID TableName ColumnName DataType
    101 Table1 Column1 VarChar(50)
    101 Table1 Column2 VarChar(50)
    101 Table1 Column3 VarChar(50)
    102 Table2 Column1 VarChar(50)
    102 Table2 Column2 VarChar(50)
    103 Table3 Column1 VarChar(50)
    103 Table3 Column2 VarChar(50)
    103 Table3 Column3 VarChar(50)
    103 Table3 Column4 VarChar(50)
    150 Table150 Column1 VarChar(50)
    150 Table150 Column2 VarChar(50)
    150 Table150 Column3 VarChar(50)

    Note : In the metadata table has around 150 tables information.

  • #769801

    Dont you have these tables in single database inside sql server? If yes then you can generate script from UI.

    Anjali Bansal

    Anjali Bansal

    ~Give your best and lead the world

  • Sign In to post your comments