Home » Blog » » Page 2

Andrew Jackson

~ Modified: October 17th, 2022 ~ ~ 7 Minutes Reading

Forum Replies Created

Viewing 20 posts - 21 through 40 (of 81 total)
  • Author
    Posts
  • in reply to: Deleting a Transaction Log File in SQL Server #1695 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    Yes, you can delete a log file but it is recommended that the file that you want to delete must be empty. You can delete a transaction log file with the help of SQL Server Management Studio also.

    in reply to: Creating Database Snapshot #1694 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    There are several benefits of a database snapshot in SQL Server. Here I have discussed some of them:
    1. The database snapshots can be used in reporting services.
    2. Works as a safeguards against administrative error.
    3. Also can be used in managing the test database.
    4. Can be used as mirror database that you can use for maintaining for availability purposes.

    Some limitations are like:
    1. Snapshots are read-only.
    2. specifications of the database snapshot files are not changeable.
    3. You cannot attach or detach database snapshots.
    To know more please go this one it may be helpful to you https://msdn.microsoft.com/en-us/library/ms175158.aspx

    in reply to: How to convert SQL Server database to MS Access? #1381 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    To export SQL Server Database to MS Access

    • Right click the database name in SQL Server.
    • Select Tasks >> Export data
    • Press Next
    • From Choose a Destination screen. Use the Destination drop down to select MS Access.
    Andrew Jackson
    Moderator
    1 pt

    This error generally happens when users configured an asp.net application to IIS, and IIS tries to gain access (login) with improper permission.

    To fix this error

    • Open SQL Server Management Studio >> Security >> Logins (right click on the user) >> Properties
    • On Login Properties window, click on User Mapping from the left pane.
    • Under Users Mapped to this login: select the database and from the lower screen (Database role membership for: Database) check db_owner role and click ok
    in reply to: How to change the database location in SQL Server? #1117 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    To change the path of an existing database

    • Issue an ALTER DATABASE … MODIFY FILE command
    • Stop the SQL service
    • Move the database files to a new location
    • Restart the service
    in reply to: How to Recover SQL Server Database from SUSPECT Mode #1105 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    First of all make sure that you do not detach suspected database
    Then execute the following query:

    EXEC sp_resetstatus 'DatabaseName';
    ALTER DATABASE DatabaseName SET EMERGENCY
    DBCC checkdb('DatabaseName')
    ALTER DATABASE DatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
    DBCC CheckDB ('DatabaseName', REPAIR_ALLOW_DATA_LOSS)
    ALTER DATABASE DatabaseName SET MULTI_USER
    
    in reply to: How to change the database location in SQL Server? #1096 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    Open SQL Server Management Studio and right click on the SQL Server Instance. From popup menu, click on properties
    Click on Properties
    From server properties dialog box, select a database setting, then change the default database location and click ok.
    Properties Dialog Box
    You need to restart the SQL Server Services to come change into effect

    in reply to: How Can I Check Free Space in My SQL Server Database? #1067 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    You can also use FILEPROPERTY to check for free space in a SQL Server database

    USE AdventureWorks 
    GO 
    
    SELECT DB_NAME() AS DbName, 
    name AS FileName, 
    size/128.0 AS CurrentSizeMB,  
    size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS INT)/128.0 AS FreeSpaceMB 
    FROM sys.database_files;

    This will show how much space is used by SQL Server database and then you can calculate free space

    in reply to: How do I open Microsoft SQL Server Management Studio? #1047 Score: 0
    Andrew Jackson
    Moderator
    1 pt
    1. Click Start button
    2. Click on the “Run” option and run the following command:

    ssms.exe

    hope this will help you out

    in reply to: How to rename SQL Server database? #1032 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    To change the name of the physical file you have to take the SQL Server database Offline

    • Open SQL Server Management Studio
    • Right-click on Database which you want to rename
    • Click on Tasks
    • Then select Take Offline

    Change the name of the physical files at the OS level and then Bring the database Online.

    in reply to: How to rename SQL Server database? #1015 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    Execute the following script to rename the database

    USE master;
    GO
    EXEC sp_dboption MyDatabase, 'Single User', True
    GO
    EXEC sp_renamedb ' MyDatabase', ' MyDatabaseNew’
    GO
    EXEC sp_dboption MyDatabase, 'Single User', False
    GO
    in reply to: How to Check Active Transaction in SQL Server? #1006 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    The select @@TRANCOUNT will help you to check active transactions in SQL Server

    in reply to: How to enable and disable trigger in SQL server #1005 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    To disable / enable selective triggers…

    ALTER TABLE tableName DISABLE TRIGGER triggername
    ALTER TABLE tableName ENABLE TRIGGER triggername
    

    To disable / enable all triggers…

    ALTER TABLE tableName DISABLE TRIGGER ALL
    ALTER TABLE tableName ENABLE TRIGGER ALL 
    
    in reply to: How to Create a Full Database Backup in SQL Server ? #998 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    Thanks Stephen West for the script, it helps me a lot, but I also want to know can i create a backup of the database from SQL Server Management Studio

    Andrew Jackson
    Moderator
    1 pt

    Just enabled TCP/IP, VIA, Named Pipes in SQL Server Configuration manager

    in reply to: How to move multiple NSF files to single NSF file? #987 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    Thanks Lincoln,
    I had gone through the demo version and yes there is a separate option to “Remove Duplicate Folders”,
    Now I am eagerly looking forward to using this utility.

    in reply to: How to move multiple NSF files to single NSF file? #985 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    Hi Lincoln,
    Can the utility, which is mentioned by you, prevent duplicity? Since my account inbox contains duplicate mails & information and I don’t require it to repeat in a single file. Thus, I want a solution for the same.

    in reply to: How to move multiple NSF files to single NSF file? #981 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    Hi buddy,
    I have been working for my enterprise since last 2-3 years and we are using Lotus Notes database to store all the account related information.
    As the mail client I am using creates the archive account to months, hence many NSF files had been created of my account having different folders. This situation leads to cumbersome task to access the data in those files by opening them one by one which is very time consuming.
    Secondly, the search options can’t be used efficiently if there are many files of the same user account which is different for inbox, calendars, events etc.
    So, is there a solution to combine all my NSF Archive Database to a single file. I am in dire need to have a solution as it will ease my work.

    in reply to: how to remove secondary transaction log file? #965 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    Use the DBCC SHRINKFILE with the EMPTYFILE argument command

    dbcc ShrinkFile ('logical_file_name', EmptyFile)

    in reply to: Move table form one database to another database in SQL #917 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    Try this:

    SELECT * 
    INTO DestinationDB..MyDestinationTable 
    FROM SourceDB..MySourceTable 

    It will not copy constraints, defaults or indexes.

Viewing 20 posts - 21 through 40 (of 81 total)