views:

1011

answers:

2

I have a SQL database that has a table with a field set to "Read Only" when I look at it through Microsoft SQL Server Management Studio Express.

I need to change some data within that field manually but I can't see any properties that I can change that will let me override this.

Will I need to write a sql script on the table to do this or is there something that I am missing ?

+3  A: 

What is the datatype of the field? You may not be able to "type" into it if its of an ntext or image datatype and management studio can't handle the size of it.

In that case you might have no option but to perform an update as follows.

UPDATE TableName SET ColumnName = 'NewValue' WHERE PrimaryKeyId = PrimaryKeyValue
Robin Day
The data type is "xml".
cyberbobcat
That will be the issue then. Xml is a complex datatype that would be difficult to edit in a cell. I'm afraid you will need to do this in an UPDATE statement.
Robin Day
Ok, thanks for this - I'll give it a go.
cyberbobcat
+1  A: 

The field is most likely "read-only" because it contains a calculated value.

If that's the case, you would have to change calculation in the table definition to change it's value.

Tomalak
I can't see a Calculation property for this within SQL server management studio express ??
cyberbobcat
I just read in another comment that the field type is XML. Maybe you just cannot edit XML directly in SQL Server Management Studio.
Tomalak
Yes, I think that seems to be the case. Thanks anyway.
cyberbobcat