How do I change a table from Read Only?

  • I'm new to SQL and trying to go thru a tutorial by AppDev. I've created a table using the templates in query analyzer but when I open the table to insert data, its read only. Insert queries also fail. I cannot find any security or property settings that should restrict this. I'm logged into the server as system admin (sa). Where could I be missing something? tks

  • If you're connected as sa shouldnt matter what the permissions are. What error do you get when you try the insert?

    Andy

  • quote:


    If you're connected as sa shouldnt matter what the permissions are. What error do you get when you try the insert?

    Andy


    OK, I got the insert into query to work. But, just opening the table from the object browser gives me a (read only) at the end of the oject name in the window and I cannot just add data to the table. Other tables that are already created in this tutorial database allow me to add rows, so I don't know what is different.

  • You are probably tyring to insert into Identity Column or some columns have or some columns do not allow null values.

    If you have a timestamp column in the table you can not insert value in it either.

    The last and not least that I can think of check your foreign keys. You might be inserting child record where parent does not exists. Check your foreign key see if the check on insert update option is on.

    Good Luck

    quote:


    I'm new to SQL and trying to go thru a tutorial by AppDev. I've created a table using the templates in query analyzer but when I open the table to insert data, its read only. Insert queries also fail. I cannot find any security or property settings that should restrict this. I'm logged into the server as system admin (sa). Where could I be missing something? tks


  • Which if any of those problems is true it should be specific about. What is the full text of the message you are getting? This will help us explain maybe what you are seeing.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • Thanks for your reponses. I got the insert query to work, so I'm not getting any error message at all now. However, I want to be able to add data to the table when I just open it from the object browser, but in the title bar of the window that opens, it reads (read only)after the table name. And, I cannot make any edits or additions to the table. Other tables in this database open and I can edit them. The table in question was made using the basic create table template. I'm not sure how to make one thats not read only or how to change this one so it allows edits/additions. tks.

  • I find no information so there has to be something specific about this table that is causing this. Can you open EM and right click the table, select copy and post us the DDL for the table. I wonder also, is this table on a seperate filegroup as in BOL I find this

    quote:


    READONLY

    Specifies the filegroup is read-only. Updates to objects in it are not allowed. The primary filegroup cannot be made read-only. Only users with exclusive database access can mark a filegroup read-only.


    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply