[Webinar] Streamline your web hosting managementRegister Today

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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