User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 423,766 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,419 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums

add a new table to the database or add a new column to an existing table.

Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,434
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 11
Solved Threads: 295
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: add a new table to the database or add a new column to an existing table.

  #2  
Apr 7th, 2008
Create table
  1. CREATE TABLE table_name
  2. (
  3. column_name1 data_type,
  4. column_name2 data_type,
  5. )
The problem that you facing here is
  1. Table is always same so you just run your prepared statement
  2. Tables can be different, you must provide a way/interface through which user can declare table name, column types, you just add the magic words CREATE TABLE and then execute it
Add column
  1. ALTER TABLE table_name
  2. ADD column_name datatype
Remove column
  1. ALTER TABLE table_name
  2. DROP COLUMN column_name
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
All times are GMT -4. The time now is 2:03 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC