Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
TajKazi
Posting Yak Master
101 Posts |
Posted - 2014-11-04 : 05:15:58
|
declare @kk int set @kk=0 insert into tblSSAppsOrgEntityToEmployerMapDiffer ( Id, OrgEntityCode, EmployerId, [Default], Active, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn) select @kk+1, entity, employer, [default], active, created_by, created_on, modified_by, modified_on from tblSSAppsOrgEntityToEmployerMapTempin above example Id is PK for Differ tbl and Temp tbl not having field related to this. thats why i have to take and increment that Id value manually.... but like above way i m getting error ............ please somebody help me |
|
TajKazi
Posting Yak Master
101 Posts |
Posted - 2014-11-04 : 07:16:42
|
without using identity |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2014-11-04 : 07:51:29
|
Try this - declare @kk intset @kk=0insert into tblSSAppsOrgEntityToEmployerMapDiffer ( Id,OrgEntityCode,EmployerId,[Default],Active,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn)select ROW_NUMBER() OVER ( ORDER BY (SELECT 1) ),entity,employer,[default],active,created_by,created_on,modified_by, modified_onfrom tblSSAppsOrgEntityToEmployerMapTempVaibhav TIf I cant go back, I want to go fast... |
|
|
TajKazi
Posting Yak Master
101 Posts |
Posted - 2014-11-05 : 00:27:26
|
vaibhavktiwari83.......thanx a very lot |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
TajKazi
Posting Yak Master
101 Posts |
Posted - 2014-11-06 : 07:11:11
|
thanks to all of U |
|
|
|
|
|
|
|