﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administration / SQL Server 7,2000  / Lock tabels / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 18 May 2013 22:31:20 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Lock tabels</title><link>http://www.sqlservercentral.com/Forums/Topic1407343-5-1.aspx</link><description>[quote][b]Krasavita (1/16/2013)[/b][hr]When I tried to create clustered index as you said and assign to read only file group,I get an error message:that can't save because this file group is readonly[/quote]again, look at the code i posted.i toggle the group to read-write, add the table/index, and then toggle it back to read only.you will have to do the same,.</description><pubDate>Wed, 16 Jan 2013 10:07:55 GMT</pubDate><dc:creator>Lowell</dc:creator></item><item><title>RE: Lock tabels</title><link>http://www.sqlservercentral.com/Forums/Topic1407343-5-1.aspx</link><description>When I tried to create clustered index as you said and assign to read only file group,I get an error message:that can't save because this file group is readonly</description><pubDate>Wed, 16 Jan 2013 10:03:11 GMT</pubDate><dc:creator>Krasavita</dc:creator></item><item><title>RE: Lock tabels</title><link>http://www.sqlservercentral.com/Forums/Topic1407343-5-1.aspx</link><description>[quote][b]Krasavita (1/15/2013)[/b][hr]Thank you,How you move the table into a separate filegroup?[/quote]peek at the code i posted, which creates a new table in the filegroup.for an existing table, you can Use [i]create index ... with drop_existing[/i] for the clustered index and specify the desired filegroup for the place that the index must be created on. , which effectively "moves" the table to the new filegroup.</description><pubDate>Tue, 15 Jan 2013 14:35:43 GMT</pubDate><dc:creator>Lowell</dc:creator></item><item><title>RE: Lock tabels</title><link>http://www.sqlservercentral.com/Forums/Topic1407343-5-1.aspx</link><description>Thank you,How you move the table into a separate filegroup?</description><pubDate>Tue, 15 Jan 2013 14:31:17 GMT</pubDate><dc:creator>Krasavita</dc:creator></item><item><title>RE: Lock tabels</title><link>http://www.sqlservercentral.com/Forums/Topic1407343-5-1.aspx</link><description>Other way around. This isn't something you add to a table. Rather you move the table into a separate filegroup and mark the filegroup read only (tables can't be read only, only filegroups or databases)</description><pubDate>Tue, 15 Jan 2013 12:52:16 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: Lock tabels</title><link>http://www.sqlservercentral.com/Forums/Topic1407343-5-1.aspx</link><description>Thank you,but how would you add this to table?</description><pubDate>Tue, 15 Jan 2013 12:38:26 GMT</pubDate><dc:creator>Krasavita</dc:creator></item><item><title>RE: Lock tabels</title><link>http://www.sqlservercentral.com/Forums/Topic1407343-5-1.aspx</link><description>here's something i put together for a different post that was talking about setting a table to read only:this is not copy/paste/execute code, but rather, amodel to use to modify and step through to comprehend what is going on.[code]USE [master]GOALTER DATABASE SandBox ADD FILEGROUP onlyLookupsGOALTER DATABASE [SandBox] ADD FILE ( NAME = N'SandBox_Lookups',                                     FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\SandBox_Lookups.ndf' ,                                     SIZE = 2048KB ,                                     FILEGROWTH = 1024KB )                          TO FILEGROUP [OnlyLookups]GOUSE [SandBox]GOdeclare @readonly bitSELECT @readonly=convert(bit, (status &amp; 0x08)) FROM sysfilegroups WHERE groupname=N'OnlyLookups'if(@readonly=0)  ALTER DATABASE [SandBox] MODIFY FILEGROUP [OnlyLookups] READONLYGOUSE [master]GOdeclare @readonly bitSELECT @readonly=convert(bit, (status &amp; 0x08)) FROM sysfilegroups WHERE groupname=N'OnlyLookups'if(@readonly=0)  ALTER DATABASE [SandBox] MODIFY FILEGROUP [OnlyLookups] READONLYGO--are we readwriteable or not?USE [SandBox]GO--#################################################################################################--toggle read only, add table, put it back--#################################################################################################declare @readonly bitSELECT @readonly=convert(bit, (status &amp; 0x08)) FROM sysfilegroups WHERE groupname=N'OnlyLookups'if(@readonly=1)  ALTER DATABASE [SandBox] MODIFY FILEGROUP [OnlyLookups] READWRITEGO--switch db context so we can alterUSE [master]GOdeclare @readonly bitSELECT @readonly=convert(bit, (status &amp; 0x08)) FROM sysfilegroups WHERE groupname=N'OnlyLookups'if(@readonly=1)  ALTER DATABASE [SandBox] MODIFY FILEGROUP [OnlyLookups] READWRITEGO--#################################################################################################--add table--#################################################################################################USE [SandBox] GOCREATE TABLE [dbo].[CITYDATA] ( [CITYNAME]      VARCHAR(28)                          NULL,[COUNTYNAME]    VARCHAR(64)                          NULL,[STATE]         VARCHAR(2)                           NULL,[STATEFIPS]     VARCHAR(2)                           NULL,[COUNTYFIPS]    VARCHAR(3)                           NULL,[ZIPCODE]       VARCHAR(5)                           NULL,[STATETBLKEY]   INT                                  NULL,[COUNTYTBLKEY]  INT                                  NULL,[CBSA]          AS ([STATEFIPS]+[COUNTYFIPS]))ON onlyLookups--#################################################################################################--toggle read only back again--################################################################################################# USE [SandBox]GOdeclare @readonly bitSELECT @readonly=convert(bit, (status &amp; 0x08)) FROM sysfilegroups WHERE groupname=N'OnlyLookups'if(@readonly=0)  ALTER DATABASE [SandBox] MODIFY FILEGROUP [OnlyLookups] READONLYGOUSE [master]GOdeclare @readonly bitSELECT @readonly=convert(bit, (status &amp; 0x08)) FROM sysfilegroups WHERE groupname=N'OnlyLookups'if(@readonly=0)  ALTER DATABASE [SandBox] MODIFY FILEGROUP [OnlyLookups] READONLYGO[/code]</description><pubDate>Tue, 15 Jan 2013 11:11:31 GMT</pubDate><dc:creator>Lowell</dc:creator></item><item><title>RE: Lock tabels</title><link>http://www.sqlservercentral.com/Forums/Topic1407343-5-1.aspx</link><description>Can you give me an example please</description><pubDate>Tue, 15 Jan 2013 11:02:37 GMT</pubDate><dc:creator>Krasavita</dc:creator></item><item><title>RE: Lock tabels</title><link>http://www.sqlservercentral.com/Forums/Topic1407343-5-1.aspx</link><description>not directly, but you could move them to a separate filegroup and make that read only, or do it via permissions (only select granted or only access via stored procs)</description><pubDate>Tue, 15 Jan 2013 10:55:16 GMT</pubDate><dc:creator>george sibbald</dc:creator></item><item><title>Lock tabels</title><link>http://www.sqlservercentral.com/Forums/Topic1407343-5-1.aspx</link><description>Hello,Can I put tabels in read only mode?Thank youJulia</description><pubDate>Tue, 15 Jan 2013 09:44:20 GMT</pubDate><dc:creator>Krasavita</dc:creator></item></channel></rss>