Languages

How to make CREATE OR REPLACE VIEW statement in MS SQL Server?

3 points
Asked by:
Hiba-Tate
248

What is the replacement for the CREATE OR REPLACE VIEW command (which I could use in MySQL) in MS SQL Server?

1 answer
3 points
Answered by:
Hiba-Tate
248

In SQL Server you need to change REPLACE to ALTER - the command will work the same as in MySQL.

Basic template:

CREATE OR ALTER VIEW [view_name] AS 
SELECT [column1], [column2], [columnN] 
FROM [table_name] 
WHERE condition;

You can also check out the article I made to see a practical example for better understanding:

0 comments Add comment
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join