|  | Posted by Erland Sommarskog on 06/07/05 01:58 
Eben (yonglove@yahoo.com) writes:> I have a very large table that is refreshed periodically.  Since it's
 > so big, I do a 'drop table', 'create table', 'create index' then a bulk
 > load.  It's much faster than doing a 'delete from'.  I also do a
 > 'shrinkdb' as part of this process.
 
 So why not do a TRUNCATE TABLE instead? This is a minimally logged
 operation, and you maintain indexes, permissions etc.
 
 > The problem, however, is that the user permissions are also dropped in
 > this process.  So, how can I script the user permissions?  For example,
 > how do I give 'MyUser' select access to 'MyTable' in 'MyDB'?  Many
 > thanks!!
 
 I guess you can do this with DMO, if you want to do this programmatically.
 However, I have not used DMO myself.
 
 
 --
 Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
 
 Books Online for SQL Server SP3 at
 http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
  Navigation: [Reply to this message] |