December 15, 2008 at 2:00 pm
What will be the appropriate datatypes for following
Username
Machinename
Executionstarttime
Packagename
ExecutioninstanceGUID
Help Appreciated
December 15, 2008 at 2:15 pm
That's really not enough information, but if I had to guess based on the field names:
Username nvarchar(50)
Machinename nvarchar(50)
Executionstarttime datetime
Packagename nvarchar(100)
ExecutioninstanceGUID uniqueidentifier
Note the word *guess*.
December 15, 2008 at 2:17 pm
Garadin (12/15/2008)
That's really not enough information, but if I had to guess based on the field names:Username nvarchar(50)
Machinename nvarchar(50)
Executionstarttime datetime
Packagename nvarchar(100)
ExecutioninstanceGUID uniqueidentifier
Note the word *guess*.
Or
Username sysname,
Machinename sysname,
Executionstarttime datetime,
Packagename sysname,
ExecutioninstanceGUID uniqueidentifier
December 15, 2008 at 2:18 pm
Appropriate datatypes depends entirely upon your application and data usage.
From your column name list, the only obvious choice is
ExecutioninstanceGUID should be a uniqueidentifier.
Executionstarttime could be either a datetime or smalldatetime depending on if seconds/milliseconds are significant.
The remaining columns should probably be varchars and their lengths determined by representative data.
December 15, 2008 at 2:22 pm
Thank you very much i apprerciate your help
December 15, 2008 at 2:22 pm
Thank you very much i apprerciate your help
December 15, 2008 at 2:22 pm
Thank you very much i apprerciate your help
December 15, 2008 at 2:25 pm
Lynn Pettis (12/15/2008)
OrUsername sysname,
Machinename sysname,
Executionstarttime datetime,
Packagename sysname,
ExecutioninstanceGUID uniqueidentifier
For anyone else that is unfamiliar with sysname data type.
FROM 2K8 BOL:
sysnameThe sysname data type is used for table columns, variables, and stored procedure parameters that store object names. The exact definition of sysname is related to the rules for identifiers. Therefore, it can vary between instances of SQL Server. sysname is functionally the same as nvarchar(128) except that, by default, sysname is NOT NULL. In earlier versions of SQL Server, sysname is defined as varchar(30).
Important:
In databases that are case-sensitive, or that have a binary collation, sysname is recognized as a SQL Server system data type only when it appears in lowercase.
Not sure what version marked the change in default from varchar(30) --> nvarchar(128).
December 15, 2008 at 2:27 pm
antonio.collins (12/15/2008)
Appropriate datatypes depends entirely upon your application and data usage.From your column name list, the only obvious choice is
ExecutioninstanceGUID should be a uniqueidentifier.
Executionstarttime could be either a datetime or smalldatetime depending on if seconds/milliseconds are significant.
The remaining columns should probably be varchars and their lengths determined by representative data.
Personally, I'd stay away from the smalldatetime data type. It may take up less space, but I'd be concerned with creating a "Y2K" issue that may not be solved by a newer version of SQL Server between now and 2079. It will be here sooner than you know.
December 15, 2008 at 2:40 pm
Lynn Pettis (12/15/2008)
Personally, I'd stay away from the smalldatetime data type. It may take up less space, but I'd be concerned with creating a "Y2K" issue that may not be solved by a newer version of SQL Server between now and 2079. It will be here sooner than you know.
if any is still using my code 60 years from now, they deserve to suffer! 😀
but seriously, if the business requirement anticipates dates 50 years in the future, then certainly use smalldatetime. btw, if time isn't significant, we generally use an int to represent dates in yyyymmdd format. it suits our requirements to a T.
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply