Solved

stored procuder to insert values into a table, some values can be given and some will be from anoter table

Posted on 2011-09-22
4
243 Views
Last Modified: 2012-05-12
Hi,
I want a stored procedure to insert values into a table, i will give some values through parameters and some of the values should get from another table. How can I get this? please help me.
Thanks in advance.
0
Comment
Question by:CPSRI
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 15

Assisted Solution

by:Eyal
Eyal earned 250 total points
ID: 36579714
insert into table (f1,f2)
select @parameter,field from table where ...
0
 
LVL 6

Accepted Solution

by:
kswathi earned 250 total points
ID: 36579720
You can do so as  following hope it helps

Insert into [yourtable1]
(
Col1,
Col2,
col3
)
Select @Parameter1,
          @parameter2,
         AT.Col1
from anothertable AT

Open in new window

0
 

Author Comment

by:CPSRI
ID: 36579846
got it, thank you Eyal and kswathi for your help, i got to use where condition as per my requirement and i tried that and got the solution
0
 

Author Closing Comment

by:CPSRI
ID: 36579850
got it, thank you Eyal and kswathi for your help, i got to use where condition as per my requirement and i tried that and got the solution
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question