|
#1
|
|||
|
|||
|
SQL Server 2008, how to set date format
In SQL Server 2008 Management Studio, how can we set the date display format to mm/dd/yyyy? Is to be done every session? Or, is it something that to be set at the database level?
Thanks. |
|
#2
|
||||
|
||||
|
Does this help?
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section. ![]() Please use [Code]your code goes in here[/Code] tags when posting code. Before posting your question, did you look here? Got a question on Linux? Visit our Linux sister site. Modifications Required For VB6 Apps To Work On Vista ![]() Microsoft MVP 2005/2006/2007/2008/2009 |
|
#3
|
|||
|
|||
|
It should default to a format
No, it doesn't help. There is no need to all these formatting. When you open the contents of the table, the date fields should default to a format.
|
|
#4
|
|||
|
|||
|
rkbnair
SQL Server is different from Microsoft Access. It does not have the fancy look of showing date out of the box in a format like Access does. When you run a query, you then determine at that point what format you want the date to be. Other things you could do is to do the following: Set the database collation to Latin1_General_CI_AS and probably set the language to US English. http://msdn.microsoft.com/en-us/library/ms187928.aspx The link provided above will help you format date when running a query. If you open a query window, you can run this: Code:
SELECT convert(char(10),getdate(),101) If you wish to run the query against tableA with date column being MyDate, you will use Code:
SELECT
convert(char(10),MyDate,101)
FROM
tableA
Emefa |
|
#5
|
|||
|
|||
|
Agree. But it shouldn't be much different from SQL 2005, right ?
![]() Why it is defaulted in SQL 2005 and not available in 2008? |
|
#6
|
|||
|
|||
|
Good question.
Sure enough, I fired up my 2008 and 2005 side by side and you are very right. I wonder why they changed it. I know the concept of Date and Datetime2(7) got added. That probably explains why the difference is the way it is. Don't you just love it when things like this change from version to version? I bet someone will write an article about this if it is not already out there somewhere. Emefa |
|
#7
|
|||
|
|||
|
yeah, you are absolutely right. Should have written an article
|
|
#8
|
||||
|
||||
|
This is as close to an article on the subject as I could find.
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section. ![]() Please use [Code]your code goes in here[/Code] tags when posting code. Before posting your question, did you look here? Got a question on Linux? Visit our Linux sister site. Modifications Required For VB6 Apps To Work On Vista ![]() Microsoft MVP 2005/2006/2007/2008/2009 |
|
#9
|
||||
|
||||
|
I don't have sql server 2008 yet but thanks, I'll keep in mind
|
|
#10
|
|||
|
|||
|
use AQL 2008 that's good
|
|
#11
|
||||
|
||||
|
What is AQL?
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section. ![]() Please use [Code]your code goes in here[/Code] tags when posting code. Before posting your question, did you look here? Got a question on Linux? Visit our Linux sister site. Modifications Required For VB6 Apps To Work On Vista ![]() Microsoft MVP 2005/2006/2007/2008/2009 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SQL Server 2008 -- Trouble adding Foreign Key | lagyossarian | Database | 2 | 09-18-2009 03:17 PM |
| find version & service packs | rperez | Database | 5 | 01-02-2009 05:14 PM |
| SQL DMO Restores in VB? | ObiWan | VB Classic | 3 | 05-23-2006 11:35 AM |
| How can i change set the date format in sql2000 to dd/mm/yyyy???? | Guillermo | Database | 2 | 06-29-2001 12:16 PM |
| How to set up a Current date field in SQL server | Tiffany Sanches | VB Classic | 2 | 01-19-2001 08:24 PM |