[SQL Server]Moving table(s) to a different filegroup in SQL

有關資料庫的討論, 都可以在這發表哦~~
回覆文章
頭像
tim
文章: 1380
註冊時間: 2008年 11月 26日, 00:49

[SQL Server]Moving table(s) to a different filegroup in SQL

文章 tim »

http://decipherinfosys.wordpress.com/20 ... -sql-2005/

這篇文章很有用, 在於移動資料表於不同的 filegroup 上時, 很方便好用的操作方式. 利用 alter table drop constraint with move to 的語法, 這個很俱實用性.
多多留言, 整理文章, 把經驗累積下來.....
sjstone
文章: 2
註冊時間: 2009年 7月 17日, 14:51

Re: [SQL Server]Moving table(s) to a different filegroup in

文章 sjstone »

請問一下,(在SQL Server 2005中)
如果原來的table沒有clustered Index,那該如何移資料到新的File Group中ㄋ?
先建一個嗎??? :?
還是有其他指令或方法?
謝謝...
頭像
tim
文章: 1380
註冊時間: 2008年 11月 26日, 00:49

Re: [SQL Server]Moving table(s) to a different filegroup in

文章 tim »

可以利用 sp_help 先 check 一下該 table 是否有 clustered index, 若沒有的話, 只能用先建一個再做, 不過 table 筆數少, 就直接建新的分好 file group 來放, insert 過去再 sp_rename 即可, 若資料筆數多的話, 建 clustered index 可能會很久, 不過相信你要做 partition table 的狀況下, 肯定是資料筆數很多的情形, 還蠻兩難的.
多多留言, 整理文章, 把經驗累積下來.....
sjstone
文章: 2
註冊時間: 2009年 7月 17日, 14:51

Re: [SQL Server]Moving table(s) to a different filegroup in

文章 sjstone »

請問一下,(因為我不是DBA,所以可能問些蠢問題,請多包涵 :lol: )
在本標題中,搬移大量資料時是否要將資料庫切到某種模式中,因為常會遇到鎖定失敗狀況!
還是???
謝謝。
回覆文章