Auckland SQL User Group Meetup Event / Kevin Kline, Microsoft MVP / Push Your App to Enterprise Scale with Advanced SQL Server Features

Auckland SQL User Group Meetup Event / Kevin Kline, Microsoft MVP / Push Your App to Enterprise Scale with Advanced SQL Server Features
SentryOne Principal Program Manager, renowned database expert, founder and former president of PASS, and Microsoft SQL Server MVP, Kevin Kline, will share his deep SQL knowledge and best practices at a series of SQL Saturdays and SQL Server User Group meetings all around the world. As a part New Zealand Down Under Tour, in association with SQLMasters Consulting, Kevin Kline is coming to Auckland on June 4th to deliver a session! Push Your App to Enterprise Scale with Advanced SQL Server Features Tuesday, Jun 4, 2019, 12:00 PM Microsoft22...
read more

SQL Server / SSMS / Expanding Indexes List Query

SQL Server / SSMS / Expanding Indexes List Query
Same as in previous posts examples Expanding Tables List Query and Expanding Columns List Query I usually do not notice this type of queries working in the background. But recently I end up working with a customer having DB with over 500K indexes, 150K tables and expanding indexes list operation can end up being slower than usual. Here is the code: SELECT i.name AS [Name], 'Server[@Name=' + quotename(CAST( serverproperty(N'Servername') AS sysname),'''') + ']' + '/Database[@Name=' + quotename(db_name(),'''') + ']' + '/Table[@Name=' +...
read more

SQL Server / SSMS / Expanding Columns List Query

SQL Server / SSMS / Expanding Columns List Query
Same as in previous post example Expanding Tables List Query I usually do not notice this type of queries working in the background. But recently I end up working with a customer having DB with 150K tables, some of the tables have more than 500 columns, and expanding columns list operation can end up being slower than usual. Here is the code: SELECT clmns.name AS [Name], 'Server[@Name=' + quotename(CAST( serverproperty(N'Servername') AS sysname),'''') + ']' + '/Database[@Name=' + quotename(db_name(),'''') + ']' + '/Table[@Name=' +...
read more

SQL Server / SSMS / Expanding Tables List Query

SQL Server / SSMS / Expanding Tables List Query
Usually I do not even notice this query working in the background, since this operation is quite fast. But recently I end up working with a customer having DB with 150K tables, and expanding table list operation can be really slow and expensive. Here is the code: SELECT tbl.name AS [Name], SCHEMA_NAME(tbl.schema_id) AS [Schema], 'Server[@Name=' + quotename(CAST( serverproperty(N'Servername') AS sysname),'''') + ']' + '/Database[@Name=' + quotename(db_name(),'''') + ']' + '/Table[@Name=' + quotename(tbl.name,'''') + ' and @Schema=' +...
read more

PowerShell / SQL Server / Generate SQL Script to Restore Multiple Transaction Logs

PowerShell / SQL Server / Generate SQL Script to Restore Multiple Transaction Logs
Restore multiple TRN logs using PowerShell. In this example I will show you really simple way how you can use PowerShell to restore multiple logs at once. After restoring full backup WITH NORECOVERY you need to figure it out last log sequence number of the last transaction in the backup set. TRN Log backups must be restored in the order in which they were created. Log backups contain log sequence numbers (LSN), and they must be restored in that particular order. There are few ways to find last LSN. USE msdb GO SELECT TOP 10 bck.database_name...
read more

Azure / PowerShell / Deploy Azure SQL database DR environment (PaaS) using PowerShell

Azure / PowerShell / Deploy Azure SQL database DR environment (PaaS) using PowerShell
Script Download: The script with usage example is available for download from https://gallery.technet.microsoft.com/Deploy-Azure-SQL-DR-47dfa7f7 Summary: Use PowerShell to create cloud DR environment using Azure SQL Databases (PaaS) and send Email Report with the connection string details   Description: Use PowerShell to deploy cloud service with Azure SQL Database (PaaS) with good resilience to outages (GEO Replications, Failover Groups) PowerShell: Connect to Azure Account, Use existing or create new Resource Group, Create primary...
read more

Next Entries »