![]() ![]() It has no effect on the display of date values.The setting of SET DATEFORMAT is set at execute or run time and not at parse time. English default is mdy.RemarksThis setting is used only in the interpretation of character strings as they are converted to date values. Valid parameters include mdy, dmy, ymd, ydm, myd, and dym. Can be either Unicode or DBCS converted to Unicode. SyntaxSET DATEFORMAT Argumentsformat | the order of the dateparts. SET DATEFORMATSets the order of the dateparts (month/day/year) for entering datetime or smalldatetime data. SO i will explain my problemIn my firm we wrote a 4 projects for SQL in usa date formati can not fix now the program to work with different format it's to much code to fix.so in oracle i can solve the problem with :Alter session set NLS_DATE_FORMAT='MM/DD/yy' and now the 4 progrmas work good What can i do in Sql with out changing the Codeĭo you have sql server client tools installed?Look it up in Books Online. Why do you want to do this? USE NorthwindGOCREATE TABLE myTable99(Col1 datetime)GODECLARE varchar(25)SET = '12/31/03'INSERT INTO myTable99(Col1) SELECT UNION ALL SELECT GetDate()SELECT CONVERT(varchar(10),Col1,1), Col1 FROM myTable99DROP TABLE myTable99GOBrett8-) It only affects the order in which character strings are parsed when converting to datetime.OSġ.Is this function sets the Sql to work with mdy in insert and select2.do i need to return to default after i finish or it's only for my connection I don't really know what that command does in Oracle, but note that in SQL Server, this does not affect the display of dates or the formatting of dates. Hi AllIn Oracle i set the date format like thisAlter session set NLS_DATE_FORMAT='MM/DD/yy' How do i do it in SQLĬlose enough:SET DATEFORMAT mdyvalid options include dmy, mdy, ymd, etc. We've got lots of great SQL ServerĮxperts to answer whatever question you can come up with. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |