Advertisement
tei219

check_alldatabase_sysfiles

Oct 4th, 2011
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.62 KB | None | 0 0
  1. create table ##check_alldatabase_sysfiles(
  2.  [svrname] [nvarchar] (128) NULL ,
  3.  dbname nvarchar(128),
  4.  [fileid] [smallint] NOT NULL ,
  5.  [groupid] [smallint] NOT NULL ,
  6.  [size] [int] NOT NULL ,
  7.  [maxsize] [int] NOT NULL ,
  8.  [growth] [int] NOT NULL ,
  9.  [status] [int] NOT NULL ,
  10.  [perf] [int] NOT NULL ,
  11.  [name] [nchar] (128) NOT NULL ,
  12.  [filename] [nchar] (260) NOT NULL
  13. )
  14.  
  15. exec sp_MSforeachdb @command1 = '
  16.     use [?];
  17.     insert into ##check_alldatabase_sysfiles select @@servername as srvname, db_name() as dbname, * from sysfiles;
  18. '
  19.  
  20. select * from ##check_alldatabase_sysfiles;
  21.  
  22. drop table ##check_alldatabase_sysfiles;
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement