none
can their be a way to record specifics in the ldf file of sql server RRS feed

  • Question

  • Hi All

    I know that whatever activities we perform in ssms let say select * from <table_name>,sp_who or anything for that matter, everything gets recorded.

    Is their a sql code or way that we can add only specifics in the live DB for example

    1. Don't record simple sql statement.

    My question may be irrelevant, and if it is I will be happy to get an answer as a comment from anyone from this member forum saying that your question is irrelevant ,

    otherwise can anyone advise what can be done

    Regards

    Farhan Jamil

    Wednesday, September 18, 2019 11:15 AM

Answers


  • I know that whatever activities we perform in ssms let say select * from <table_name>,sp_who or anything for that matter, everything gets recorded.

    Like Tibor said not everything is recorded the select statement is not recorded on transaction log file. You can run it and query fn_dblog (note this is undocumented command).

    Is their a sql code or way that we can add only specifics in the live DB for example

    1. Don't record simple sql statement.

    My question may be irrelevant, and if it is I will be happy to get an answer as a comment from anyone from this member forum saying that your question is irrelevant ,

    Unfortunately this cannot be done. But you have "slight" control over what can be logged. Like if you select bulk logged recovery model some minimally logged operations would be logged minimally. More than this I believe you do not have any control.


    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    • Marked as answer by JamilFarhan Thursday, October 3, 2019 8:41 AM
    Friday, September 20, 2019 9:49 AM
    Moderator

All replies

  • Hi All

    I know that whatever activities we perform in ssms let say select * from <table_name>,sp_who or anything for that matter, everything gets recorded.

    Is their a sql code or way that we can record only specifics in the live DB for example

    1. Don't record simple sql statement.

    My question may be irrelevant, and if it is I will be happy to get an answer as a comment from anyone from this member forum saying that your question is irrelevant ,

    otherwise can anyone advise what can be done

    Regards

    Farhan Jamil

    Wednesday, September 18, 2019 11:16 AM
  • No you cannot ( run SELECT statement the optimizer creates a execution plan and load into the cache) , but permit me to ask you what is your goal?

    Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting: Large scale of database and data cleansing
    Remote DBA Services: Improves MS SQL Database Performance
    SQL Server Integration Services: Business Intelligence

    Wednesday, September 18, 2019 11:23 AM
    Moderator
  • No, not everything gets "recorded". But there can be traces of what you do. For instance execution plans in cache from queries (but you can't see who executed the query). And modifications are logged to the transaction log. And, some stuff are logged by default in XE and SQL Server default traces (but not query execution).

    There is no such "flag" to not leave traces.


    Tibor Karaszi, SQL Server MVP (Web Blog)

    Wednesday, September 18, 2019 12:15 PM
    Moderator
  • Hi JamilFarhan,

    >> can their be a way to record specifics in the ldf file of sql server

    Did you mean records in transaction log file? As far as I know, no, you can’t. A transaction log that records all transactions and the database modifications made by each transaction. You can get more information about LDF from The Transaction Log (SQL Server) . If I misunderstood, please let me know.

    Best regards,
    Cathy

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, September 19, 2019 7:02 AM

  • I know that whatever activities we perform in ssms let say select * from <table_name>,sp_who or anything for that matter, everything gets recorded.

    Like Tibor said not everything is recorded the select statement is not recorded on transaction log file. You can run it and query fn_dblog (note this is undocumented command).

    Is their a sql code or way that we can add only specifics in the live DB for example

    1. Don't record simple sql statement.

    My question may be irrelevant, and if it is I will be happy to get an answer as a comment from anyone from this member forum saying that your question is irrelevant ,

    Unfortunately this cannot be done. But you have "slight" control over what can be logged. Like if you select bulk logged recovery model some minimally logged operations would be logged minimally. More than this I believe you do not have any control.


    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    • Marked as answer by JamilFarhan Thursday, October 3, 2019 8:41 AM
    Friday, September 20, 2019 9:49 AM
    Moderator