SQL Server Cursor

Cursors are not the best solution when talking about performance but,

If you run into issues with another coding technique and need to get something done quickly, using a cursor may be a viable alternative. It may take longer to process the data, but the coding time might be much less. If you have a one-time process or nightly processing, this could do the trick.

This article contains a good description, example and alternatives to cursors.

https://www.mssqltips.com/sqlservertip/1599/sql-server-cursor-example/

SQL Server Execution Plan

Using the Execution Plan in SSMS can answer many questions about why the query you just made runs so slowly. A well constructed T-SQL script should execute reasonably quickly if the database is indexed properly. Since most users have no ability to create nor administer indexes on the databases, the best way to improve performance is to improve the T-SQL script.

Here is a link that tests your ability to use the Execution Plan in SSMS.

http://www.sqlservercentral.com/blogs/sqlstudies/2018/01/03/sql-homework-january-2017-inspect-an-execution-plan/?utm_source=SSC&utm_medium=pubemail

It also includes a link to the book that I recommended last year.

https://www.red-gate.com/library/sql-server-execution-plans-2nd-edition

Connect a SQL Server database to your workbook

Last week I shared the ODBC connection method for connecting SQL Server data to Excel.  Now that you’ve mastered the intricacies of that technique, I want to share a simpler method.

You can use the Data Connection Wizard to create a dynamic connection between a SQL Server database and your Excel workbook.

This type of connection is read-only  —  you cannot update any data in the database from your workbook.

Here is a link to the article:

https://support.office.com/en-us/article/Connect-a-SQL-Server-database-to-your-workbook-22C39D8D-5B60-4D7E-9D4B-CE6680D43BAD

 

I will be attending PASS SQL Saturday on March 11 – I HOPE TO SEE YOU THERE ! !

http://www.sqlsaturday.com/592/eventhome.aspx

It will be a mind-blowing event that should not be missed . . .