While views are useful for simplifying data access, they cannot replace stored procedures for running complex data manipulation operations like MERGE. Stored procedures are the preferred method for encapsulating such logic in the database.
alternative to store procedure
Hi Expert,
do we have any alternative to store procedure while running merge statement where we can use exec or run like
exec sp_name
can we use view instead of any table to something else
Regards
3 answers
Sort by: Most helpful
-
-
LiHongMSFT-4306 29,746 Reputation points
2023-09-15T02:50:10.7766667+00:00 Hi @Shambhu Rai
do we have any alternative to store procedure while running merge statement can we use view instead of any table to something else
No, you cannot.
View and Stored procedure are different things.
A view represents a virtual table definited with SELECT statement. You can join multiple tables in a view and use the view to present the data as if the data were coming from a single table.
Stored procedures are programs that can perform multiple operations, such as inserting, updating, deleting, or selecting data.
Best regards,
Cosmog Hong
-
Olaf Helper 45,391 Reputation points
2023-09-15T04:51:31.1166667+00:00 do we have any alternative to store procedure
What for an alternative, in which way? A stored procedure is the one for business logic.
can we use view instead
In a view only SELECT statements are allowed, DML like MERGE are not possible/not allowed.