March 9, 2012 at 8:12 am
Hi All,
I need help with the following query:
LinksTable looks like this:
LinkId Name
-------------
5070 myapp
5071 myapp
5073 myapp
1 another app
3 anotherapp
xRef table looks like this:
EmployeeId LinkId LinkName
-----------------------
2 4 anotherapp
7 6 anotherapp
8 5 anotherapp
I need to add entiries into the xRef table as:
EmployeeId LinkId LinkName
-----------------------
2 5070 myapp
7 5071 myapp
8 5073 myapp
In other words, take employeeid from xRef table where LinkName = 'anotherapp'
and insert records into xRef with that employeeid and get the linkId and LinkName from
Linkstable and insert it into xRef along with the employeeid.
How do I do that?
March 9, 2012 at 8:21 am
Is this a set structure, the data does not look particulary normalised.
MCITP SQL 2005, MCSA SQL 2012
March 9, 2012 at 8:39 am
Can anyone help please.
March 9, 2012 at 1:49 pm
We can probably help. it will most likely take 2 inserts. other than that not much any one else can do with out sample data and table definitions.
Please see http://www.sqlservercentral.com/articles/Best+Practices/61537/ for more information
For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]
Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
Jeff Moden's Cross tab and Pivots Part 1[/url]
Jeff Moden's Cross tab and Pivots Part 2[/url]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply