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 |
styl1n
Starting Member
1 Post |
Posted - 2006-12-04 : 07:23:24
|
Hi, i'm trying to create a stored procedure inside a transaction. It makes perfect sense for what i need to do because it may need to be rolled back although it's a little unconventional. I am, of course, getting a syntax error when i try to run the script.Is this even possible? I'm running 2005 by the way.Any help would be appriciated. |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-12-04 : 07:26:37
|
It's only possible through Dynamic SQL and not at all advisable.Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-12-04 : 07:31:04
|
>> It makes perfect sense for what i need to doI doubt it.Better to drop the SPs if something goes wrong.If you do it inside a transaction you will be locking system tables and could cause problems.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-12-04 : 09:11:45
|
www.sommarskog.se/dynamic_sql.htmlMadhivananFailing to plan is Planning to fail |
 |
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|