0

Hello,

I am just starting out with ASP.Net using VB.Net.

I am trying to build a football website for my football club that has a backend CMS system. I have the database designed with primary and foerign keys in SQL Server 2005.

I would like some help to:
1) Insert information into a table containing a primary key ?
2) Get that primary key back and then either insert into a new table with new data or to store the ID in a session ?

any help would be much appreciated

Thanks

4
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by questpond
0

You can retrieve your primary key anytime when you want to use it as foreign key to another table, meaning you must have sub query on your stored procedures.
This might be helpfull, you can learn a lot about this
http://www.1keydata.com

0

You can insert values directly in to a PK column depending on how you have the column configured but it sounds like you're referring to an autoincrementing PK value? If so you can Select SCOPE_IDENTITY() after your insert runs to return the PK's value.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.