Technical Article

Weekly Reports Made Easy

Each week you are required to run various reports based on table entries made during the week preceding latest Sunday. Use this SQL7/2000 procedure (can be a UDF in SQL2K) to retrieve the latest midnight of a specified day of the week as illustrated below: Declare @StartDate datetime, @EndDate datetime Exec DBAservice.dbo.uspGetLatestWkDayMidnight @pDate = '1998-05-06', […]

You rated this post out of 5. Change rating

2003-03-13

320 reads

Technical Article

Rename SQL Server

Utilizing sp_dropserver and sp_addserver system procedures we will change local SQL Server name to a specified one, or, by default, to the WINS machine name. Just another utility in my DBAservice toolbox database.Notes:1.Tested in SQL Server7.2. In some cases it is necessary to rerun sql server setup in order to start the server after renaming. […]

You rated this post out of 5. Change rating

2003-02-13

370 reads

Technical Article

Check user activity

This stored procedure is another monitoring utility that can be executed periodically as a sql server agent job. The procedure checks if there are any open connections, and if there was any recent user activity within a given period of time in a given (or any) database by a given (or any/any except given) login […]

You rated this post out of 5. Change rating

2002-11-30

1,301 reads

Technical Article

Monitoring SQL Server downtime

The following script creates a monitoring utility to find out for how long a sql server was down prior to the latest startup. The script creates one table (tblHeartbeat), four stored procedures (uspFillHeartBeat, uspGetDowntimeSummary, uspCleanHeartbeat, uspAtStartup) and two jobs (FillHeartbeat and CleanHeartbeat).Notes:1. By convention I introduced in my company (UGO Networks, Inc.) all "service" database […]

You rated this post out of 5. Change rating

2002-11-21

850 reads

Blogs

AI: Blog a Day – Day 8: RAG – Retrieval Augmented Generation

By

RAG — Retrieval Augmented Generation. we have covered so far — embeddings, vectors, vector...

AI: Blog a Day – Day 7: Vector and Vector Databases

By

Continuing from Day 6 we learned Embeddings, Semantic Search and Checks, on Day 7...

AI: Blog a Day – Day 6: Embeddings – How AI Understands

By

Continuing from Day 5 where we covered notebooks, HuggingFace and fine tuning AI now...

Read the latest Blogs

Forums

I'm thinking about submitting some articles

By Doctor Who 2

I've written some documentation on using different Markdown types of files on GitHub. It's...

Not Just an Upgrade

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Not Just an Upgrade

Restoring On Top I

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Restoring On Top I

Visit the forum

Question of the Day

Restoring On Top I

I am doing development work on a database and want to keep a backup so I can reset my database. I make some changes and want to restore over top of my changes. When I run this code, what happens?

USE Master
BACKUP DATABASE DNRTest TO DISK = 'dnrtest.bak'
GO

USE DNRTest
GO
CREATE TABLE MyTest(myid INT)
GO
USE master
RESTORE DATABASE DNRTest FROM DISK = 'dnrtest.bak' WITH REPLACE

See possible answers