i have four table
table user info = there are 6 columns one is primary key
tables user roles = two columns one is primary key
table user dep = two fields one is primary key
table user profile = there are four fields one is primary key
others fields are foreign keys(table info,table roles,table dep)
questions is of which table we have to make a store procedure and what is query for that
i wrote for table info m right or not - CREATE PROCEDURE [USERINFORMATION]
-
@Id int
-
,@LogInName varchar(50)
-
,@FirstName varchar(50)
-
,@LastName varchar(50)
-
,@EmailAddress varchar(50)
-
,@Password varchar(50)
-
-
AS
-
BEGIN
-
INSERT
-
INTO [tUserInfom]
-
(
-
Id
-
,LogInName
-
,FirstName
-
,LastName
-
,EmailAddress
-
,Password
-
)
-
VALUES
-
(
-
@Id
-
,@LogInName
-
,@FirstName
-
,@LastName
-
,@EmailAddress
-
,@Password
-
)
-
END
2 1233 Rabbit 12,516
Recognized Expert Moderator MVP
I have no idea what your question is. Please try to explain in more detail.
Frinavale 9,735
Recognized Expert Moderator Expert
Stored procedures are not associated with any database tables. They are just procedures that exist in the database that do "Things". The things that they do might involve one table, several tables or no tables at all.
The stored procedure you posted simply inserts a record into the tUserInfom table; however it should probably be expanded upon to also insert rows into the other 3 tables that depend on the record inserted....
For example: -
-
CREATE PROCEDURE [USERINFORMATION]
-
@Id int
-
,@LogInName varchar(50)
-
,@FirstName varchar(50)
-
,@LastName varchar(50)
-
,@EmailAddress varchar(50)
-
,@Password varchar(50)
-
-
AS
-
BEGIN
-
-
INSERT INTO [tUserInfom] (Id,LogInName,FirstName,LastName,EmailAddress,Password)
-
VALUES (@Id,@LogInName,@FirstName,@LastName,@EmailAddress,@Password);
-
-
Insert Into tUserRoles (RoleID, UserID) Values("ViewContent",@ID);
-
-
--....etc....--
-
-
END
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Alessandro |
last post by:
Hi, here is the problem...
I must create a store procedure that do the following...
1. select id_name,...'some other field' from table 'data' where 'criteria' =
@parameter
2. use the result...
|
by: TARUN |
last post by:
Hello All
I get stuck in one problem , Please help me and excuse me on the poor
Knowledge
in SQL Server Store procedure
Q1...I want to return a string type value from store procedure , Is it...
|
by: c676228 |
last post by:
Hi everyone,
I wrote a store procedure that fetch one row data in the database based on
the parameter value I entered. After I created the store procedure,
the store procedure code looks like...
|
by: zhenyuandeng |
last post by:
Hi,
When i call the procedure sp_jysczld_new from the Query Analyzer, it runs slowly.
But when i extract the sql scripts from the procedure sp_jysczld_new, it runs quickly.
Why? I don't...
|
by: c676228 |
last post by:
Hi everyone,
I am just wodering in asp program, if there is anybody writing store
procedure for inserting data into database since there are so many parameters
need to be passed into store...
| |
by: ipez75 |
last post by:
Hello everyone,
I have a web application written in asp 6.0, my problem is that I execute a sql server store procedure and I get an empty recordset, while executing the same sp on query anlyzer I...
|
by: ramuygl |
last post by:
want to create store procedure that. want to send the table name as argument and retrive the data of that argument. and want to store data in temperary table using the insert query.
HERE I AM...
|
by: asifNewbie |
last post by:
I have created table like this...
CREATE TABLE INVOICEMASTER(INVOICEID INT IDENTITY(1,1),EXPORTER_REF INT,CONSIGNEE_REF INT,BUYER_REF INT,AGENT_REF INT,INVOICENO VARCHAR(20),INVOICEDATE...
|
by: poonamt |
last post by:
Hello Friends,
I created web application in .net using C# where i created parameterized store procedure for join query but its showing me same result for different parameter in .net but when i...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |