Click here to Skip to main content
15,914,162 members
Home / Discussions / Database
   

Database

 
GeneralSetting the lenght of a text field in an SQL Access database... Pin
IrishSonic15-Feb-03 4:40
IrishSonic15-Feb-03 4:40 
GeneralRe: Setting the lenght of a text field in an SQL Access database... Pin
David Salter16-Feb-03 10:42
David Salter16-Feb-03 10:42 
GeneralDocumenting DB,Sprocs,Trigers, etc... Pin
Ray Cassick14-Feb-03 11:43
Ray Cassick14-Feb-03 11:43 
GeneralAnybody plz, what is the following problem and how to solve that... Pin
Exceter13-Feb-03 23:56
Exceter13-Feb-03 23:56 
GeneralRe: Anybody plz, what is the following problem and how to solve that... Pin
Hesham Amin14-Feb-03 11:33
Hesham Amin14-Feb-03 11:33 
GeneralA simple ADO.NET and table design question Pin
DionChen13-Feb-03 5:40
DionChen13-Feb-03 5:40 
GeneralRe: A simple ADO.NET and table design question Pin
Peet Schultz17-Feb-03 8:13
Peet Schultz17-Feb-03 8:13 
GeneralRe: A simple ADO.NET and table design question Pin
Alexander Kojevnikov17-Feb-03 22:22
Alexander Kojevnikov17-Feb-03 22:22 
There're was an article on MSDN covering this issue, but I cannot find it.

What it suggests is to configure your EquipmentID to use negative autoincrement values:
<br />
ds.Tables["Equipment"].Columns["EquipmentID"].AutoIncrementSeed = -1;<br />
ds.Tables["Equipment"].Columns["EquipmentID"].AutoIncrementStep = -1;<br />


...and to modify your insert SP (or insert code if you use Access) to return the newly created identity value. SP would look like this:
<br />
CREATE PROCEDURE dbo.daInsertEquipment<br />
(<br />
	@EquipmentID int OUT,<br />
	@EquipmentDescription nvarchar(200)<br />
)<br />
AS<br />
    INSERT INTO Equipment<br />
    (EquipmentID, EquipmentDescription)<br />
    VALUES (@EquipmentID, @EquipmentDescription)	<br />
    <br />
    SET @id = SCOPE_IDENTITY()<br />


HTH

Alexandre Kojevnikov
MCP (SQL2K)
Leuven, Belgium

GeneralBackup Oracle Pin
Nguyen Huynh Hung13-Feb-03 3:10
Nguyen Huynh Hung13-Feb-03 3:10 
GeneralRe: Backup Oracle Pin
Mark Conger14-Feb-03 0:33
Mark Conger14-Feb-03 0:33 
GeneralADO and ADOX Pin
Miguel Segarra12-Feb-03 8:26
Miguel Segarra12-Feb-03 8:26 
GeneralRe: ADO and ADOX Pin
Rickard Andersson2013-Feb-03 0:37
Rickard Andersson2013-Feb-03 0:37 
GeneralDataSet query Pin
Shaun Wilde11-Feb-03 23:46
Shaun Wilde11-Feb-03 23:46 
GeneralRe: DataSet query Pin
Mazdak12-Feb-03 1:10
Mazdak12-Feb-03 1:10 
GeneralRe: DataSet query Pin
Shaun Wilde12-Feb-03 1:26
Shaun Wilde12-Feb-03 1:26 
GeneralRe: DataSet query Pin
Bruce Duncan12-Feb-03 7:04
Bruce Duncan12-Feb-03 7:04 
GeneralRe: DataSet query Pin
Shaun Wilde12-Feb-03 22:12
Shaun Wilde12-Feb-03 22:12 
GeneralRe: DataSet query Pin
Bruce Duncan13-Feb-03 7:12
Bruce Duncan13-Feb-03 7:12 
GeneralColumn number in SELECT Pin
Mazdak11-Feb-03 23:08
Mazdak11-Feb-03 23:08 
GeneralRe: Column number in SELECT Pin
andyharman11-Feb-03 23:31
professionalandyharman11-Feb-03 23:31 
GeneralRe: Column number in SELECT Pin
Mazdak12-Feb-03 1:05
Mazdak12-Feb-03 1:05 
GeneralUsing Group By Properly Pin
perlmunger11-Feb-03 18:55
perlmunger11-Feb-03 18:55 
GeneralRe: Using Group By Properly Pin
Richard Deeming11-Feb-03 23:44
mveRichard Deeming11-Feb-03 23:44 
GeneralRe: Using Group By Properly Pin
andyharman11-Feb-03 23:45
professionalandyharman11-Feb-03 23:45 
GeneralRe: Using Group By Properly Pin
perlmunger12-Feb-03 2:54
perlmunger12-Feb-03 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.