Hi, I have written a script. I want to display database name for respective rows or records.
Below is query:- Text file is attached.
Thanks in advance,
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
Answer by Kev Riley · Mar 18, 2019 at 03:05 PM
use ''?'' within the query to reference the current database name
EXEC sp_msforeachdb N'SELECT ''?'' '
Answers Answers and Comments
22 People are following this question.
,Restore filelist is terminating abnormally
Use a pivot in a UNION
CrossTab Query In SQL 2008
how Backup and restore done in azure