-
fn_get_sql
DECLARE @Handle binary(20)
SELECT @handle=sql_handle
FROM master..sysprocesses
WHERE spid= 60
SELECT * FROM ::fn_get_sql(@handle)
When l use fn_get_sql l only get a aprt of the script that is being run. How can l get the whole script or prcedure to be displayed ?
Second Question :
Is there a way to track dropped objects, commands like delete,truncate at database level in sql and log these events into a table ?
-
The data is being returned in a text field. By default, you will only see the portion of the text that fits within the size limits configured by using "Set TextSize".
Execute "SELECT @@TEXTSIZE" to see how much is configured to be returned. The default size is 4K and can be set to a maximum of 2 GB.
For more info on fn_get_sql: http://www.databasejournal.com/featu...le.php/2189761
Your can either run profiler to look for these specific commands or you can use a log reader to read the tran logs.
-
There are third party sql auditing tools.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|