Professional Web Applications Themes

how do i properly delete the last column?? - Microsoft SQL / MS SQL Server

it is not being used and it gives me 'distinct' problems. how do i properly delete it? thanks, Trint .Net programmer com *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!...

  1. #1

    Default how do i properly delete the last column??

    it is not being used and it gives me 'distinct' problems.
    how do i properly delete it?
    thanks,
    Trint

    .Net programmer
    com

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Trint Guest

  2. #2

    Default Re: how do i properly delete the last column??

    Trint,

    ALTER TABLE <tablename>
    DROP COLUMN <columnname>

    From BOL, do note that a column cannot be dropped if it is:
    a.. A ted column.
    b.. Used in an index.
    c.. Used in a CHECK, FOREIGN KEY, UNIQUE, or PRIMARY KEY constraint.
    d.. Associated with a default defined with the DEFAULT keyword, or bound
    to a default object.
    e.. Bound to a rule.
    In those cases, you may need to drop the dependent objects first.

    --
    Dinesh.
    SQL Server FAQ at
    http://www.tkdinesh.com

    "Trint Smith" <com> wrote in message
    news:%phx.gbl... 


    Dinesh.T.K Guest

  3. #3

    Default Re: how do i properly delete the last column??

    if you want to permanently delete column from the table (looks to be TEXT
    from your earlier post). then the command would be

    alter table <table> drop column <column> --make sure you are using right
    column name.

    If you want it to exclude from your select statement just do not include it
    Ex:
    select col1,col2 from table

    --
    -Vishal
    "Trint Smith" <com> wrote in message
    news:#phx.gbl... 


    Vishal Guest

Similar Threads

  1. How do you delete a column/datacell from a datarow?
    By Burak in forum ASP.NET Data Grid Control
    Replies: 3
    Last Post: January 19th, 01:30 AM
  2. Delete form - Post data to a table and delete uponsubmit.
    By FusionRed in forum Coldfusion - Getting Started
    Replies: 3
    Last Post: July 28th, 01:27 PM
  3. Delete with a multi-column join?
    By leon-pg@comvision.com in forum PostgreSQL / PGSQL
    Replies: 2
    Last Post: January 25th, 10:03 PM
  4. adox asp ms access delete a column from a table
    By Scotter in forum ASP Database
    Replies: 2
    Last Post: July 9th, 06:38 AM
  5. Delete key doesn't delete when datagrid is bound to a disconnected table
    By Fred Zolar in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: April 1st, 07:47 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139