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 |
gsgill76
Posting Yak Master
137 Posts |
Posted - 2006-10-20 : 01:13:36
|
CREATE PROC dbo.testing (@DbName varchar(10)) ASDECLARE @DynamicSql NVARCHAR(255)SET @DynamicSql = 'EXEC sys.sp_dbcmptlevel @dbname=' + @DbName + ', @new_cmptlevel=90'EXEC (@DynamicSql)GOEXEC testing AdventureworksOUTPUT:'sys.sp_dbcmptlevel' can only be executed at the ad hoc level.I try this but same errorCREATE PROC dbo.testing (@DbName SYSNAME) ASEXEC sys.sp_dbcmptlevel @dbname=@DbName, @new_cmptlevel=90GOEXEC testing AdventureworksOUTPUT:'sys.sp_dbcmptlevel' can only be executed at the ad hoc level.I know why this error come"The procedure 'sys.sp_dbcmptlevel' cannot be executed within a transaction"but dont know how to solve this.Regards,Thanks.Gurpreet S. Gill |
|
|
|
|