Results 1 to 4 of 4

Thread: Change the length of a field in a table

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2012
    Posts
    10

    Change the length of a field in a table

    hyy

    I am using sql2000 for my Database and vb6 for the platform app. I want to change the length of a field in Table A, but that particular field is related to another field in Table B, means, the field in Table B is dependent on the field in Table A.

    When I tried to change the Length of the field in table A, using the query ALTER TABLE table ALTER COLUM [id] varchar(50), the analyzer returned the error

    Server: Msg 5074, Level 16, State 8, Line 1
    The object 'UQ__table A__77BFCB91' is dependent on column 'field'.
    Server: Msg 4922, Level 16, State 1, Line 1
    ALTER TABLE ALTER COLUMN field failed because one or more objects access this column.

    On the other hand, when used the same query on the field in Table B, it did the trick.

    How can I change the Length of the field in Table A.

    Anyhelp is appreciated.

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Change the length of a field in a table

    Well, it seems as if that there is a relationship between the fields in the two tables! That being the case I think the only way you can change the length of the field in table "A" to destroy the relationship between the two tables, change the length of the field then re-establish the link between the two tables.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2012
    Posts
    10

    Re: Change the length of a field in a table

    yeah I know, this procedure can do me the trick. But the question is how to do it?

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Change the length of a field in a table

    I assume that the mapping has some associated code if so could you please post it?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Posting Permissions

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



Click Here to Expand Forum to Full Width