Type the user account password in the Password box, and then click Next. Note that no special rights are required for this account. The account will automatically be granted the required logon and database permissions when setup completes.
DECLARE @sql AS nvarchar(max);
DECLARE @tbl AS sysname;
DECLARE c CURSOR FOR
SELECT name
FROM sys.tables
WHERE type = 'U';
OPEN c;
FETCH NEXT FROM c INTO @tbl;
WHILE @@FETCH_STATUS = 0
BEGIN
SET @sql = COALESCE(@sql, N'') + IIF(@sql IS NULL, N'', N' UNION ALL ') + N'SELECT col1, col2, col3 FROM ' + @tbl;
FETCH NEXT FROM c INTO @tbl;
END
CLOSE c;
DEALLOCATE c;
PRINT @sql;
EXEC (@sql);
(select up.level_pancers_1 from users_pancer up where up.id_user = uc.id_user)
(select lpp2.protect from _levels_pancer_pancers lpp2 where lpp2.level = lp2)
select * from (
select @n := @n + 1, uc.id_user as iduser, u.login,
up.level_mutagen
, up.level_pancers_1 as lp1
, up.level_pancers_2 as lp2
, up.level_pancers_3 as lp3
, up.level_pancers_4 as lp4,
round(uc.health / 4)
+ coalesce(lpm.protect, 0)
+ coalesce(lpp1.protect, 0)
+ coalesce(lpp2.protect, 0)
+ coalesce(lpp3.protect, 0)
+ coalesce(lpp4.protect, 0) as param_sum
from users_combat uc
join users_pancer up on uc.id_user = up.id_user
join users u on u.id = uc.id_user
left join _levels_pancer_mutagen lpm on lpm.level = up.level_mutagen
left join _levels_pancer_pancers lpp1 on lpp1.level = up.level_pancers_1
left join _levels_pancer_pancers lpp2 on lpp2.level = up.level_pancers_2
left join _levels_pancer_pancers lpp3 on lpp3.level = up.level_pancers_3
left join _levels_pancer_pancers lpp4 on lpp4.level = up.level_pancers_4
order by param_sum desc, login asc
)x
where iduser = ?
limit 1
В PostgreSQL проблемы с JOIN'ами таблиц в разных БД будут. В SQL Server таких проблем нет.
Плюс, непонятно чего хочет клиент - каждая база на своём сервере, или один сервер и разные данные в разных базах.