November 16, 2011 at 4:32 am
Dear All,
I am trying to call a View within a Stored Procedure but I don't know if it is at all possible please?
Thank you in advance
November 16, 2011 at 4:37 am
CREATE PROCEDURE P1
AS
SELECT * FROM VW_V1; -- VIEW
If you are asking this, it’s possible.
November 16, 2011 at 5:11 am
Here is my scenario:
We have an application which we use C#, but the way the Architecture for creating the Application is that only Views can be used to get the Data from the SQL. The trouble is, there are Data Manipulations (Delete, Updates etc...) that occur, but View would not be able to perform that. I just need to find a solution where the View could be updatable please?
November 16, 2011 at 5:16 am
I completely agree with Dev, but to help a bit with terminology. Normally, I would say that we call or execute functions and procedures, as they are executable objects, and we say that we query tables and views. I even say that I call an inline table valued function, even though I know that the internal workings are more similar to a view than other functions and procedures.
November 16, 2011 at 5:18 am
tt-615680 (11/16/2011)
Here is my scenario:We have an application which we use C#, but the way the Architecture for creating the Application is that only Views can be used to get the Data from the SQL. The trouble is, there are Data Manipulations (Delete, Updates etc...) that occur, but View would not be able to perform that. I just need to find a solution where the View could be updatable please?
Yes. It's possible.
UPDATE Changes existing data in one or more columns in a table or view in SQL Server.
The statement above is valid for simple views. For complex views please write, INSTEAD OF TRIGGERS (bad for performance).
November 16, 2011 at 5:21 am
tt-615680 (11/16/2011)
Here is my scenario:We have an application which we use C#, but the way the Architecture for creating the Application is that only Views can be used to get the Data from the SQL. The trouble is, there are Data Manipulations (Delete, Updates etc...) that occur, but View would not be able to perform that. I just need to find a solution where the View could be updatable please?
Wow, you're facing some serioys limitations here, please have a look at the remarks section of create view. There ARE ways to do this, but they may not be very effective. As a general recommendation, I would suggest you to investigate whether you can use stored procedures for creating, updating and deleting records.
November 16, 2011 at 5:29 am
okbangas (11/16/2011)
tt-615680 (11/16/2011)
Here is my scenario:We have an application which we use C#, but the way the Architecture for creating the Application is that only Views can be used to get the Data from the SQL. The trouble is, there are Data Manipulations (Delete, Updates etc...) that occur, but View would not be able to perform that. I just need to find a solution where the View could be updatable please?
Wow, you're facing some serioys limitations here, please have a look at the remarks section of create view. There ARE ways to do this, but they may not be very effective. As a general recommendation, I would suggest you to investigate whether you can use stored procedures for creating, updating and deleting records.
@ole: If I am correct it's Entity Framework Model where the application class should match to DB objects (tables / views). I am not a huge fan of this architecture but from Front End Developer's point-of-view it's very easy to understand & develop.
November 16, 2011 at 10:16 am
I too fear it is Entity Framework. From a database perspective, I simply hate it. I really really hate it when i see a solution sending some 4000 single inserts or updates, instead of doing it in a single statement.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply