Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 267
  • Last Modified:

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

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
CPSRI
Asked:
CPSRI
  • 2
2 Solutions
 
EyalCommented:
insert into table (f1,f2)
select @parameter,field from table where ...
0
 
kswathiCommented:
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
 
CPSRIAuthor Commented:
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
 
CPSRIAuthor Commented:
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
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.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now