Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 14th, 2005, 05:40 AM
Registered User
 
Join Date: Feb 2005
Location: mumbai, maharastra, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to kinshuk
Default ASP program How to add new ID for new record

I am doing programming in ASP and database is SQL Server I am finding problem in ID field This should be autogenerate and increment by 1. Please anyone can help me for the same.
Reply With Quote
  #2 (permalink)  
Old February 14th, 2005, 06:09 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

You can make the column into an Identity column with increment step as 1.

Use your enterprise manager for this.
Reply With Quote
  #3 (permalink)  
Old March 7th, 2005, 01:12 AM
Authorized User
 
Join Date: Feb 2005
Location: Pune, Maharashtra, India.
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SQL Statement to create auto-generated ID field:

CREATE TABLE [MyTable] (
    [ID] [int] IDENTITY (1, 1) NOT NULL ,
    [Column1] [varchar] (50) NOT NULL ,
    [Column3] [datetime] NULL
)
GO

Cheers,
Pooja Falor
Reply With Quote
  #4 (permalink)  
Old March 21st, 2005, 02:43 PM
Registered User
 
Join Date: Jul 2003
Location: dublin, ca, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

kinshuk-

In the SQL Server Enterprise Manager, you can click the database you are working with.

Once the DB is open, you can right click the Table name and select "Design Table"

Click on the Column Identity row of the column you would like to set to autogenerate. Select 'Yes' from the dropdown.

-------------------
namaste,

mike

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP Add New Record and Get ID omninewt Classic ASP Databases 5 April 10th, 2008 12:20 PM
ADD DB RECORD/ RETURN ID Huascar82 Classic ASP Databases 1 October 1st, 2007 11:55 PM
HELP ME to add a record to a database using ASP kumail Classic ASP Databases 3 August 18th, 2005 05:33 AM
why not index.asp?id=1 can be www.myweb.com/?id=1 BurhanKhan Classic ASP Professional 11 September 6th, 2004 02:06 PM
ASP Insert - Get Record ID llowe Classic ASP Databases 2 March 24th, 2004 11:11 AM



All times are GMT -4. The time now is 09:59 PM.


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