Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Osme
Starting Member
2 Posts |
Posted - 2007-04-17 : 05:32:12
|
hi,total newbie here so i'll apologise up front for my total incompetance....i want to create a simple stored procedure which will accept an index name as an input parameter and then drop that index. sounds fairly straightforward to me but can seem to get the syntax right - CREATE PROC <procname> @indexname varchar(50)ASDROP INDEX @indexnameany help much appreciated,Osme. |
|
bpgupta
Yak Posting Veteran
75 Posts |
Posted - 2007-04-17 : 05:38:38
|
you can test your self in test database |
 |
|
Osme
Starting Member
2 Posts |
Posted - 2007-04-17 : 05:47:51
|
have done. syntax fails |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-04-17 : 07:20:13
|
Why do you need stored procedure?Drop them when needed. Dont pass them as parametersYou can tryEXEC('DROP INDEX '+@indexname)MadhivananFailing to plan is Planning to fail |
 |
|
bpgupta
Yak Posting Veteran
75 Posts |
Posted - 2007-04-17 : 07:39:54
|
write the simple script to do the same.why u need to executed in Stored Proc. itself.. |
 |
|
|
|
|