Generate AccountId Null check

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

Select 'Select ''' + Replace([Name],'','') + ''' As [DatabaseName], '
+ 'Count(*) As [Count], (SELECT COUNT(*) FROM [' + [Name] + ']..Users fun WHERE fun.AccountId Is NULL) As [Nulls] '
+ 'From [' + [Name] + ']..Users fu Join Users u ON fu.AccountId=u.AccountId '
+ ' UNION ALL '
From sys.Databases
Where Name Like '%'

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results