ananda.murugesan (10/24/2012)
sorry Boss, the same error come againI m using SQL 2K8 R2 64 bit-version.
IF EXISTS(SELECT 1 FROM sys.objects where name='NewTable' and type='U')
begin
DROP TABLE NewTable
end
GO
select *
into NewTable from tbl_contract_emp_master TR inner join
TBL_IRIS_IMAGES_MASTER tm on tr.guid=tm.guid
and EP_NO in ('104536884','104541256','104564417','t12035676','104567770','104556221','104567536')
Erorr
Msg 2705, Level 16, State 3, Line 1
Column names in each table must be unique. Column name 'GUID' in table 'NewTable' is specified more than once.
this below code working fine, but not able to create table New Table
select tr.[GUID]as gid,[EP_NO],[NAME],
[CONTRACTOR_CODE],[CONTRACTOR_NAME],
[SUBCONTRACTOR_NAME],[PLANT_CD],[SKILLCODE],[WORK_AREA],
[DISCIPLINE],[PASSTYPE],[PRES_ADD],[PRES_VILLAGE],
[PRES_TALUKA],[PRES_DISTRICT],[PRES_TEHSIL],[PRES_CITY],
[PRES_STATE],[PRES_PIN],[PRES_TEL_NO],[FATHER_HUS_NAME],
[DT_BIRTH],[DT_JOIN],[EP_VALID_TILL],[LICENSE_NO],
[GENDER],[BLOOD_GROUP],[RELIGION_CD],[ID_MARK],[HEIGHT],
[DT_LEAVE],[COMMENT],[STATUS],tr.[ENROLLTIME] as EntTime,
tr.[OPERATORID] as OptID, [MODIFY_DT],[CONTRACTOR_TYPE],[WORKAREA_CATEGORY]
from TBL_CONTRACT_EMP_MASTER TR
inner join
TBL_IRIS_IMAGES_MASTER tm on tr.[GUID]=tm.[GUID]
and EP_NO in ('104536884','104541256','104564417','t12035676','104567770','104556221','104567536')
sorry Boss, the same error come again
I m using SQL 2K8 R2 64 bit-version.
IF EXISTS(SELECT 1 FROM sys.objects where name='NewTable' and type='U')
begin
DROP TABLE NewTable
end
GO
select *
into NewTable from tbl_contract_emp_master TR inner join
TBL_IRIS_IMAGES_MASTER tm on tr.guid=tm.guid
and EP_NO in ('104536884','104541256','104564417','t12035676','104567770','104556221','104567536')
Erorr
Msg 2705, Level 16, State 3, Line 1
Column names in each table must be unique. Column name 'GUID' in table 'NewTable' is specified more than once.
this below code working fine, but not able to create table New Table
select tr.[GUID]as gid,[EP_NO],[NAME],
[CONTRACTOR_CODE],[CONTRACTOR_NAME],
[SUBCONTRACTOR_NAME],[PLANT_CD],[SKILLCODE],[WORK_AREA],
[DISCIPLINE],[PASSTYPE],[PRES_ADD],[PRES_VILLAGE],
[PRES_TALUKA],[PRES_DISTRICT],[PRES_TEHSIL],[PRES_CITY],
[PRES_STATE],[PRES_PIN],[PRES_TEL_NO],[FATHER_HUS_NAME],
[DT_BIRTH],[DT_JOIN],[EP_VALID_TILL],[LICENSE_NO],
[GENDER],[BLOOD_GROUP],[RELIGION_CD],[ID_MARK],[HEIGHT],
[DT_LEAVE],[COMMENT],[STATUS],tr.[ENROLLTIME] as EntTime,
tr.[OPERATORID] as OptID, [MODIFY_DT],[CONTRACTOR_TYPE],[WORKAREA_CATEGORY]
INTO newTABLE
from TBL_CONTRACT_EMP_MASTER TR
inner join
TBL_IRIS_IMAGES_MASTER tm on tr.[GUID]=tm.[GUID]
and EP_NO in ('104536884','104541256','104564417','t12035676','104567770','104556221','104567536')
Because you error guid column name is TBL_CONTRACT_EMP_MASTER,TBL_CONTRACT_EMP_MASTER
so you are getting this erro use.alias name if there is same column name in different tables.
Malleswarareddy
I.T.Analyst
MCITP(70-451)