![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi: I am pumping data from a Sybase database into SQL Server that will be run daily. I am trying to set a composite Primary Key on the destination table. In this table, it is made unique by a combination of these Three fields: AgentDateTime AgentLogin SupervisorLogin For example, if during a certain time period an agent had two supervisors, there will be 2 records. The SupervisorLogin refers to the AgentLogin of the supervisor. Problem is, there is data for Supervisors who do not have supervisors above them, and in this case their SupervisorLogin is null. So I cannot use a nullable field as a primary key. However, a combination of this supervisor's login, a particular datetime, and a null value makes the record unique. So I think what I need to do here is set this null value to a non null value during the data pump from Sybase to SQL Server, something like top level supervisor> or something like that. Right now I am just doing a select * from each of the Sybase tables (actualy building in a where clause dyanmically through an ActiveX Script task for the date). What is the best way to accomplish this? Thanks, Kayda |
![]() |
| Thread Tools | |
| Display Modes | |
| |