Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Change the field property

Author  Topic 

Ish
Starting Member

11 Posts

Posted - 2010-07-15 : 04:55:54
Hi

I am new to sql server express 2008. I have download sql server 2008 express and sql server Management Studio 2008. Both working fine. I imported access database to server 2008. It work fine too.
Now I want to change some field type eg from text to nText or any change to fields. Evan if I create a brand new table and then save it. Then I go back to this table to modified or change filed type.
It doesn't allow me to save changes.
But studio doesn't allow me to save changes.
It is suggesting to drop whole table and recreate.

Is this is the ristriction to express addition, not allow changes to table once it is created.
Is there any way, I can change table fields type without droping table.
Please can someone help me out.

many thanks

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2010-07-15 : 05:40:03
Why do you want Text datatypes? Do you really need them, is VARCHAR(MAX) not enough for what you need?
Go to Top of Page

Ish
Starting Member

11 Posts

Posted - 2010-07-15 : 06:14:30
quote:
Originally posted by RickD

Why do you want Text datatypes? Do you really need them, is VARCHAR(MAX) not enough for what you need?



thanks

But It's is not allowing any change to table fields to save.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-07-15 : 06:40:03
You have to change a setting in OPTIONS in SSMS to allow you to make a change that requires recreating the table, copying the data over, deleting the original table, and renaming the New Temporary table to the Original name.

I guess the reason for this is that if you accidentally make a change that required this on a database that was several terrabytes in size your server would be tied up for hours shuffling everything around ...

But as RickD says, whilst you are at it change from TEXT to VARCHAR(MAX) / Ntext to Nvarchar(MAX), as TEXT datatype is deprecated, and replaced by VARCHAR(MAX), and should behave identically in all other regards (but also allow you more flexibility, and possibly better performance and smaller table size)
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-07-15 : 06:42:32
Tools : Options : Designers : "Prevent saving changes that require table re-creation" (uncheck that)

Blinking nightmare the forest of options ...
Go to Top of Page

Ish
Starting Member

11 Posts

Posted - 2010-07-15 : 06:49:42
Tools : Options : Designers : "Prevent saving changes that require table re-creation" (uncheck that)

<br>
Many thanks Kristen

I got it working.

Go to Top of Page
   

- Advertisement -