Skip to content

Import Excel Data into SQL

'In order to read from an Excel Spreadsheet through SQL you need to install the Office 2010 Database Engine. Afterwards, run statements similar to the following:

EXEC sp_configure 'Show Advanced Options', 1
RECONFIGURE with override
GO

EXEC sp_configure 'Ad Hoc Distributed Queries', 1
RECONFIGURE with override
GO

SELECT * 
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=C:\Import\FileName.xlsx',
'SELECT * FROM [Sheet1$]')

'...

http://www.devx.com/tips/database-development/sql/import-excel-data-into-sql-180522083509.html

PowerShell cmdlets for managing SQL Vulnerability Assessments

'We are pleased to announce the availability of PowerShell cmdlets for managing SQL Vulnerability Assessments for your SQL Servers. The cmdlets can be used to run assessments programmatically, export the results and manage baselines. They enable the scenario of running assessments and managing baselines across multiple databases in your environment.

To get started, download the latest SqlServer PowerShell module on the PowerShell Gallery site.'...

https://blogs.msdn.microsoft.com/sqlsecurity/2018/07/05/powershell-cmdlets-for-managing-sql-vulnerability-assessments/

Monitoring Azure SQL Database

'There are a number of options to monitor Azure SQL Database.  In this post I will briefly cover the built-in options and not 3rd-party products that I blogged about a while back (see Azure SQL Database monitoring).

Monitoring keeps you alert of problems.  Another reason monitoring helps you is to determine whether your database has excess capacity or is having trouble because resources are maxed out, and then decide whether it’s time to adjust the performance level and service tiers of your database.  You can monitor your database using:...'...

https://www.jamesserra.com/archive/2018/07/monitoring-azure-sql-database/

Script to Identify Memory Used By Each Database

'During the last SQL Server Performance Tuning Practical Workshop, I was asked a very interesting question by an attendee. The question goes like if there is any script available which users can use and figure out if how much memory used by each of the databases. Fortunately, I was lucky that I have a script handy which exactly does the same task.

-- Memory used by each database
SELECT DB_NAME(database_id),
COUNT (1) * 8 / 1024 AS MBUsed
FROM sys.dm_os_buffer_descriptors
GROUP BY database_id
ORDER BY COUNT (*) * 8 / 1024 DESC
GO
'...

https://blog.sqlauthority.com/2018/06/09/sql-server-script-to-identify-memory-used-by-each-database/