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

What is KTLO? Keep The Lights On vs Project Work in Agile

By

🔍 Demystifying KTLO: A Deep Dive into Keep The Lights On Work in IT...

The PASS Summit on Tour in Dallas

By

The PASS Summit goes on tour this year, with a September stop in Dallas....

SQL Server Auto-settings: The Good, the Bad, and the Ugly

By

Settings That Could Be Hurting Your Performance If you’ve ever created a new SQL...

Read the latest Blogs

Forums

How a Legacy Logic Choked SQL Server in a 30-Year-Old Factory

By Chandan Shukla

Comments posted to this topic are about the item How a Legacy Logic Choked...

Formatting Dates and Times: The SQL Dialect Divide

By dbakevlar

Comments posted to this topic are about the item Formatting Dates and Times: The...

Query Plan Regressions --

By dbakevlar

Comments posted to this topic are about the item Query Plan Regressions --

Visit the forum

Question of the Day

Query Plan Regressions --

For the Question of the day, I am going to go deep, but try to be more clear, as I feel like I didn't give enough info last time, leading folks to guess the wrong answer... :) For today's question:  You’re troubleshooting a performance issue on a critical stored procedure. You notice that a previously efficient query now performs a full table scan instead of an index seek. Upon investigating, you find that an NVARCHAR parameter is being compared to a VARCHAR column in the WHERE clause. What is the most likely cause of the query plan regression?

See possible answers