Friday, 15 May 2015

tsql - I really really want to use an INSERT nested in a SELECT -


I know this is something that can not be unique, but I can not find any way to do this I am thinking of reading my discoveries and, so if this is not possible, then I would like to know if I am choosing the best option.

The simple case of information about people from the old database is new. The problem is that the old schema has an address in every line, and we are breaking it into our own address table for a new address.

What I want to do is something to do [person] [person] ([first name], [last name], [address id], [ssn]) Selection p. [First name], like this:

  INSERT [new db] P [last name], addressID = (- the result of entering the address in the table or existing address' id), p. [SSN] FOR [Old DB] [DBO]. [TLPrisens] P  

Is there any way to do this that I am unable to find, or I get the address first and then match, or am I missing something? Any help would be appreciated, this is the first time that I had to work on advancing someone else's data and my improper optimism would not have much hole in it. ;)

Yes, you must first address & amp; Then the person matches the record to specify the ID when entering the record.

i.e. You can not do an inclusion in the sub query.


No comments:

Post a Comment