Need help constructing SQL query with subquery

I need to create a view that will insert data into a table using the id from a record in another table...Here's my data setup:

WorkflowRules table
WKRL_RULEID | WKRL_CAPTION
5                    |  Escalate
6                    |  Test

WorkflowActionLinks table
ACLI_ACTIONLINKID   | ACLI_ACTIONGROUPID
1                                     5
2                                     5

select * from workflowrules where wkrl_caption = 'escalate'

then use the WKRL_RULEID (record 5) to INSERT into individual records into the WorkflowActionLinks table-- the ACLI_ACTIONGROUPID and WKRL_RULEID are the tied keys in the relationship.  So, using one SQL statement per INSERT into the WorkflowActionLinks, how can I create an INSERT statement with a subquery using my SQL query above?

saturationAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tigin44Commented:

did you mean something like this..

INSERT INTO WorkflowActionLinks (ACLI_ACTIONLINKID, ACLI_ACTIONGROUPID)
SELECT SomeID, WKRL_RULEID
FROM WorkflowRules
WHERE WKRL_CAPTION = 'escalate'
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
saturationAuthor Commented:
Almost, but it uses the WKRL_RULEID from the other query as the ACLI_ACTIONGROUPID.
0
tigin44Commented:
This query does you what you mentioned.. if you something different can you explain more details...
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

saturationAuthor Commented:
Well, the statements above are separate...I need to take use the ID from the first select statement and use that ID as the data forACLI_ACTIONGROUPID on the INSERTing into WorkflowActionLinks.  Is it possible?
0
tigin44Commented:
can you explain what you want clearly?..
0
SharathData EngineerCommented:
Your requirement is not clear. As tigin44 mentioned, the query should work for you. If you want more details on what are all the ways to INSERT data, you can refer msdn.microsoft.com
http://msdn.microsoft.com/en-us/library/ms174335.aspx 
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.