[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2441
  • Last Modified:

Set Identity_insert on does not work

I have the following statements in the Query analyser (SQL server 2000).... can not be simpler

SET IDENTITY_insert attendancetype on
insert into attendancetype select * from members..attendancetype
SET IDENTITY_insert attendancetype off

and I am getting a failure message
An explicit value for the identity column in table 'attendancetype' can only be specified when a column list is used and IDENTITY_INSERT is ON.

I tried every thing including rebooting my computer.... no change... What is wrong in thse statements, please help. There is no other table in the session that has IDENTITY_INSERT On in the session, I restarted new session of query analyser, but no use. Is there a way to know what can be the reason.
Thanks In advance

0
fmichail
Asked:
fmichail
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
You need to explicitly mention the columns

insert into attendancetype(Colmn1, col2, col3 )   select col1,col2,col3  from members..attendancetype
0
 
fmichailAuthor Commented:
Thanks aneesshattingal
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now