Function to Return the Amount of Children in a Tree

Assuming we have the following table (that stores hierarchical data)  :CREATE TABLE [staff] (    [employee] [int] NOT NULL ,    [employee_name] [varchar] (10) NULL ,    [supervisor] [int] NULL ,     PRIMARY KEY  CLUSTERED     (        [employee]    )  ON [PRIMARY] ,     FOREIGN KEY     (        [supervisor]    ) REFERENCES [staff] (        [employee]    ))I ‘ll built a […]

2002-08-23

826 reads

Alert When Not Enough Free Disk Space

--Implement an Alert Which Trigger when Specified Disks--free space exceeds a specified alert level--Steps to implement:--1) Define a Custom Error Message with messsage text (The ---drive free space is bellow alert level. Details: %s)--2) Define an Alert linked to CEM defined at step 1--3) Implement a Job which execute the following step in a recurring […]

2002-06-04

2,674 reads

Blogs

Azure SQL Managed Instance Versions

By

Just a really quick FYI for the readers. If you are using Managed Instances...

A summary of new features in Azure SQL Database

By

It has been some time since I last wrote about Azure SQL Database. Although...

Daily Coping 23 Jun 2021

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Read the latest Blogs

Forums

Get total no of minutes by hour hand between two dates

By SSIS\SSRS\SSAS

am trying to avoid using while loop but OK with it... We are talking...

Get total no of minutes by hour hand between two dates

By SSIS\SSRS\SSAS

I am trying to avoid using while loop but OK with it... We are...

about the concern about sp_updatestats

By 892717952

Do I still need to run sp_updatestats  if I execute DBCC DBREINDEX(tablename) for tables...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers