List all primary keys
Thanks to Raul Sharma for his brilliant ideas. This is a modification of one of his scripts. The script takes only the user tables. Those tables which does not have PK are not listed!
2001-12-13
730 reads
Thanks to Raul Sharma for his brilliant ideas. This is a modification of one of his scripts. The script takes only the user tables. Those tables which does not have PK are not listed!
2001-12-13
730 reads
This script lists the columns with type and length. It eliminates system tables.
2001-12-13
762 reads
Have you ever wished T-SQL allowed you to pass an array into a stored procedure? Well the spListToTable stored procedure listed below accepts a delimeted string and turns it into a table. Code your stored procedure to accept a varchar, create a temporary table, call spListToTable, and use the populated temporary table as if it […]
2001-12-10
2,848 reads
This article demonstrates how to retrieve a single record from SQL Server by using the IRow interface with a singleton SELECT. The main purpose for this technique is to avoid the overhead of creating a recordset when you are fetching a single record. Because no recordset is actually created, only one read-only ADODB.Record is returned. This is true even if the specified SELECT results in multiple records being returned if a normal ADODB.Recordset is used.
2001-11-26
1,684 reads
I sometimes have to loop through records in a database and perform a specific action on the value that is returned. For example, In the script below I loop through the user tables in sysobjects and simply print them out. This technique is useful when dropping all indices/triggers on a particular table, or adding WITH […]
2001-11-25
9,163 reads
This script updates all foreign key references for the specified table. Useful if you need to delete a row. The follow example would update all uses of TableA.IDENTITYCOL where the value is 1 to the value of 2. Example usage: EXEC usp_updateFK 'TableA', 1, 2
2001-11-03
1,445 reads
Alexander Chigrik presents a few Math UDFs he has developed for common functions.
2001-10-09
6,005 reads
Here are two stored procedures for enabling and disabling all keys (primary and foreign) for a specified database. It makes sure the database specified is not the system databases and the users session is at the DB to have its keys enables/disabled.
2001-09-19
822 reads
There may be cases where you want to work with delimited strings in T-SQL. Following two examples will cover most of the stuff that you will face while working with strings.
2001-09-01
3,149 reads
This stored procedure was designed to scan all your character based columns in a particular database and show the minimum, maximum and average data length. As well as give an efficiency rating of the data stored. Input: None Output: Table name, Column name, Defined datatype and length, Average length of data for that column, Minimum […]
2001-08-10
1,670 reads
By Rohit Garg
In the expansive landscape of software development, the relationship between Database Administrators (DBAs) and...
We’re working through the major refresh of my Certified Kubernetes Administrator series at Pluralsight! The...
By Brian Kelley
In information security (INFOSEC), there several foundational concepts and principles. One of the ones...
Hi everyone, So I have a SSIS package that performs some importing/exporting from MySQL...
Hello SSC, I am not a DBA,. I have some DBA knowledge, but my...
I am currently working on creating a baseline for our server, using various counters...
In which editions of SQL Server 2022 can you run Reporting Services?
See possible answers