November 18, 2015 at 3:28 pm
Steve Jones - SSC Editor (11/18/2015)
Eirikur Eiriksson (11/17/2015)
Coming from a cold country you have to excuse my ignorance but where is the winter?
😎
Hopefully coming soon. Not nearly enough snow here now
Front range doesn't keep the snow long any way. You want the long term winter snow you have to go to the high country.
November 19, 2015 at 2:45 am
Sean Lange (11/18/2015)
Ed Wagner (11/18/2015)
Lynn Pettis (11/18/2015)
rodjkidd (11/18/2015)
Lynn Pettis (11/18/2015)
robert.sterbal 56890 (11/18/2015)
Luis Cazares (11/18/2015)
Why should we consider using hashtags? Is there any benefit on that? The forum software won't recognize them, I'm not sure if search engines would care, and what relevance would they have. This is an honest question, as there might be a good reason which I don't know.The topic is, Are the posted questions getting worse?
If you tag the questions, it is easier to analyze if the posted questions are getting worse.
As others have noted, many years ago we deviated from the original topic of this thread. It is now our Water Cooler. Again, I recommend taking a few months and reading this thread from the beginning.
Ah yes I remember the "fun" of reading the first few hundred pages or so to begin with. Then losing track and having to spend a few weeks reading 30-50 posts day to catch up again. It does help explain some of the madness / quirks / fun / references and who people are, etc in this Thread!
Rodders...
I did get a text from the Hippo asking if any one was planning a party at the Tent in the Desert any time soon. Apparently there is still a big mess needing to be cleaned up from the last party.
You gave the Hippo a phone??? :w00t::w00t::w00t: Hippos don't have opposable thumbs. It must have voice recognition.
Yes it is Hiri only available on the iHippo 8. :hehe:
Why am I thinking we should have Hippo in the Tent T-shirts for next years Threadizens get together at Summit?
I also though #FrontRowGroupies would make a great t-shirt. If Bob Ward comes over for SQL Bits next year, I think I will see how many people want one...
Rodders...
November 19, 2015 at 4:26 am
Lynn Pettis (11/18/2015)
Steve Jones - SSC Editor (11/18/2015)
Eirikur Eiriksson (11/17/2015)
Coming from a cold country you have to excuse my ignorance but where is the winter?
😎
Hopefully coming soon. Not nearly enough snow here now
Front range doesn't keep the snow long any way. You want the long term winter snow you have to go to the high country.
We're expecting the first snow of the season this weekend, but the ground isn't frozen here yet, so it'll melt pretty quickly. There are always those that complain about the snow, as if they've forgotten where they live. All I ever ask is that the utilities be kept on and the road commission actually plow the roads. Sadly, the last one seems to be a more unreasonable expectation.
November 19, 2015 at 5:04 am
Ed Wagner (11/19/2015)
We're expecting the first snow of the season this weekend, but the ground isn't frozen here yet, so it'll melt pretty quickly. There are always those that complain about the snow, as if they've forgotten where they live. All I ever ask is that the utilities be kept on and the road commission actually plow the roads. Sadly, the last one seems to be a more unreasonable expectation.
I agree. Also as long as the snow removal does not take out the mailbox. A truck going 35 MPH plus throws snow very hard and has taken out more than one of my mailboxes. 😀
November 19, 2015 at 10:07 am
I was going to post this over in Steve's call for Good Basic T-SQL Exercises but decided not to pollute the topic with fluff...
So I'm posting it here...
Just for Jeff Moden:
How to get the date from SQL Server.
Sample data required: None
Queries:
SELECT SYSDATETIME();
SELECT SYSDATETIMEOFFSET();
SELECT SYSUTCDATETIME();
SELECT CURRENT_TIMESTAMP();
SELECT GETDATE();
SELECT GETUTCDATE();
:hehe:
November 19, 2015 at 10:11 am
jasona.work (11/19/2015)
I was going to post this over in Steve's call for Good Basic T-SQL Exercises but decided not to pollute the topic with fluff...So I'm posting it here...
Just for Jeff Moden:
How to get the date from SQL Server.
Sample data required: None
Queries:
SELECT SYSDATETIME();
SELECT SYSDATETIMEOFFSET();
SELECT SYSUTCDATETIME();
SELECT CURRENT_TIMESTAMP();
SELECT GETDATE();
SELECT GETUTCDATE();
:hehe:
Jason, you have failed this query.
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near ')'.
November 19, 2015 at 10:15 am
Luis Cazares (11/19/2015)
jasona.work (11/19/2015)
I was going to post this over in Steve's call for Good Basic T-SQL Exercises but decided not to pollute the topic with fluff...So I'm posting it here...
Just for Jeff Moden:
How to get the date from SQL Server.
Sample data required: None
Queries:
SELECT SYSDATETIME();
SELECT SYSDATETIMEOFFSET();
SELECT SYSUTCDATETIME();
SELECT CURRENT_TIMESTAMP();
SELECT GETDATE();
SELECT GETUTCDATE();
:hehe:
Jason, you have failed this query.
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near ')'.
Even better then!
The learner has to figure out what the problem is!
OK, I'll admit I had MSDN open so I could get *all* the date / time functions, I wasn't paying attention to the syntax as I went and just naturally presumed they all had the () in them...
November 19, 2015 at 10:24 am
I'm sorry, I'm just watching too much Green Batman Arrow, lately. 😀
November 19, 2015 at 10:34 am
jasona.work (11/19/2015)
Luis Cazares (11/19/2015)
jasona.work (11/19/2015)
I was going to post this over in Steve's call for Good Basic T-SQL Exercises but decided not to pollute the topic with fluff...So I'm posting it here...
Just for Jeff Moden:
How to get the date from SQL Server.
Sample data required: None
Queries:
SELECT SYSDATETIME();
SELECT SYSDATETIMEOFFSET();
SELECT SYSUTCDATETIME();
SELECT CURRENT_TIMESTAMP();
SELECT GETDATE();
SELECT GETUTCDATE();
:hehe:
Jason, you have failed this query.
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near ')'.
Even better then!
The learner has to figure out what the problem is!
OK, I'll admit I had MSDN open so I could get *all* the date / time functions, I wasn't paying attention to the syntax as I went and just naturally presumed they all had the () in them...
Or if we want to make things difficult on ourselves, we can add this:
SELECT DATEADD(ms,ms_ticks%1000,DATEADD(ss,ms_ticks/1000,sqlserver_start_time))
FROM sys.dm_os_sys_info
Of course, we have to do it in this silly nested fashion to account for the possibility that the server's been up for more milliseconds than integer can handle (a little shy of 25 days). Obviously very useful :rolleyes:
November 19, 2015 at 10:39 am
Jacob Wilkins (11/19/2015)
jasona.work (11/19/2015)
Luis Cazares (11/19/2015)
jasona.work (11/19/2015)
I was going to post this over in Steve's call for Good Basic T-SQL Exercises but decided not to pollute the topic with fluff...So I'm posting it here...
Just for Jeff Moden:
How to get the date from SQL Server.
Sample data required: None
Queries:
SELECT SYSDATETIME();
SELECT SYSDATETIMEOFFSET();
SELECT SYSUTCDATETIME();
SELECT CURRENT_TIMESTAMP();
SELECT GETDATE();
SELECT GETUTCDATE();
:hehe:
Jason, you have failed this query.
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near ')'.
Even better then!
The learner has to figure out what the problem is!
OK, I'll admit I had MSDN open so I could get *all* the date / time functions, I wasn't paying attention to the syntax as I went and just naturally presumed they all had the () in them...
Or if we want to make things difficult on ourselves, we can add this:
SELECT DATEADD(ms,ms_ticks%1000,DATEADD(ss,ms_ticks/1000,sqlserver_start_time))
FROM sys.dm_os_sys_info
Of course, we have to do it in this silly nested fashion to account for the possibility that the server's been up for more milliseconds than integer can handle (a little shy of 25 days). Obviously very useful :rolleyes:
Only works on 2008+ and it isn't really very accurate. I tried this out and found some variances between this and getdate() greater than 5 minutes. It is however pretty clever.
SELECT DATEADD(ms,ms_ticks%1000,DATEADD(ss,ms_ticks/1000,sqlserver_start_time))
, GETDATE()
FROM sys.dm_os_sys_info
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 19, 2015 at 10:55 am
Sean Lange (11/19/2015)
Jacob Wilkins (11/19/2015)
jasona.work (11/19/2015)
Luis Cazares (11/19/2015)
jasona.work (11/19/2015)
I was going to post this over in Steve's call for Good Basic T-SQL Exercises but decided not to pollute the topic with fluff...So I'm posting it here...
Just for Jeff Moden:
How to get the date from SQL Server.
Sample data required: None
Queries:
SELECT SYSDATETIME();
SELECT SYSDATETIMEOFFSET();
SELECT SYSUTCDATETIME();
SELECT CURRENT_TIMESTAMP();
SELECT GETDATE();
SELECT GETUTCDATE();
:hehe:
Jason, you have failed this query.
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near ')'.
Even better then!
The learner has to figure out what the problem is!
OK, I'll admit I had MSDN open so I could get *all* the date / time functions, I wasn't paying attention to the syntax as I went and just naturally presumed they all had the () in them...
Or if we want to make things difficult on ourselves, we can add this:
SELECT DATEADD(ms,ms_ticks%1000,DATEADD(ss,ms_ticks/1000,sqlserver_start_time))
FROM sys.dm_os_sys_info
Of course, we have to do it in this silly nested fashion to account for the possibility that the server's been up for more milliseconds than integer can handle (a little shy of 25 days). Obviously very useful :rolleyes:
Only works on 2008+ and it isn't really very accurate. I tried this out and found some variances between this and getdate() greater than 5 minutes. It is however pretty clever.
SELECT DATEADD(ms,ms_ticks%1000,DATEADD(ss,ms_ticks/1000,sqlserver_start_time))
, GETDATE()
FROM sys.dm_os_sys_info
Yeah, there are some discrepancies you can't reconcile even with more convoluted attempts using the sqlserver_start_time_ms_ticks column to adjust for that. As a method for getting the current date and time it's rather poor. It would usually work for getting the date (unless you're right at the border of a new day where the inaccuracy pushes you one way or the other), but it's obviously a terrible choice for such a task.
It's more the basis for an exercise in needlessly obfuscating a simple task (as it stands it's not so obfuscated yet); I just find the exercise mildly entertaining 🙂
November 19, 2015 at 11:15 am
Luis Cazares (11/19/2015)
jasona.work (11/19/2015)
I was going to post this over in Steve's call for Good Basic T-SQL Exercises but decided not to pollute the topic with fluff...So I'm posting it here...
Just for Jeff Moden:
How to get the date from SQL Server.
Sample data required: None
Queries:
SELECT SYSDATETIME();
SELECT SYSDATETIMEOFFSET();
SELECT SYSUTCDATETIME();
SELECT CURRENT_TIMESTAMP();
SELECT GETDATE();
SELECT GETUTCDATE();
:hehe:
Jason, you have failed this query.
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near ')'.
Oh, for heaven's sake. I never would have thought ... Just ran through the queries myself. Now I know something I didn't know about that particular function. Only, can it really be called a function without the same syntax as all other functions?
Interesting.
And if you're going to tell people they have "failed this query," you need to wear a better hoodie and have a sharper arrow. @=)
November 19, 2015 at 11:24 am
You're missing the obvious way to get the current date. :hehe:
USE [msdb]
GO
DECLARE @jobId BINARY(16);
EXEC dbo.sp_add_job @job_name=N'GetCurrentDate',
@enabled=1, @job_id = @jobId OUTPUT;
EXEC dbo.sp_add_jobserver
@job_name = N'GetCurrentDate' ;
EXEC dbo.sp_add_jobstep
@job_name = N'GetCurrentDate',
@step_name = N'Simple Select',
@subsystem = N'TSQL',
@command = N'SELECT 1',
@retry_attempts = 5,
@retry_interval = 5 ;
EXEC dbo.sp_start_job N'GetCurrentDate';
WAITFOR DELAY '00:00:01';
SELECT TOP 1 dbo.agent_datetime(run_date, run_time)
FROM dbo.sysjobhistory h
WHERE h.job_id = @jobId;
EXEC dbo.sp_delete_job @job_name=N'GetCurrentDate';
November 19, 2015 at 11:29 am
Sean Lange (11/19/2015)
It is however pretty clever.
Talking about me again. I'm both "pretty" (in a very masculine way) and "clever". 😛
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
November 19, 2015 at 11:36 am
Jack Corbett (11/19/2015)
Sean Lange (11/19/2015)
It is however pretty clever.Talking about me again. I'm both "pretty" (in a very masculine way) and "clever". 😛
As my wife says, mother's opinions aren't valid to define prettiness and cleverness.:-D
Viewing 15 posts - 51,511 through 51,525 (of 66,712 total)
You must be logged in to reply to this topic. Login to reply