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,852 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

748 reads

Blogs

Advice I Like: Praise

By

Don’t reserve your kindest praise for a person until their eulogy. Tell them while...

How to Install SQL Server 2025 RC0 on an Azure VM

By

I wanted to try out the new JSON index which is for the moment...

Prepping for Certification, Part 1 of ?

By

I thought it would be good to put my thoughts down on how to...

Read the latest Blogs

Forums

Learning a New Language

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Learning a New Language

is there a way to "detect" schema like changes on a server?

By stan

Hi, we have a few people who like to experiment on our prod sql...

Guidelines and Requirements

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Guidelines and Requirements

Visit the forum

Question of the Day

Copying Production Schema

If I use DBCC CLONEDATABASE, can I remove some of the information from the copy?

See possible answers