x

Create a table according the fieldlist

hi,

i need to create a table in a database according a fieldlist (received from a flat file). fieldlists and datatypes are read in depending on which db should be created. i already define the parameters (ID, tablename, schema, database and filetype). how can i do this in a procedure?

thanks in advance
more ▼

asked Jun 07 '12 at 09:40 AM in Default

Alexmarvel gravatar image

Alexmarvel
10 1 1 1

Can you please specify the structure of the file? Would there be one file for each table? The more information you give, the more better help you get :-)
Jun 07 '12 at 11:03 AM Usman Butt

Hi Usman,

it's one file for each table. i already created the procedure that reads the file and stores the information on the right database (CreateStructureDropObject). Now i need to create the table in the right database. The structure of the database is described by the parameters.

thanks in advance.
Jun 07 '12 at 12:35 PM Alexmarvel
Can you please share the information of those parameters and how they are stored in the database? Based upon that we could hint you how it could be done.
Jun 07 '12 at 12:54 PM Usman Butt
(comments are locked)
10|1200 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x82

asked: Jun 07 '12 at 09:40 AM

Seen: 640 times

Last Updated: Jun 07 '12 at 01:06 PM