Sites where a user doesn't have an account on


Please login or register to vote for this query.

(click on this box to dismiss)

Internet of Things Meta

Q&A about the site for builders and users of networked sensors and control devices in the contexts of smart homes, industry automation, or environmental sensors

-- all databases
declare db_c cursor for select [name] 
                        from sys.databases 
                        where database_id > 5 -- skip master, temp, model, msdb, Data.SE

declare @db_c_name sysname -- holds name of db after fetch
declare @sql nvarchar(max) -- holds build up sql string

-- result table
create table #accounts (site nvarchar(250), id int, displayname nvarchar(40));
create table #databases (site nvarchar(250));

open db_c
fetch next from db_c into @db_c_name
while(@@FETCH_STATUS = 0)
    set @sql = N'use '+ QUOTENAME(@db_c_name) + ';
    insert into #accounts 
    select ''' + @db_c_name + ''', id, displayname
      from users
      where accountid = ' + CAST(##AccountId:int## as nvarchar) + ';
    insert into #databases select ''' + @db_c_name + '''';
    exec (@sql)
    fetch next from db_c into @db_c_name
close db_c;
deallocate db_c;
-- AccountId: The global account ID of the user, which you can find in the URL of their network profile. Visit this link: to see your own ID.

       -- URL builder from Lamak
      + case PARSENAME(,1)
        when 'audio' then 'avp'
        else PARSENAME(,1)
      + coalesce('.' 
        + case PARSENAME(,2)
          when 'audio' then 'avp'
          else PARSENAME(,2)
          end , '')
      + IIF(patindex('%.MathOverflow%', > 0
      , ''
      , coalesce('.' + PARSENAME(,3), '')
      + IIF(patindex('%.MathOverflow%', > 0
      , '.net'
      , '.com'
      + IIF( IS NULL
      , '/users/join'
      , '/users/' + cast( as nvarchar))
      + '|'
      + IIF( IS NULL, 'Join ' +, a.displayname)
      -- rest of columns
      ,, a.displayname
from #databases as d left outer join #accounts as a
    on =
  where ( = 'StackExchange.Meta'
      or not like '%.Meta')
     and != 'StackExchange.Arabic'
  order by;

Enter Parameters

Switch to main site
loading Hold tight while we fetch your results