| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| I have a table that ONLY has one identity column in it. How do you construct an INSERT statement into a table like this? If you dont use an INSERT statement, then what other way do you insert a record? Table MyId Column1 = MyId int IDENTITY(100000000,1) NOT NULL Using VB6.0 and old ADO, I could create a record using the following lines of code conn.Open(); recordset.Open("SELECT TOP 0 * FROM MyIds", conn) recordset.AddNew recordset.Update id = recordset[0] Some how ADO used an INSERT or some SQL statement to create the row... Does anyone know how that is done? Is there a way to view a SQL transaction log to see what ADO is doing.. then copy that? Any help would be great!!! I am using SQL Server 2005 Below is the script to create the table in question. GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[MyIDsTable]( [MyID] [int] IDENTITY(100000000,1) NOT NULL, CONSTRAINT [PK_MyIDs] PRIMARY KEY NONCLUSTERED ( [MyID] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, FILLFACTOR = 90) ON [PRIMARY] ) ON [PRIMARY] |
![]() |
| Thread Tools | |
| Display Modes | |