Adding columns to SQL Server tables dynamically
From: Mark Rae (mark_at_mark-N-O-S-P-A-M-rae.co.uk)
Date: 12/04/04
- Next message: Sahil Malik: "Re: Adding columns to SQL Server tables dynamically"
- Previous message: cpnet: "Re: "Cannot create a child list for field MyTable""
- Next in thread: Sahil Malik: "Re: Adding columns to SQL Server tables dynamically"
- Reply: Sahil Malik: "Re: Adding columns to SQL Server tables dynamically"
- Reply: Mark Rae: "Synchronising a DataRow in one DataSet with a structurally identical DataRow from another DataSet"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 4 Dec 2004 01:09:49 -0000
Hi,
I'm writing a routine which queries a table in a mySQL database and then
adds records from it into a SQL Server 2000 database - pretty easy stuff.
Problem is, that the mySQL table may have additional columns every time I
query it.
I can easily use the Columns collection of both tables to see if there is a
new column in the mySQL table which isn't in the SQL Server table, but
what's the easiest / most efficient way to add a new column to an existing
SQL Server table, given that I know the name and datatype of the column to
be added?
Would it be to pass some sort of "ALTER TABLE..." SQL into an SQLCommand
object, or is there a better way?
Any assistance gratefully received.
Best regards,
Mark Rae
- Next message: Sahil Malik: "Re: Adding columns to SQL Server tables dynamically"
- Previous message: cpnet: "Re: "Cannot create a child list for field MyTable""
- Next in thread: Sahil Malik: "Re: Adding columns to SQL Server tables dynamically"
- Reply: Sahil Malik: "Re: Adding columns to SQL Server tables dynamically"
- Reply: Mark Rae: "Synchronising a DataRow in one DataSet with a structurally identical DataRow from another DataSet"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|