Hi All, I am trying to execute following syntax under transaction but it throws error:-
this is the script that I am executing under transaction:-
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
-- full text search is installed. Run the necessary procedures
BEGIN
declare @dbName nvarchar(128)
select @dbName = DB_Name()
exec('ALTER DATABASE [' + @dbName + '] SET RECOVERY SIMPLE')
if(0 = DATABASEPROPERTY(DB_Name(),'IsFulltextEnabled'))
BEGIN
-- Full text is installed but not enabled on the Database. Enable that
EXEC sp_fulltext_database 'enable'
END
-- Check if there are current tables in full text search. If yes, remove them
if(1 = INDEXPROPERTY(Object_id('Blog'),'PK_Blog','IsFulltextKey'))
BEGIN
-- Drop the full text index
EXEC sp_fulltext_table 'Blog','drop'
END
END
I get following error:-
ALTER DATABASE statement not allowed within multi-statement transaction. The procedure 'sys.sp_fulltext_table' cannot be executed within a transaction. The procedure 'sys.sp_fulltext_table' cannot be executed within a transaction. The procedure 'sys.sp_fulltext_table' cannot be executed within a transaction.
Guys do you have any idea??
Edit:- I want to know is there any way out to do this. I am trying to change the datatype of columns in the database and they are enabled for fulltextsearch hence I want above to be done somehow. :(