Month: January 2019

Import BACPAC File Created from Azure SQL Database

Import BACPAC File to On-Premise SQL Server : C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin> SqlPackage.exe /a:import /sf:\\Userdb0.bacpac /tsn:SERVER-SQL\DEV2016 /tdn:Azure_Test /p:CommandTimeout=2400   Error : When you are try to import BACPAC File created from Azure Environment, you might encounter the following error

Tagged with: ,

Import DACPAC file to SQL Server

Import DACPAC File # Login-AzureRmAccount # Set the resource group name and location for your server $resourcegroupname = “myResourceGroup-$(Get-Random)” $location = “westeurope” # Set an admin login and password for your server $adminlogin = “ServerAdmin” $password = “ChangeYourAdminPassword1” #

SQL Server Performance Queries

SQL Server Performance Tuning   — Top 10 sessions caused blocking SELECT TOP 10 r.session_id, r.plan_handle, r.sql_handle, r.request_id, r.start_time, r.status, r.command, r.database_id, r.user_id, r.wait_type, r.wait_time, r.last_wait_type, r.wait_resource, r.total_elapsed_time, r.cpu_time, r.transaction_isolation_level, r.row_count, st.text FROM sys.dm_exec_requests r CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) AS st

SQL Server IO Stall Statistics

— Read IO Stalls Statistics SELECT @@VERSION GO SELECT type, SUM(io_stall_read_ms) AS io_stall_read, SUM(io_stall_write_ms) AS io_stall_write, SUM(num_of_reads) AS num_of_reads, SUM(num_of_writes) AS num_of_writes FROM sys.dm_io_virtual_file_stats(NULL, NULL) fs JOIN sys.database_files df ON fs.file_id = df.file_id WHERE database_id = DB_ID() GROUP BY df.type