SQLTeam.com | Weblogs | Forums

Dynamic table creation with column threshold

Hi Team,

i have a list of records that are actually list of columns and table name that are coming from raw file and i need to create tables
on the fly and add 200 columns in each tables and table name should be like that is coming in file but we need to split tables in multiple table
with some addition in name like table_1 ,table_2 when the list of column exceeds the count of 200 that is our threshold.

please suggest.

I have a "Create some tables for this project based on whatever brief we get in a spreadhseet", so the approach i use might be useful to you.

I import the proposed table/column data into a SQL Table (actually two tables, ProposedTables and ProposedColumns - with an FKey joining them).

I then generate a SQL Create Table statement from that list, for each of the tables included in the batch.

@Kristen ,I am not able to understand what you are suggesting. Please elaborate.

@Kristen, I am looking for your suggestion. Please suggest.