Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Modifying a table from a view

Author  Topic 

homeguard
Starting Member

32 Posts

Posted - 2008-06-18 : 10:09:11
I have two tables, a data table (MainTable) that contains a user initials and other empty rows and then i have a user table.

I also have an inner join view with the initials from both tables as the joining field.

I want the users to be able to modify the data table (MainTable) but also display the users name field.

here is the sql of the view:

SELECT     dbo.MainTable.DateCreated, dbo.InitialsListing.Initials, dbo.MainTable.CustomerNumber, dbo.InitialsListing.AdvocateName, 
dbo.MainTable.Supervisor, dbo.MainTable.Complete, dbo.MainTable.FirstNotify, dbo.MainTable.SecondNotify, dbo.MainTable.ThirdNotify,
dbo.MainTable.AdvocateInitials
FROM dbo.InitialsListing INNER JOIN
dbo.MainTable ON dbo.InitialsListing.Initials = dbo.MainTable.AdvocateInitials


visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-18 : 10:12:17
quote:
Originally posted by homeguard

I have two tables, a data table (MainTable) that contains a user initials and other empty rows and then i have a user table.

I also have an inner join view with the initials from both tables as the joining field.

I want the users to be able to modify the data table (MainTable) but also display the users name field.

here is the sql of the view:

SELECT     dbo.MainTable.DateCreated, dbo.InitialsListing.Initials, dbo.MainTable.CustomerNumber, dbo.InitialsListing.AdvocateName, 
dbo.MainTable.Supervisor, dbo.MainTable.Complete, dbo.MainTable.FirstNotify, dbo.MainTable.SecondNotify, dbo.MainTable.ThirdNotify,
dbo.MainTable.AdvocateInitials
FROM dbo.InitialsListing INNER JOIN
dbo.MainTable ON dbo.InitialsListing.Initials = dbo.MainTable.AdvocateInitials





Didnt understand. DO you mean you want to update the main table and also display updated values?
Go to Top of Page

homeguard
Starting Member

32 Posts

Posted - 2008-06-18 : 12:35:57
yes, i want the user to beable to update the main table and also display the values of the users name, i think this is something i need to do with the frontend.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-18 : 12:46:55
quote:
Originally posted by homeguard

yes, i want the user to beable to update the main table and also display the values of the users name, i think this is something i need to do with the frontend.


Write a stored procedure to perform update and use an OUTPUT parameter in procedure to return the username value.
Go to Top of Page
   

- Advertisement -