Solved

Create or Replace for Sql Server

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


What is equvialent of Create or Replace in Sql Server
0
Comment
Question by:N_Sri
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 60

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

688 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