July 20, 2011 at 8:25 pm
Comments posted to this topic are about the item Login Properties
July 20, 2011 at 8:34 pm
Hmm... there's nothing on the referenced link that shows that behaviour of LOGINPROPERTY. Perhaps a better explanation?
Well, thanks for the question anyway, Steve. 🙂
Best regards,
Best regards,
Andre Guerreiro Neto
Database Analyst
http://www.softplan.com.br
MCITPx1/MCTSx2/MCSE/MCSA
July 20, 2011 at 8:45 pm
The reference cited simply states that it is defined as DATETIME data type, but does not give its default value. Do you have another reference, for without a defalut value .. it could be ... well it could be.. then again ... it could be
July 21, 2011 at 2:15 am
I'm surprised that the answer isn't null.
Can somebody prove or disprove that.
(I don't have the facility to do this myself - sorry!)
July 21, 2011 at 2:17 am
Aagghh - I've gone back to being 'Say Hey Kid'.
How did that happen?
July 21, 2011 at 2:20 am
I just assumed it was NULL. Have never bothered to look in there before (at that stage) and generally our servers have had to be set to mixed mode from the beginning due to some constraints we have in our environment. Not sure what I will gain from knowing this...but thanks! :p
July 21, 2011 at 2:26 am
I was about to select Null as the answer but then thought that would be too easy. Then I thought there must be some special circumstance if you change the security mode. The only other logical option was the 1900-01-01 so I guessed that one and was right.
July 21, 2011 at 2:34 am
Books On Line simply states that it is a DATETIME value, and default for DATETIME is NULL, so I choose NULL.
DECLARE @MyVar DATETIME
SELECT @MyVar
I would be interested to know why '1900-01-01' was chosen as a default value.
Thanks & Regards,
Nakul Vachhrajani.
http://nakulvachhrajani.com
Follow me on
Twitter: @sqltwins
July 21, 2011 at 3:00 am
Nice question - almost a dead giveaway
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
July 21, 2011 at 3:02 am
Nakul Vachhrajani (7/21/2011)
Books On Line simply states that it is a DATETIME value, and default for DATETIME is NULL, so I choose NULL.
DECLARE @MyVar DATETIME
SELECT @MyVar
I would be interested to know why '1900-01-01' was chosen as a default value.
The likely cause is the loginproperty function is doing an isnull check.
declare @somedate datetime = null
Select isnull(@somedate,0)
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
July 21, 2011 at 5:44 am
Nice question. I learned something today.
http://brittcluff.blogspot.com/
July 21, 2011 at 5:53 am
paul s-306273 (7/21/2011)
I'm surprised that the answer isn't null.Can somebody prove or disprove that.
(I don't have the facility to do this myself - sorry!)
I'll add to this. I know I'm "late" but I'm still on 2k5 and that gave me NULL.
I tried the same thing on 2k8 and it gave me 1900-01-01.
Can anyone else confirm this or was my test wrong?
July 21, 2011 at 6:06 am
I tried it on a backup server (2008). Didn't want to cycle the server, so I chose a user that was set up, but for which I knew they had not logged into the system. When I run:
SELECT loginproperty('someuser', 'badpasswordcount')
SELECT loginproperty('someuser', 'badpasswordtime')
(where 'someuser' is the login name of an actual user)
I get NULL for both.
[font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
Connect to me on LinkedIn
July 21, 2011 at 6:08 am
I tried it on 2008 and 2008R2 and got a NULL on both.
MG
"There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies."
Tony Hoare
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
July 21, 2011 at 6:15 am
I get NULL when running it on SQL 2008 R2.
Viewing 15 posts - 1 through 15 (of 52 total)
You must be logged in to reply to this topic. Login to reply