multi-columns with getdate as default - same value? 
Author Message
 multi-columns with getdate as default - same value?

All,
        If I define two columns in a given table as datetime with a default value
of getdate(), will the two columns have the same EXACT value if the
defaults are both used on INSERT?  (I don't currently have access to a
SQLServer instance, otherwise I would just try it out!!).

Thank you,

Rick "I code in Peace" Wyatt



Fri, 28 Jul 2000 03:00:00 GMT
 multi-columns with getdate as default - same value?

Rick,

Well, from testing, it seem like the columns get the same value, I trid to
generate a bit of load (dbcc checkdb) on my laptop (p120), and here's the
output:

select convert(char(20), c1,114) , convert(char(20), c2, 114) from tt

14:00:43:400         14:00:43:400        
14:00:45:233         14:00:45:233        
14:00:45:723         14:00:45:723        
14:00:46:203         14:00:46:203        
14:00:46:686         14:00:46:686        
14:05:19:096         14:05:19:096        
14:05:22:820         14:05:22:820        
14:05:23:573         14:05:23:573        
14:05:24:443         14:05:24:443        
14:05:25:586         14:05:25:586        
14:05:26:546         14:05:26:546        
14:05:27:740         14:05:27:740        
14:05:44:143         14:05:44:143        
14:05:45:093         14:05:45:093        
14:05:46:536         14:05:46:536        
14:05:47:426         14:05:47:426  
--

MCSE, MCSD, MCT, SQL Server MVP
Cornerstone Sweden AB



Quote:
> All,
>    If I define two columns in a given table as datetime with a default
value
> of getdate(), will the two columns have the same EXACT value if the
> defaults are both used on INSERT?  (I don't currently have access to a
> SQLServer instance, otherwise I would just try it out!!).

> Thank you,

> Rick "I code in Peace" Wyatt



Sat, 29 Jul 2000 03:00:00 GMT
 multi-columns with getdate as default - same value?

Tibor,
        Thank you VERY much for your time spent.

I appreciate the effort.

Rick "I code in Peace" Wyatt



Quote:
> Rick,

> Well, from testing, it seem like the columns get the same value, I trid
to
> generate a bit of load (dbcc checkdb) on my laptop (p120), and here's the
> output:

> select convert(char(20), c1,114) , convert(char(20), c2, 114) from tt

> 14:00:43:400         14:00:43:400        
> 14:00:45:233         14:00:45:233        
> 14:00:45:723         14:00:45:723        
> 14:00:46:203         14:00:46:203        
> 14:00:46:686         14:00:46:686        
> 14:05:19:096         14:05:19:096        
> 14:05:22:820         14:05:22:820        
> 14:05:23:573         14:05:23:573        
> 14:05:24:443         14:05:24:443        
> 14:05:25:586         14:05:25:586        
> 14:05:26:546         14:05:26:546        
> 14:05:27:740         14:05:27:740        
> 14:05:44:143         14:05:44:143        
> 14:05:45:093         14:05:45:093        
> 14:05:46:536         14:05:46:536        
> 14:05:47:426         14:05:47:426  
> --

> MCSE, MCSD, MCT, SQL Server MVP
> Cornerstone Sweden AB



> > All,
> >       If I define two columns in a given table as datetime with a default
> value
> > of getdate(), will the two columns have the same EXACT value if the
> > defaults are both used on INSERT?  (I don't currently have access to a
> > SQLServer instance, otherwise I would just try it out!!).

> > Thank you,

> > Rick "I code in Peace" Wyatt



Sat, 29 Jul 2000 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Incorrect results using getdate() as default value

2. Default values in SQL SERVER 7 - getdate() and current_timestamp()

3. A Useful Date Conversion Function -- Problem Initializing Default Function Value to Getdate()

4. Use GetDate() as default param value

5. GetDate() function as the default value

6. GetDate() function as the default value

7. Default values in SQL SERVER 7 - getdate() and current_timestamp()

8. Default values in SQL SERVER 7 - getdate() and current_timestamp()

9. Default values in SQL SERVER 7 - getdate() and current_timestamp()

10. current value of default value in column?

11. Setting Default Value to value of another column

12. HELP - Accessing column values in multi-column ComboBox


 
Powered by phpBB® Forum Software