code_junkie

SMO scripting objects and security

Nov 13th, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. Server myServer = new Server(conn);
  2. Database myDB = server.Databases["myDatabase"];
  3. Table myTbl = myDB.Tables["myTable"];
  4.  
  5. Database myDB = new Database(myServer, "myDatabase");
  6.  
  7. select * from sys.tables
  8.  
  9. select * from sys.columns where object_id = (object id from the previous query)
Add Comment
Please, Sign In to add comment