I have received lots of good responses to the puzzles, quizzes and brain teasers posted on this blog post. As the year is ending, I have decided to give two interesting puzzles for you. The first one is easy and the second one is equally uncomplicated, but let us see if any of you can come up with a logical answer to it.
Puzzle 1: Find “The Hidden Tiger”
Find “The Hidden Tiger” in the following image created by American wildlife artist Rusty Rust. Just to give you a hint – there is already one tiger standing and looking at us. Now you have to find “The Hidden Tiger”. Trust me; it is very much in front of your eyes. You just have to find it. Trust me it is there.
Puzzle 2: Why no Red-Arrow on User when Login is disabled
Earlier I posted SQL SERVER – Merry Christmas and Happy Holidays – Database Properties – Number of Users and asked a question why there is Red-Arrow on the username and I have received lots of replies which say the reason behind it was that the login is disabled and the user does not have an access to the database.
Let us now create scenario. We will do following three tasks:
- Create Login
- Create User and associate with the Login
- Disable Login
-- Create Login
CREATE LOGIN [sqlauthority] WITH PASSWORD=N'SQL@Authority1'
-- Create User
USE [AdventureWorks] GO
CREATE USER [sqlauthority] FOR LOGIN [sqlauthority] WITH DEFAULT_SCHEMA=[dbo] GO
-- Disable Login
USE [master] GO
ALTER LOGIN [sqlauthority] DISABLE
Now we will go and refresh SSMS indows and check the user. The user will not have the Red-Arrow. Now, try to connect to SQL Server using the same user and it will return the following error, suggesting that the login failed as the account is disabled.
Login failed for user ‘sqlauthority’. Reason: The account is disabled. (Microsoft SQL Server, Error: 18470)
Now here is the question for you:
If Login is disabled, why does the user associated with the same have no Red-Arrow pointing downwards?
I am sure that finding the answer to this will be a great learning experience for all.
Reference: Pinal Dave (https://blog.sqlauthority.com)