• Interests: Vedic Maths

Technical Article

Locate primary key - foreign key relations

Recently one of my friend was doing some investigation in a new/unknown database and had really hard time locating the primary key – foreign key relations. Like it’s really tough to locate these relations when not enforced at database level in terms of primary key and foreign key constraints. But generally all database developers keep […]

(7)

You rated this post out of 5. Change rating

2011-09-14 (first published: )

2,773 reads

Technical Article

Combine multiple rows into single output

We can use this function to combine multiple rows into single one. Generally to create comma separated list for each unique item. So this can create comma separated product list for any given category. The same can be used to make a list of items in a given order.ThanksMohit Nayyarhttp://mohitnayyar.blogspot.com/

(3)

You rated this post out of 5. Change rating

2007-09-14

3,817 reads

Technical Article

To Get Latest SQL Job Status

This query will give you the current job status of all scheduled jobs on sql server. Just by using sysJobs, and sysJobHistory table you will get to know the details about the last status of the scheduled jobs, irrespective of their status like failed, successful, or cancelled.Note: You must have admin right on MSDB database […]

(13)

You rated this post out of 5. Change rating

2003-09-04

8,561 reads

Technical Article

Error Handling in SQL Server (like Visual Basic)

Using this technique you can do error handling in SQL Server using the same way you do in Visual Basic (most of it). Just put your SQL Statement in exec('SQL Command') and make use of @@Error to get error information and put your error handling code in If block.Mohit NayyarMCP (.Net), MCSD, MCDBA

(1)

You rated this post out of 5. Change rating

2003-04-17

967 reads

Technical Article

To get Table and column name for Primary Keys.

This query will give you the table name and column name on which you have defined the primary key. You can use this to get columns on which the primary key is based. I find it very useful when i need to define the FK relationship for other tables in PowerDesigner. Try to do the […]

(2)

You rated this post out of 5. Change rating

2003-04-16

1,691 reads

Blogs

“We love to debate minutiae”

By

I am guilty as charged. The quote was in reference to how people argue...

Advice I Like: Knots

By

Learn how to tie a bowline knot. Practice in the dark. With one hand....

Shifting Mindsets: Why FinOps is Essential for Cloud Efficiency

By

As a DevOps practitioner, I’ve always focused on performance, scalability, and automation. But as...

Read the latest Blogs

Forums

Windows logins for users migrated from DomainA to DomainB

By a.koopman

Hi, I have a SQL Server instance where users connect to via Windows Authentication,...

Multiple Deployment Processes

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Multiple Deployment Processes

How to Use sqlpackage to Detect Schema Drift Between Azure SQL Databases

By Kunal Rathi

Comments posted to this topic are about the item How to Use sqlpackage to...

Visit the forum

Question of the Day

Upgrading Admin Queries

I have a query from a former DBA that we run on SQL Server 2025 to check on database metadata. This query references sys.sysaltfiles. I want to refactor this code to be more modern. Which DMV should I reference instead?  

See possible answers