Can i write a insert query inside Function in SQL server 2008. If i tried, im a getting an error of Invalid use of side effecting operator 'INSERT' within the function. Please help me out. But i want it to be a function, not a stored procedure
Create function EFT_DL_FUNC_AUDTI_BATCH_START (@i_db_name varchar(20))
returns int as
begin
insert into table_name(db_name) values (@i_db_name)
return 0
end
Create function EFT_DL_FUNC_AUDTI_BATCH_START (@i_db_name varchar(20)) returns int as begin insert into table_name(db_name) values (@i_db_name) return 0 end
– Robin clave