Skip to content

Commit

Permalink
Added ability to drop database views. Closes #4.
Browse files Browse the repository at this point in the history
Use the SQLDropView class to generate a DROP VIEW statement
  • Loading branch information
hisystems committed Mar 5, 2012
1 parent df35b3e commit 29c2f76
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions DatabaseObjects.vbproj
Expand Up @@ -326,6 +326,7 @@
<Compile Include="Contraints\StringIsSetConstraint.vb" />
<Compile Include="Contraints\IConstraint.vb" />
<Compile Include="SQL\Views\SQLCreateView.vb" />
<Compile Include="SQL\Views\SQLDropView.vb" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
Expand Down
40 changes: 40 additions & 0 deletions SQL/Views/SQLDropView.vb
@@ -0,0 +1,40 @@
' ___________________________________________________
'
' © Hi-Integrity Systems 2012. All rights reserved.
' www.hisystems.com.au - Toby Wicks
' ___________________________________________________
'

Option Strict On
Option Explicit On

Namespace SQL

Public Class SQLDropView
Inherits SQLStatement

Private pstrName As String

Public Sub New(ByVal strViewName As String)

If String.IsNullOrEmpty(strViewName) Then
Throw New ArgumentNullException()
End If

pstrName = strViewName

End Sub

Public Overrides ReadOnly Property SQL() As String
Get

Return _
"DROP VIEW " & _
SQLConvertIdentifierName(pstrName, Me.ConnectionType)

End Get
End Property

End Class

End Namespace

0 comments on commit 29c2f76

Please sign in to comment.