Scripts

Technical Article

Grant Read-only permission to user on jobs

create this SQL as a stored procedure and give user execute permissions on it store procedure. that user will be able to see all the jobs and their associated schedules but won't be able to modify, create or execute job. This is particularly a request most often aske dby developer to view jobs/schedules on production […]

You rated this post out of 5. Change rating

2004-11-15 (first published: )

640 reads

Technical Article

Fix orphan users

some times after restore database, you find your logins and users mapping is lossed and no user can now logon to database using application. I faced that many times. To map all your database users with master..syslogins. save this procedure in current database and execute it. All users will be mapped with logins.

You rated this post out of 5. Change rating

2004-11-12 (first published: )

393 reads

Technical Article

Selective Defrag/Reindex and Log

SQL 2000 OnlyThis script will create a stored procedure and a table in the master database. Simply run the stored procedure and supply a database name as a parameter. It will do the following:1. Gather/Log DBCC SHOWCONTIG statistics (pre defrag)2. Defragment all user indexes in the database3. Gather/Log DBCC SHOWCONTIG statistics (post defrag)4. DBCC DBREINDEX […]

(3)

You rated this post out of 5. Change rating

2004-11-11 (first published: )

2,236 reads

Technical Article

SP_WHO_3 Powerful Filtering/Sorting Very Efficient

SP_WHO_3 is a very powerful utility for all DBAs. It displays processes connected to the system and what they are doing. It can find blocking processes, can return the Input Buffer for everything in the recordset returned, and provides immense filtering and sorting capabilities. It's designed to be extremely efficient, yet it provides many more […]

(1)

You rated this post out of 5. Change rating

2004-11-09 (first published: )

909 reads

Technical Article

Updating multiple rows using single stored proc

The situation arises when we are displaying data in a grid or some other control at front end level, where the user is making corresponding changes in the grid and at last when the user click for update button, the whole changes should be posted back to the database. This can be achieved by two […]

You rated this post out of 5. Change rating

2004-11-04 (first published: )

555 reads

Technical Article

Return a Subset of Data from a Table

The ability to page in SQL Server is one of those things that everyone wants, but can't quite seem to get from Microsoft. Many ideas have been posted, each claiming to be _the_ way to do it. In the spirit of mine is better than yours, I've implemented my own paging scheme.A feature that is […]

You rated this post out of 5. Change rating

2004-11-01 (first published: )

1,440 reads

Technical Article

Create a table of dates

This script creates a table and populates it with information about all dates between a (configurable) start date and end date.It creates a table called MyDates in a database called MyDB in which this is done but the script can be easily edited create the table in whichever DB you want it with whatever name […]

(1)

You rated this post out of 5. Change rating

2004-10-28 (first published: )

345 reads

Blogs

Claude finds two cryptographic weaknesses (but the sky isn’t falling)

By

If you haven't seen the announcement, Anthropic was able to utilize Claude (Mythos Preview)...

Generate Embeddings in SQL with Aurora and Bedrock

By

Most embedding pipelines on AWS have the same shape: a job reads rows out...

Resolving SQL Server Transaction Log Issues Efficiently

By

Transaction log issues are one of the quietest ways a healthy database turns into...

Read the latest Blogs

Forums

Symmetric Key Encryption

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Symmetric Key Encryption

The “Successful Login” Dilemma: Why Your Login Auditing Strategy Might Be Hurting Your Server

By Pablo Echeverria

Comments posted to this topic are about the item The “Successful Login” Dilemma: Why...

Building Your Own Software

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Building Your Own Software

Visit the forum

Question of the Day

Symmetric Key Encryption

If I run this statement in SQL Server 2025, how is the password encrypted?

CREATE SYMMETRIC KEY MySymmetricKey
WITH ALGORITHM = AES_256,
KEY_SOURCE = 'My secret key source passphrase',
IDENTITY_VALUE = 'My secret identity value'
ENCRYPTION BY PASSWORD = 'S&perS#cretP@ssword7';
GO

See possible answers