SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard bbolte's Avatar
    Join Date
    Nov 2001
    Location
    The Central Plains
    Posts
    3,304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating DB Field with code

    anyone know of a way to create a new field in an existing table with code/sql script? needs to run from an asp script.

    i know how to create new tables, not sure how to create fields...

    i don't have direct access to the db, due to firewall/hosting weirdness.

  2. #2
    SitePoint Enthusiast Vedran Vuleta's Avatar
    Join Date
    May 2005
    Location
    Croatia
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    tray something lik this:

    alter table YourTable
    (
    add column YourField int default 1
    )

  3. #3
    SitePoint Wizard bbolte's Avatar
    Join Date
    Nov 2001
    Location
    The Central Plains
    Posts
    3,304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks. here's the syntax:
    "alter table test add [newField] [varchar"] (100) NULL"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •