stored procedure Archives - {coding}Sight https://codingsight.com/tag/stored-procedure/ Blog for SQL Server DBAs and Developers Mon, 07 Aug 2023 08:58:34 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 https://codingsight.com/wp-content/uploads/2021/10/cropped-Soсial_-Fb_180х180-1-32x32.png stored procedure Archives - {coding}Sight https://codingsight.com/tag/stored-procedure/ 32 32 Get Your SQL Server Database Size with Ease: Stored Procedures in Action https://codingsight.com/stored-procedure-to-get-server-storage-information-in-server/ Mon, 27 Sep 2021 08:24:33 +0000 http://codingsight.com/?p=17145 As popular as the cloud services are nowadays, there’s still a good chunk of on-premises deployments of SQL Server that still require our services to support them. One of the areas of on-premises setups that we must keep an eye on is storage, right where the data is saved. I’m going to present you a …

The post Get Your SQL Server Database Size with Ease: Stored Procedures in Action appeared first on {coding}Sight.

]]>
How to Get Tables Information in SQL Server via Stored Procedure https://codingsight.com/sp-to-get-database-sql-tables-information/ Thu, 19 Aug 2021 08:30:28 +0000 http://codingsight.com/?p=16268 As a database administrator, developer, or data analyst, understanding the structure and details of your SQL Server database tables is crucial. It aids in optimizing performance, debugging issues, and making informed decisions about data management. In this post, we will delve into the practical steps of using stored procedures to retrieve tables information in SQL …

The post How to Get Tables Information in SQL Server via Stored Procedure appeared first on {coding}Sight.

]]>
How to Show List of Indexes in SQL Server using Stored Procedure https://codingsight.com/stored-procedure-to-get-indexes-status-in-all-databases/ Mon, 16 Aug 2021 08:54:37 +0000 http://codingsight.com/?p=16134 As SQL Server DBAs, we’ve heard that index structures can dramatically improve the performance of any given query (or set of queries). Still, there are certain details that many DBAs overlook, like the following: It’s very important to keep in mind that the system view that holds this particular metadata gets wiped every time the …

The post How to Show List of Indexes in SQL Server using Stored Procedure appeared first on {coding}Sight.

]]>
How to Use the sp_whoisactive PowerShell Script for Real-Time SQL Server Monitoring https://codingsight.com/using-sp_whoisactive-in-sql-server/ Fri, 30 Jul 2021 13:17:22 +0000 http://codingsight.com/?p=15345 Nowadays, within the SQL Server DBA community, it is extremely likely that we use, or at the very least have heard of, the famous stored procedure sp_WhoIsActive developed by Adam Machanic. During my time as a DBA, I used the SP to immediately check what’s going on inside a particular SQL Server instance when it …

The post How to Use the sp_whoisactive PowerShell Script for Real-Time SQL Server Monitoring appeared first on {coding}Sight.

]]>
Stored Procedure to Delete Duplicate Records in SQL Table https://codingsight.com/how-to-delete-duplicate-records-in-a-table/ Wed, 14 Jul 2021 11:32:39 +0000 http://codingsight.com/?p=15328 Sometimes during our run as DBAs, we come up across at least one table that is loaded with duplicate records. Even if the table has a Primary Key (an auto-incremental one in most cases), the rest of the fields might have duplicate values. However, SQL Server allows for many ways to get rid of those …

The post Stored Procedure to Delete Duplicate Records in SQL Table appeared first on {coding}Sight.

]]>
10 SP_EXECUTESQL Gotchas to Avoid for Better Dynamic SQL https://codingsight.com/10-sp_executesql-gotchas-to-avoid-for-better-dynamic-sql/ https://codingsight.com/10-sp_executesql-gotchas-to-avoid-for-better-dynamic-sql/#comments Fri, 09 Jul 2021 10:37:12 +0000 http://codingsight.com/?p=15148 Do you know how powerful a tool like dynamic SQL can be? Use it the wrong way, and you can allow someone to take over your database. Plus, there might be too much complexity. This article aims to introduce the pitfalls when using SP_EXECUTESQL and offers 10 most common gotchas to avoid. SP_EXECUTESQL is one …

The post 10 SP_EXECUTESQL Gotchas to Avoid for Better Dynamic SQL appeared first on {coding}Sight.

]]>
https://codingsight.com/10-sp_executesql-gotchas-to-avoid-for-better-dynamic-sql/feed/ 1
How to Find SQL Server Instance Name and More with Stored Procedures https://codingsight.com/stored-procedure-to-get-instance-settings/ Thu, 10 Jun 2021 11:01:01 +0000 http://codingsight.com/?p=14574 SQL Server instances serve as the backbone of a business model, housing databases that contain vital data for backend operations or specific application configurations. Each instance possesses a unique set of values or settings that, when properly tuned, align with industry best practices. In this article, we delve into the functionality of a particular Stored …

The post How to Find SQL Server Instance Name and More with Stored Procedures appeared first on {coding}Sight.

]]>
How to Get Backup Status in SQL Server using Stored Procedure https://codingsight.com/a-dedicated-stored-procedure-to-get-the-latest-database-backup-status/ Fri, 21 May 2021 07:08:27 +0000 http://codingsight.com/?p=14000 Any SQL Server DBA (of course, this applies to all platforms) will agree that database backups are the most essential things for data professionals. Monitoring those backups’ statuses is crucial. To make this task more straightforward, I have created a custom Stored Procedure. It will allow you to get the latest database backups’ (if any) …

The post How to Get Backup Status in SQL Server using Stored Procedure appeared first on {coding}Sight.

]]>
3 Easy and Secure Ways to Make Users Run SSIS Packages https://codingsight.com/3-easy-and-secure-ways-to-make-users-run-ssis-packages/ Mon, 02 Nov 2020 09:17:29 +0000 https://codingsight.com/?p=10286 Have you ever come across a situation where you needed to make users run SSIS packages? This happens when the user is not comfortable with a fixed schedule for whatever reason. You can’t define if it’s every weekend, at 9 pm, or the 5th of the month. It happens when it happens. This sounds problematic, …

The post 3 Easy and Secure Ways to Make Users Run SSIS Packages appeared first on {coding}Sight.

]]>
SQL Server – Dissect the Internals of sp_spaceused https://codingsight.com/sql-server-dissect-the-internals-of-sp_spaceused/ Tue, 06 Feb 2018 15:43:02 +0000 http://codingsight.com/?p=3302 This article is an effort to dissect the output of the sp_spaceused stored procedure. Introduction Understanding the database usage internals and the growth trends play a vital role in the defining the right sizing of the database. sp_spaceused is probably an administrator’s most widely-executed system stored procedure to find the disk space used by a …

The post SQL Server – Dissect the Internals of sp_spaceused appeared first on {coding}Sight.

]]>