REATE TABLE [dbo].[resource] (
[resourceId] [int] IDENTITY (1, 1) NOT NULL ,
[resPoolId] [varchar] (5000) NULL ,
[resName] [varchar] (100) NULL ,
[resCode] [int] NULL ,
[resInterviewId] [int] NULL ,
[sex] [int] NULL ,
[birthday] [datetime] NULL ,
[birthdayMask] [varchar] (20) NULL ,
[email] [varchar] (100) NULL ,
[phone] [varchar] (100) NULL ,
[cellphone] [varchar] (100) NULL ,
[address] [text] NULL ,
[qq] [varchar] (100) NULL ,
[msn] [varchar] (1024) NULL ,
[marriageId] [int] NULL ,
[degree] [int] NULL ,
[startWorkingTime] [datetime] NULL ,
[resUsage] [int] NULL ,
[comments] [text] NULL ,
[notes] [text] NULL ,
[score] [varchar] (4) NULL ,
[bgInvestigation] [text] NULL ,
[commentAccId] [int] NULL ,
[clientId] [int] NULL ,
[resStatus] [int] NULL ,
[isIndexed] [int] NULL ,
[createAccId] [int] NULL ,
[status] [int] NULL ,
[createTime] [datetime] NULL ,
[lastModifyAccId] [int] NULL ,
[lastModifyTime] [datetime] NULL 
) CREATE TABLE [dbo].[resprop] (
[resPropId] [int] IDENTITY (1, 1) NOT NULL ,
[resourceId] [int] NULL ,
[resPropDefId] [int] NULL ,
[resProp] [text] NULL 
) 就是两个表用resourceId 关联,而还有一个字段resPropDefId来区分放进去的是用户名还是密码(用户名和密码都在[resProp]字段里),用户名和密码都放在resProp字段中,我希望把用户名和密码放进一个临时表里user,password字段里,请高手指教?全部分都给!

解决方案 »

  1.   

    两个表关联,和你想干的事情没有多大关系啊,就是判断resPropDefId,然后插入一个新表这种问题下次直接发到数据库去
      

  2.   

    CREATE TABLE [dbo].[resprop] (
    [resPropId] [int] IDENTITY (1, 1) NOT NULL ,
    [resourceId] [int] NULL ,
    [resPropDefId] [int] NULL ,
    [resProp] [text] NULL  
    ) insert into dbo.resprop values(
    select dbo.resource.resPropId,
           dbo.resource.resourceId,
           dbo.resource.resPropDefId,
           dbo.resource.resProp
    from dbo.rescource
    )