Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 2nd, 2005, 07:03 AM
Authorized User
 
Join Date: Sep 2005
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stored procedure that deletes given SP

is that possible in SQL...

 
Old December 2nd, 2005, 02:53 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Not sure what you are asking?

 
Old December 6th, 2005, 08:22 AM
Authorized User
 
Join Date: Sep 2005
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by jbenson001
 Not sure what you are asking?

i am not sure too...:)
i give delete sp as parameter sp to delete. And this sp deletes that sp:)


 
Old December 6th, 2005, 10:57 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Yes, you can do that.. but you will have to use dynacmic sql to do it.

 
Old December 7th, 2005, 03:34 PM
Authorized User
 
Join Date: Sep 2005
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by jbenson001
 Yes, you can do that.. but you will have to use dynacmic sql to do it.

so how ?

 
Old December 7th, 2005, 04:25 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

declare @sql nvarchar(500)
declare @proc nvarchar(100)
set @sql = 'Drop Procedure ' + @proc

EXEC sp_executesql @sql


You should check if the proc exists first so you don't get an error if it doesn't

Check books on line for more help.

Jim
 
Old December 8th, 2005, 07:24 AM
Authorized User
 
Join Date: Sep 2005
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by jbenson001
 declare @sql nvarchar(500)
declare @proc nvarchar(100)
set @sql = 'Drop Procedure ' + @proc

EXEC sp_executesql @sql


You should check if the proc exists first so you don't get an error if it doesn't

Check books on line for more help.

Jim



thx where can i get these books ?

 
Old December 8th, 2005, 10:47 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Books On Line is the help for SQL Server, it should have been installed with the server installation.

 
Old December 9th, 2005, 08:37 AM
Authorized User
 
Join Date: Sep 2005
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by jbenson001
 Books On Line is the help for SQL Server, it should have been installed with the server installation.

with 2005 EE i dont have it:(






Similar Threads
Thread Thread Starter Forum Replies Last Post
stored procedure kdm260 SQL Server 2000 2 June 19th, 2006 04:45 PM
stored procedure lokey VB How-To 7 June 30th, 2005 12:37 AM
Stored Procedure... babloo81 SQL Server 2000 2 May 1st, 2004 11:25 PM
running store procedure inside another SP rosalynb ADO.NET 1 November 13th, 2003 03:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.