473,385 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

insert record in a table with 'identity' constraint on it ... ?

Hi all,

I want to insert a record at a time from front end i.e. vba in a table located on sql server. But, one field on that table has an 'identity' constraint which is not enabling me to insert record . Please help me.


Regards,
Swati.
Dec 18 '06 #1
1 2016
almaz
168 Expert 100+
Hi all,

I want to insert a record at a time from front end i.e. vba in a table located on sql server. But, one field on that table has an 'identity' constraint which is not enabling me to insert record . Please help me.


Regards,
Swati.
If you want to insert a specific value into identity column, you can use the syntax:
Expand|Select|Wrap|Line Numbers
  1. set identity_insert YourTable on
  2. -- perform insert into YourTable
  3. set identity_insert YourTable off
Dec 18 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: brent.ryan | last post by:
How do I get the next int value for a column before I do an insert in MY SQL Server 2000? I'm currently using Oracle sequence and doing something like: select seq.nextval from dual; Then I...
4
by: teddysnips | last post by:
I am trying to insert a row into a table using a stored procedure and I get the following error if I try this from QA: INSERT failed because the following SET options have incorrect settings:...
1
by: Bernhard | last post by:
I try to retrieve the value of the identity-column of a table: SELECT PLAYER_ID INTO O_PLAYER_ID FROM NEW TABLE(INSERT INTO GAMESCORE.PLAYER (LAST_NAME, FIRST_NAME, NICK_NAME, EMAIL) VALUES...
6
by: Larry Johnson | last post by:
I have two similar SQL Server databases each with a table named Payments. PaymentID is an identity field and the primary, unique, key in both tables. There is one other key but it is not unique. ...
8
by: Bri | last post by:
Greetings, I'm having a very strange problem in an AC97 MDB with ODBC Linked tables to SQL Server 7. The table has an Identity field and a Timestamp field. The problem is that when a new record...
2
by: trint | last post by:
I am trying to insert a record, but I have to get an automatically created identity field at the same time to do this. string strSQL2 = "INSERT INTO tblTravelDetail(MemberID, " + "...
2
by: dbuchanan | last post by:
Hello, My insert results in two records - or better stated the temporary record (with the temporary ID value of -1) stays as the stored procedure returns the new record with its data base...
0
by: swatijogdand | last post by:
Hi all, I want to insert a record at a time from front end i.e. vba in a table located on sql server. But, one field on that table has an 'identity' constraint which is not enabling me to insert...
2
by: ksenthilbabu | last post by:
Hey All, I am using MSSQL -2005 with VB6. I have created a master table tblCompany and detail Table tblDetail having foreign key relationship. When i try to insert a value within a TRANSACTION I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.