When you have deleted views and procedures by accident try this:
SELECT
Convert
(
varchar
Max
),
Substring
([RowLog Contents 0],33,LEN([RowLog Contents 0])))
as
[Script]
FROM
fn_dblog(
DEFAULT
,
)
Where
[Operation]=
'LOP_DELETE_ROWS'
And
[Context]=
'LCX_MARK_AS_GHOST'
[AllocUnitName]=
'sys.sysobjvalues.clst'
If you want to try, just:
create
view
Technet
select
1
one,2
two,3
three,4
fourth
drop the view:
drop
technet
and, let's try also with a procedure:
procedure
forum
declare
@st
int
set
@st=1
print @st
drop the procedure:
Just execute the code:
And you can see both in your result.
Recovering a deleted view. How?