Assume that I have the following queries
select userName, password, email
from tblUsersProfile
where email = '145' or userName = '112'
select userName, password, email
from tblUsersProfile
where email = '80' or userName = '70'
select userName, password, email
from tblUsersProfile
where email = '129' or userName = '169'
select userName, password, email
from tblUsersProfile
where email = '1' or userName = '2'
select
AVG(PokemonLevel) as AvgLevel, PokemonId
from
tblUsersPokemons
group by
PokemonId
order by
PokemonId asc
insert into tblOnlineUsersCounts
select
(select
COUNT(LastMoveTime)
from
tblUsersProfile
where
LastMoveTime > DATEADD(HOUR, -24, sysutcdatetime())),
(select
COUNT(LastMoveTime)
from
tblUsersProfile
where
LastMoveTime > DATEADD(DAY, -7, sysutcdatetime())),
(select
COUNT(LastMoveTime)
from
tblUsersProfile
where
LastMoveTime > DATEADD(DAY, -30, sysutcdatetime()))
select
count(Id) as TotalCount, PokemonId
from
tblUsersPokemons
group by
PokemonId
order by
PokemonId asc
Now when I execute them in SQL Server Management Studio, it tries all and if one fails all fails which means all of them is counted as a single query
Also when I right click in SSMS and click analyze query in database engine tuning advisor it also count them as a single query instead of each one is independent queries
So I want to format them in a way that both SSMS should treat them as each one of them is a separate query
So even if one fails, SSMS should execute other working ones
What is the proper format for achieving this ?
Ty very much
what are these downvotes for ?
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments