Access: Remove Stored Procedure

We have seen how to create and use a stored procedure – but as part of our usage patterns we need to be able to delete stored procedures as well.

001
002
003
004
005
006
007
008
009
010
011
012
013
function Remove-AccessStoredProcedure {
# .ExternalHelp Maml-AccessFunctions.XML
[CmdletBinding()]
param (
    [System.Data.OleDb.OleDbConnection]$connection,
    [string]$name
)
    $sql = "DROP PROCEDURE $name"
    Write-Debug $sql
   
    $cmd = New-Object System.Data.OleDb.OleDbCommand($sql, $connection)
    $cmd.ExecuteNonQuery()   
}

 

Simple function to pass the name of the procedure and call a DROP ROCEDURE statement.

 

Published Sun, Mar 7 2010 12:49 by RichardSiddaway
Filed under: ,

Comments

# re: Access: Remove Stored Procedure

Thank you very much for sharing this. I sometimes have problem of removing the stored procedure.It is helpful.

Thursday, March 11, 2010 8:40 PM by dvdrip

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: