select 'alter database [' + name + '] set READ_ONLY WITH NO_WAIT
go'
from sys.databases where database_id4
Read the rest