all groups > sql server msde > july 2005 >
You're in the

sql server msde

group:

Table created as read-only


Table created as read-only Joe Manahan
7/28/2005 6:57:01 PM
sql server msde:
Hi
I installed MSDE 2000 using the sql2k32desksp4 downloaded from microsoft.
But, I have problem when I created a table from Query Analyzer, it will be
read-only and I can not add data into my table in the database.
I try to use stored procedure to create, same thing happen.
In my stored procedure I have script to create many tables, 6 tables, and 4
of them are read-only.
But when I use Enterprise Manager to open the read-only table, I can insert
data directly.

Due to this, I will get Invalid Objects "<table name>" error in my
application if I tried to insert data to the table.

Re: Table created as read-only Andrea Montanari
7/29/2005 12:47:12 PM
hi Joe,
[quoted text, click to view]

actually there's non concept of readonly table(s), but permissions on
object(s)... but your problem is probably another one...
you probably created the object without specifying the relative owner,
something like
CREATE TABLE [some_table] (
...
)
this kind of syntax will actually create a table owned by the current logged
user ( say [Andrea] )... if you later connect with another user ( say
[Joe] ) you wont be able to refer to (my) object with the simple
SELECT * FROM [some_table]
as SQL Server is first trying to reference the object as [Joe].[some_table]
..... as it is not available, it will proceed searching for
[dbo].[some_table], and again, as it is not available, it will fail...
you will only be able to refer that object with it's 2 part naming...
SELECT * FROM [Andrea].[some_table]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_con_03_9ws3.asp

default guidelines indicate to always use [dbo] as all objects owner, so
that even in case of firing ( :-/ ) all database objects will remain
available without the need to transfer the property of each object and
without breaking existing apps...
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtm http://italy.mvps.org
DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
--------- remove DMO to reply

AddThis Social Bookmark Button