How do I view the transaction log in SQL Server 2008?

Hello,
I want to know how to view all the transactions taken during a particular period of time. I know there is a log file, ending with .ldf, created for each database. But how do I view this file?
Is there any tool in the SQL Server studio that can enable me to view the transactions for a given time period?
The reason for me wanting to view the log file is that, last week during a power outage, certain amount of data was not written. And one my friend had also messed up some of the data (unfortunately, she doesn't remember what she did).
Thanks in advance.

Hi,
 It enables you to read from you transaction log which contains very valuable information about stuff that is happening in your database.
select
* from fn_dblog (null,null) ..
EXAMPLE:
SELECT
FROM
::fn_dblog(NULL, NULL)
WHERE
operation = 'LOP_DELETE_SPLIT'
Thanks,
Leks

Similar Messages

  • How to reduce transaction log in SQL Server 2000

    Dear All gurus/experts,
    I need your help. The problem is that the time to take to reduce transaction log in SQL server 2000 when I use shrink method. Are there another way to do that beside shrink database (right click : all tasks --> shrink database) ?
    I appreciate your answers. TIA
    Rgds,

    Hi Steve,
    Is this for a test system or a production system?
    For a test system, as per Ad's post, setting the recovery model to simple should do the trick.
    For a production system, I'd recommend you leave the recovery model at full and set up transaction log backups. This will keep the log file at a reasonable size and you will gain point in time recovery (eg if you back up the logs on an hourly basis, you can recover the database to the last log backup, meaning you would never lose more than an hour's work).
    Kind Regards,
    Owen

  • How to export data with column headers in sql server 2008 with bcp command?

    Hi all,
    I want know "how to export data with column headers in sql server 2008 with bcp command", I know how to import data with import and export wizard. when i
    am trying to import data with bcp command data has been copied but column names are not came.
    I am using the below query:-
    EXEC master..xp_cmdshell
    'BCP "SELECT  * FROM   [tempdb].[dbo].[VBAS_ErrorLog] " QUERYOUT "D:\Temp\SQLServer.log" -c -t , -T -S SERVER-A'
    Thanks,
    SAAD.

    Hi All,
    I have done as per your suggestion but here i have face the below problem, in print statment it give correct query, in EXEC ( EXEC master..xp_cmdshell @BCPCMD) it was displayed error message like below
    DECLARE @BCPCMD
    nvarchar(4000)
    DECLARE @BCPCMD1
    nvarchar(4000)
    DECLARE @BCPCMD2
    nvarchar(4000)
    DECLARE @SQLEXPRESS
    varchar(50)
    DECLARE @filepath
    nvarchar(150),@SQLServer
    varchar(50)
    SET @filepath
    = N'"D:\Temp\LDH_SQLErrorlog_'+CAST(YEAR(GETDATE())
    as varchar(4))
    +RIGHT('00'+CAST(MONTH(GETDATE())
    as varchar(2)),2)
    +RIGHT('00'+CAST(DAY(GETDATE())
    as varchar(2)),2)+'.log" '
    Set @SQLServer
    =(SELECT
    @@SERVERNAME)
    SELECT @BCPCMD1
    = '''BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT '
    SELECT @BCPCMD2
    = '-c -t , -T -S '
    + @SQLServer + 
    SET @BCPCMD
    = @BCPCMD1+ @filepath 
    + @BCPCMD2
    Print @BCPCMD
    -- Print out below
    'BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername'
    EXEC
    master..xp_cmdshell
    @BCPCMD
      ''BCP' is not recognized as an internal or external command,
    operable program or batch file.
    NULL
    if i copy the print ourt put like below and excecute the CMD it was working fine, could you please suggest me what is the problem in above query.
    EXEC
    master..xp_cmdshell
    'BCP "SELECT  * FROM  
    [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername '
    Thanks, SAAD.

  • Will the reports developed in sql server 2008 r2 BIDS work when deployed on sql server 2012 reporting manager

    Will the reports developed in sql server 2008 r2 BIDS work when deployed on sql server 2012 reporting manager?
    when I check on Microsoft site it says
    Reports are not upgraded when you upload a report definition file directly to the report server
    or SharePoint site. Upgrading a report definition in SQL Server Data Tools is the only way to upgrade the .rdl file.
    When you open an .rdl file in Report Designer in SQL Server Data Tools (SSDT), if the report was
    created for a previous namespace, Report Designer automatically creates a backup file and upgrades the report to the current namespace.
    This is the only way you can upgrade a report definition file.
    Now here is another confusing statement which says
    You can upload an .rdl file created in an earlier version of Reporting Services to a SQL Server
    2012 report server and it is automatically upgraded on first use. The report server stores the report definition file in the original format. The report is automatically upgraded the first time it is viewed, but the stored report definition file remains
    unchanged.
    All I want to know is if I deploy a rdl made in 2008 r2 to 2012 will it work on the report manager of
    2012?
    <o:p>
    </o:p>
    Mudassar

    I have tested this fucntionality and can confirm that ssrs 2008 r2 reports work when you deploy them on new ssrs 2012 report manager .
    No Migration is required .
    I didnt even moved report server dbs .All I did is just deployed reports on the report manager and it worked .
    "You
    can upload an .rdl file created in an earlier version of Reporting Services to a SQL Server 2012 report server and it is automatically upgraded on first use. "
    Microsoft needs to correct this the documentation is misleading
    Mudassar

  • Cannot open database " " requested by the login. The login failed. SQL Server 2008 Express

    I am getting this message when I try to create a path to a work file from my application.
    Cannot open database " " requested by the login.  The login failed. 
    SQL Server 2008 is installed.  I have placed the computer name and instance in the application's config file as connection source. 
    The database is also not showing up in SQl Server Management Studio in list of databases.
    Thanks.

    Hello,
    Can you please confirm login exist in the sql server and its mapped to particular database.
    Are you directly connecting to SSMS?
    Or using any 4 part query?
    Please share how you are accessing the DB and screen hots of error messages.
    Thank You.
    Regards, Pradyothana DP. Please Mark This As Answer if it solved your issue. Please Mark This As Helpful if it helps to solve your issue. ========================================================== http://www.dbainhouse.blogspot.in/

  • Transaction Logs in SQL Server

    Hi, the BW system has the following properties:
    BW 3.1C Patch 14
    BASIS/ABA 6.20 Patch 38
    BI_CONT 310 Patch 2
    PI_BASIS Patch 2004_1_620
    Windows 2000 Service Pack 4
    SQL Server 2000 SP3 version 8.00.760
    Database used space: 52 GB
    Database free space: 8.9 GB
    Transaction log space: 8 GB
    I am having the following problem.  The SQL transaction logs on the SQL Server fill up very rapidly while aggregates are rolling up.  Sometimes taking up to 16-20 GB of transaction log space in the SQL Server.  We only have 8 GB of space available for the transaction logs.  When the aggregates are not rolling up, the logs do not fill up at all.  I have tried changing the logs to Simple logging, but all that does is delay the fill, and at that point you cannot backup simple logs to free up DB space.
    What is it about aggregates that fills up the transaction log?  Anybody know a solution to this without adding disk space to the transaction log disk?
    Thanks,

    Hello,
    the log backup on simple mode is not necessary. The full database after switching back to full is a must.
    Please keep in mind, that even running on simple mode the log can be filled up, as all transactions are still written to the log. Commited transaction then can truncated from the log. But when you run a hugh transaction like a client copy, the log might grow as well. The log will be freed once the transaction commits or rolls back. And no, you can't split a client copy in several transactions.
    Best regards
      Clas

  • How do I install the jdbc driver for sql server 2005, in sql developer 4.0 ?

    Hallo together
    I need access to tables in a MS SQL Server 2005 database.
    One possibility is the JDBC driver.
    How do i install this driver ?
    Thank you very much for your postings.

    Hi,
      This is from the documentation -
    Database: Third Party JDBC Drivers
    The Third Party JDBC Drivers pane specifies drivers to be used for connections to third-party (non-Oracle) databases, such as IBM DB2, MySQL, Microsoft SQL Server, or Sybase Adaptive Server. (You do not need to add a driver for connections to Microsoft Access databases.) To add a driver, click Add Entry and select the path for the driver:
    For Microsoft SQL Server or Sybase Adaptive Server: jtds-1.2.jar, which is included in the jtds-1.2-dist.zip download
    To find a specific third-party JDBC driver, see the appropriate website (for example, http://www.mysql.com for the MySQL Connector/J JDBC driver for MySQL, http://jtds.sourceforge.net/ for the jTDS driver for Microsoft SQL Server and Sybase Adaptive Server, or search at http://www.teradata.com/ for the JDBC driver for Teradata). For MySQL, use the MySQL 5.0 driver, not 5.1 or later, with SQL Developer release 1.5.
    You must specify a third-party JDBC driver or install a driver using the Check for Updates feature before you can create a database connection to a third-party database of that associated type. (See the tabs for creating connections to third-party databases in the Create/Edit/Select Database Connection dialog box.)
    Alternative:
    As an alternative to using this preference, you can click Help, then Check for Updates to install the JTDS JDBC Driver for Microsoft SQL Server and the MySQL JDBE Driver as extensions.
    Regards,
    Mike

  • Identity seed at the subscriber changes automatically (SQL Server 2008 R2 SP2 CU9).

    Hi all,
    I have and updateable transactional subscription. The identity seed at subscriber for a table changed (I don't know how) and caused next inserts generate duplicate PKs. I manually reseeded (using DBCC CHECKIDENT) its identity column to upper value to prevent
    duplicates. But after 5 seconds it is automatically reseeded to lower value. I repeated reseed command but again after sync with publisher it changed to lower value. How can I solve this problem?
    Any help would be greatly appreciated.
    Leila

    It is possible in this case that you are not syncing frequently enough, or that you are doing more than 2000 inserts on the subscriber between sync's. In this case you will need to change your subscriber identity range.
    Right click on your publication, select properties, then in the articles tab, locate your table, click on article properties, and select set properties of highlighted table article, in the identity range management section , set subscriber range size to
    some value like 2000 or 10000. 2000 will allow up to 4000 subscriber side inserts between syncs, and 10000 will allow 20,000 inserts on the subscriber.
    looking for a book on SQL Server 2008 Administration?
    http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search?
    http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

  • Creating New db(with new name) with the old db backup sql server 2008

    Friends..
    version: Sql Server 2008
    I have a database in a name college1 (more than 200 tables and view etc...)
    i want to create a new db with all the structures including the data of the above db college1 with a new name college2
    so...i finished the step 1 successfully.. what are the other steps i have to do...like validating the invalid objects. etc....
    Step 1:
    RESTORE DATABASE college2 FROM DISK = 'D:\DailyDBbackup\college1.bak'
      WITH replace,
      move 'college2 ' TO 'D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\college2 .mdf',
      move  'college2 _log' TO 'D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\college2 _log.ldf';
    step 2: ?
    Step 3: ?
    thanks...

    but...when i type
    use college1
    select * from (it will display all tables under the above db)
    but when i do..
    use college2
    select * from (only system tables are displaying..)
    Did restore completed successfully ? If yes Expand database , can you see tables in the new database you restored ?. Sometimes when you type incorrect word which does not matches anything you wont get help from intellicense you should not be worried about this
    if tables are there in new database college 2
    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 Article
    MVP

  • How to convert string to an integer in SQL Server 2008

    Hi All,
    How to convert string to an integer in sql server,
    Input : string str="1,2,3,5"
    Output would be : 1,2,3,5
    Thanks in advance.
    Regards,
    Sunil

    No, you cannot convert to INT and get 1,2,3 BUT you can get
    1
    2
    3
    Is it ok?
    CREATE FUNCTION [dbo].[SplitString]
             @str VARCHAR(MAX)
        RETURNS @ret TABLE (token VARCHAR(MAX))
         AS
         BEGIN
        DECLARE @x XML 
        SET @x = '<t>' + REPLACE(@str, ',', '</t><t>') + '</t>'
        INSERT INTO @ret
            SELECT x.i.value('.', 'VARCHAR(MAX)') AS token
            FROM @x.nodes('//t') x(i)
        RETURN
       END
    ----Usage
    SELECT * FROM SplitString ('1,2,3')
    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

  • How to point out high CPU Utilization in sql server 2008

    Hi,
    I am using sql server 2008 , where in i have 10 instances in the physical box of all sql server 2008 versions.
    I can see , the CPU (12 CPUS) that is allocated to the physical box is consuming around 90% of utilization, I need your help to point out the exact sql instance that is using more CPU, Please give me the mathods , since i understand that there is no fixed
    rule to derive the solution.
    Thank you
    hemadri

    This first thing to check if CPU is at 100% is to look for parallel queries:
    -- Tasks running in parallel (filtering out MARS requests below):
    select * from sys.dm_os_tasks as t
     where t.session_id in (
       select t1.session_id
        from sys.dm_os_tasks as t1
       group by t1.session_id
      having count(*) > 1
      and min(t1.request_id) = max(t1.request_id));
    -- Requests running in parallel:
     select *
       from sys.dm_exec_requests as r
       join (
               select t1.session_id, min(t1.request_id)
              from sys.dm_os_tasks as t1
             group by t1.session_id
            having count(*) > 1
               and min(t1.request_id) = max(t1.request_id)
          ) as t(session_id, request_id)
         on r.session_id = t.session_id
        and r.request_id = t.request_id;
    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

  • How can I view the transaction behind an action box?

    I am trying to find out the transaction behind an action box. Once found I can then create an equivalent transaction launcher for the WebUI IC.
    Jason

    Okay, so in the Winclient where an Action box calls a transactions and the config of the action box defines a process_type, you're saying that this can not be duplicated in Transaction launcher?. Is it not even possible if a parameter could be somehow manually entered for a given transaction launcher based on a process_type?.
    I thought that the transaction launcher was the replacement for the Action Box, and yet it can't even achieve what the Action box could do, simply, albeing in the Winclient.
    Thanks for you help though Robert. It looks like I'm back to square one again though.
    Do you know if there's a test that can be run to ensure that the value in the CRMS_IC_CROSS_SYS transaction has been entered correctly. When I test my Nav Bar I get a message box titled 'Message from Webpage' with the value of 'Object expected'.
    As a test, I just followed my course notes (CR580) and created an entry against the IC_Agent role, I created a transaction launcher entry as follows:
    Transaction type: BOR Transaction
    Logical system: CMD
    BOR Object type: TSTC_UIF
    Method name: EXECUTE
    Transaction Parameters:
    Parameter: Object key
    Value : CRMM_BUPA_MAP
    This should display a standard CRM transaction, but I get the error mentioned.
    Jason

  • How can I get the data array from SQL Server Database?

    Hi,
    I can write a data array(2D)into a table of my SQL Server Database. The data array was writen to a column with image type. I know a data array is transformed a binary string when writing into database, but I dont know how to get the data array when I fetch the binary string from database.
    My question is:
    How to transform the binary string into data array? which vi's should I use? I have tried unflatten from string but failed.
    Any response is appriciated.
    Red

    happyxh0518 wrote:
    > I can write a data array(2D)into a table of my SQL Server Database.
    > The data array was writen to a column with image type. I know a data
    > array is transformed a binary string when writing into database, but I
    > dont know how to get the data array when I fetch the binary string
    > from database.
    >
    > My question is:
    > How to transform the binary string into data array? which vi's should
    > I use? I have tried unflatten from string but failed.
    In order to use Unflatten from string you first need to Flatten it
    before writing it. Also depending on the database driver, the returned
    data may actually not be binary but Hexadecimal encoded ASCII which you
    would first have to decode to binray.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to update the identity_column value in sql server 2008

    Hi Team,
    I have identity column based table. In the table i use insert the name as per the requirement and for ID i use to set the identity now i need to update the particular row id.
    when i use to trying i'm getting the below error.
    Msg 8102, Level 16, State 1, Line 4
    Cannot update identity column 'CategoryID'.
    Kindly help me out regarding this.
    Thanks & Regards,
    Ramesh R

    You cannot update an IDENTITY column. You need to move the data into another table make  the changes over there  and insert the back the data into original table.
    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

  • Trying to change the Tab size of SQL Server 2008 R2 ?

    Been trying to change the size of the tab but it just doesnt change!
    Went to Tools-Options-Text Editor-Transact-SQL
    From 2 to 1. 
    Any ideas? 

    Hi Shavendra,
    The Options dialog box lets you change the default behavior of the Database Engine Query Editor while you are programming Transact-SQL scripts. To display these settings, click Options on the Tools menu, expand the Text Editor folder, expand the Transact-SQL
    subfolder and then click Tabs.
    Tab size: Sets the distance in spaces between tab stops. The default is four spaces.
    Reference: http://msdn.microsoft.com/en-us/library/bb895215.aspx.
    Thanks,
    Maggie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

Maybe you are looking for

  • Visio 2010 Link a Stencil to Telnet

    Good morning everyone, I have been searching Google for two days now on how to link a Visio 2010 Stencil to Telnet so that when you hold control and click the stencil it brings you to the telnet login prompt for that router or switch. I went to inser

  • Playlist does not contain new items after sync.

    We recently pruchased 4 new songs from iTunes on the iPhone. All 4 songs were successfully downloaded.  We Sync'd the iPhone with iTunes on a Windows PC.  All 4 songs are now in the library on the PC. We then used iTunes on the PC to add the 4 new it

  • Live Video encoder for Mac.  Does it exist?

    Looking to d a live video stream. Would like to use Vp6 I do not think Adobe had a Flash video encoder for the mac. As always, thanks for your time and help. Mike

  • Querying cache with data that is large enough to fit into available memory

    Query on a cache would be applicable on the data that can fit into the cache storage as per the link http://coherence.oracle.com/display/COH35UG/Query+the+Cache. However there is also a mention about restricting the cache content along a specific dim

  • OEM GC Best Practices

    Greetings, We are a shop with 5 DBAs, each responsible for different databases and we are in the process of moving to have our regularly scheduled tasks (backups, monitoring, etc.) scheduled through OEM GC. It is beginning to appear as though having