Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 12th, 2006, 02:44 PM
Authorized User
 
Join Date: Jun 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to auto generate date?

i create table call content(Contentinfo, Contenttitle, createdatetime.datetime)

Then in asp.net i am using detailsview to insert the data. So how in the same time i entry the contentinfo and contenttitle, the createdatetime column can auto generate the date and time save to my database?

 
Old December 12th, 2006, 03:49 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

1. Create a new table in Enterprise Manager and create the datetime column. Make sure you don't allow NULLS on this column.

2. In the lower area where it says "Default Value", put in getDate().

Every time you insert into this table it will make a time stamp in that column if that's what you want.





 
Old December 12th, 2006, 07:14 PM
Authorized User
 
Join Date: Jun 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much...it work:D:D




 
Old December 12th, 2006, 08:17 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

OK boy... go get em. Glad it worked for you.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto generate get and set methods jdang67 .NET Framework 2.0 10 January 16th, 2008 08:20 AM
C# Auto Generate Codes lasith C# 0 February 23rd, 2007 02:25 AM
Auto generate no mateenmohd Classic ASP Basics 3 June 11th, 2006 07:06 AM
Auto generate? nikryden BOOK: Beginning VB.NET Databases 2 December 19th, 2005 12:43 PM
auto generate an number utarian Access 2 March 28th, 2005 02:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.