Hmm, I don't think I quite understand what you say, since I'm rather new to
this. But, I know in MSSQL Enterprise Manager I can just add the column, and
it works, but now I need to add the same new column, to accept a new field
on my ISP's server, and Enterprise Manager doesn't connect to it.
Thanx for the info from the manual, I don't understand it clearly though
--
Kind Regards
Rudi Ahlers
+27 (82) 926 1689
Greater love has no one than this, that he lay down his life for his friends
(John 15:13).
I don't think you can add a column programmatically. Because you are
changing the schema which SQL will not have a clue what to do with the
existing data in the database. I am happy to be proven wring though. Also,
just out of interest, why would you like to add a column programmatically?
You can probably use the DataSet.Merge() Method to Merge a DataTable and its
schema into the current DataSet. But that cannot be presist into the DB.
Finally, in case you want to create a new table, here is the syntax (quoted
from Professional SQL 7 - Wrox)
CREATE TABLE [database_name.[owner].]table_name
({column_name data_type
[[DEFAULT constant_expression]
| [INDENTITY [(seed, increment) [NOT FOR REPLICATION]]]]
[ROWGUIDCOL]
[NULL|NOT NULL]
[<column contraints>]
| [column_name AS computed_column_expression]
| [<table_constraint>]}
[,...n]
)
[ON {<filegroup>|DEFAULT}]
[TEXTIMAGE_ON {<filegroup>|DEFAULT}]
Example:
USE Accounting
CREATE TABLE Employees
(EmployeeID int IDENTITY NOT NULL,
FirstName varchar(25) NOT NULL)
HTH
----- Rudi Ahlers wrote: -----
How do I add a column in a table on a MSSQL server? I got BuildSQL
running,
so I can enter SQL commands to do it, only problem is, I don't know the
command to add a column
--
Kind Regards
Rudi Ahlers
+27 (82) 926 1689
Greater love has no one than this, that he lay down his life for his
friends
(John 15:13).