Querying Microsoft SQL Server

Blog Post

Generate Random Passwords using T-SQL

Use following script to generate random Passwords
DECLARE @id int,@list varcharSET @list ='abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ23456789.,-_!$@#%^&*'selectreplace(SUBSTRING(CONVERT(varchar(255),NEWID()),8, 8),'-','')as RANDOM

Example:
Suppose you have a table tblUser with columns[id],[userid],[password].
CREATETABLE [dbo].[tblUser](     ...

2013-02-12

4,846 reads

Blog Post

Frequently asked SQL Server Queries

Data to test:
CREATETABLE [dbo].[emp](      [emp_id]
[nchar](10)NULL,      [emp_name]
[nchar](10)NULL,      [salary]
[int] NULL)ON [PRIMARY] insert emp( emp_id,emp_name,salary )  select'1','ABC',-20000 insert emp( emp_id,emp_name,salary )  select'2','XYZ',-5000 insert emp( emp_id,emp_name,salary )  select'3','PQR',-7800 insert emp( emp_id,emp_name,salary...

2013-02-04

747 reads

Blogs

The Third Sabbatical

By

I can’t believe I’ve been at Redgate long enough to get a third sabbatical....

Advice I Like: Focus on what’s important

By

Don’t let someone else’s urgency becomes your emergency. In fact, don’t be governed by...

India-US Tariff War: Is the Indian IT Sector at Risk?

By

How U.S.-India Tariff Disputes Could Ripple Through the Indian IT Sector Although the newly...

Read the latest Blogs

Forums

OpenQuery with Application Intent specified runs on primary node.

By kailash.kanaya

I have an Open query that runs on an Always On server via a...

What is a Failed Deployment?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item What is a Failed Deployment?

Generating a Series I

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Generating a Series I

Visit the forum

Question of the Day

Generating a Series I

What is returned by this code in SQL Server 2022?

SELECT value
FROM GENERATE_SERIES(4, 1);

See possible answers