Solved

Create or Replace for Sql Server

Posted on 2011-02-17
3
722 Views
Last Modified: 2012-05-11


What is equvialent of Create or Replace in Sql Server
0
Comment
Question by:N_Sri
3 Comments
 
LVL 12

Assisted Solution

by:mcv22
mcv22 earned 100 total points
ID: 34922607
Can you give an example of what you are trying to do?
0
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 400 total points
ID: 34922641
There is no equivalent; therefore, you will need to DROP the original object and CREATE it again.

For example, here is a view:
IF OBJECT_ID (N'{your object name here}') IS NOT NULL
   DROP VIEW {your object name here}
GO

CREATE VIEW {your object name here}
AS ...

Open in new window


OR
IF OBJECT_ID (N'dbo.VW_Something') IS NOT NULL
   DROP VIEW dbo.VW_Something
GO

CREATE VIEW dbo.VW_Something
AS ...

Open in new window

0
 

Author Closing Comment

by:N_Sri
ID: 34930275
thankyou
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now