SQLServerCentral - www.sqlservercentral.com

A community of more than 1,600,000 database professionals and growing

Featured Contents

Featured Script

The Voice of the DBA

Hint Word Search

This word search contains most (but not all) of the hints (query, join, and table) available in T-SQL.

j

o

z

f

e

p

s

r

s

b

e

f

y

h

b

y

o

h

a

s

h

j

o

i

n

d

t

q

u

a

s

d

f

g

v

o

w

q

m

i

v

j

b

s

n

x

v

n

x

w

m

x

z

o

r

m

c

v

c

k

y

x

q

w

j

g

k

s

n

e

c

v

p

a

p

k

p

a

s

e

y

y

n

t

e

a

y

x

y

l

y

j

q

p

z

z

p

e

i

a

i

i

b

k

p

s

z

a

b

i

n

j

q

b

a

w

p

e

b

w

n

y

j

h

l

v

w

k

e

h

s

i

b

a

p

m

g

s

n

v

t

e

a

h

g

x

i

x

g

s

s

w

i

u

o

d

l

x

d

p

v

b

g

g

k

e

c

o

a

d

f

s

d

e

e

t

n

y

i

i

x

v

y

v

q

l

w

c

b

r

f

l

w

u

s

e

p

l

a

n

o

w

a

i

t

a

r

v

t

o

u

t

n

a

i

k

u

x

a

n

o

i

s

r

u

c

e

r

x

a

m

r

l

p

r

l

i

v

x

z

h

p

t

h

f

m

l

q

e

c

t

h

x

c

s

k

w

p

g

p

d

c

f

u

d

n

w

y

s

v

o

u

t

c

s

o

a

q

k

e

g

x

l

e

q

k

a

s

d

x

u

j

w

d

d

a

d

s

j

k

r

k

o

c

a

j

x

t

n

j

o

t

e

d

d

l

z

b

r

e

c

o

m

p

i

l

e

a

h

c

u

t

r

o

d

n

s

p

h

i

k

b

p

i

k

p

x

v

u

o

f

x

r

v

a

p

t

r

x

r

d

n

h

e

p

j

b

l

i

e

o

c

a

n

x

a

l

d

v

n

i

a

k

g

o

p

o

p

a

b

k

k

t

t

a

y

j

t

n

n

z

j

z

u

d

f

f

a

m

g

w

q

u

g

r

e

d

r

t

b

h

a

t

f

q

d

t

g

t

v

u

p

e

r

p

d

u

q

n

m

o

o

r

l

u

e

m

i

j

x

z

p

o

m

z

p

u

q

i

q

j

n

j

g

t

q

e

o

o

p

z

w

b

g

t

k

d

u

u

c

r

e

b

p

s

a

y

n

p

u

m

r

q

l

r

u

r

t

t

r

i

l

v

t

k

s

o

r

w

c

y

x

a

i

m

a

r

s

c

m

l

p

o

k

e

e

p

i

d

e

n

t

i

t

y

q

n

j

o

j

e

b

l

o

w

q

z

g

y

o

y

s

c

m

t

f

m

d

i

v

i

m

a

x

d

o

p

c

f

d

n

p

e

f

u

a

p

l

o

u

m

o

a

r

w

i

o

g

l

w

m

b

t

b

l

f

u

y

o

v

e

k

u

u

p

q

z

p

k

u

l

m

i

c

z

m

m

r

g

o

l

z

g

o

l

d

q

d

h

s

z

d

l

o

d

p

j

v

r

d

m

g

i

e

f

b

c

c

c

e

c

c

c

s

q

o

k

u

y

h

p

x

t

s

r

o

c

f

l

r

g

v

f

t

o

x

v

d

h

e

t

k

v

h

g

a

c

p

m

i

b

w

p

n

i

g

n

o

r

e

c

o

n

s

t

r

a

i

n

t

s

z

v

a

o

g

c

k

z

m

g

b

l

n

i

m

h

n

r

b

r

u

h

a

o

e

n

q

i

a

r

c

r

i

y

g

c

t

x

d

m

s

d

x

n

g

s

s

e

e

j

t

h

f

r

t

d

p

b

v

p

z

a

a

x

b

x

n

q

b

m

e

i

x

r

v

e

d

a

b

p

a

d

i

a

l

f

h

v

b

g

u

y

n

l

i

b

u

f

n

x

n

l

f

v

t

p

k

m

h

o

d

h

n

n

o

k

j

r

a

h

c

o

l

h

o

e

x

g

w

s

f

u

f

c

x

j

y

a

h

a

q

a

y

e

x

c

g

t

x

i

j

k

k

u

h

c

e

v

g

d

k

m

n

y

m

e

b

p

y

t

v

j

x

m

b

m

k

u

a

g

g

s

v

l

d

z

o

t

r

Now that you've found all of the hints sort them in alphabetical order (column order)

_ _ _ _ _ _ _ _ _ _ O

_ _ _ _ _ _ _ _ _ _ _ _ O

_ _ _ _ _ _ _ _ _ _ _

_ _ _ _

O_ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _

_ O _ _ _ _ _

O _ _ _

_ _ _ _

_ _ O _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ O O _

_ _ _ _ _ _ _ _

_ _ _ _ _ _ O _

_ _ _ _ _ _ _ _

O_ _ O_ _

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _

_ _ O O _ _ _ _

_O_ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _

O _ _ _ _ _ _ _ _ O_ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _

_ _ _ _ O _ _ _ _

_ _ _ _O_ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _

_ _ _ _ _ _ _

O _ _ _ _

_ _ _ _ _ _

_ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ O

_ _ _ _ _ _ _

Fill in the blanks from the circled letters.

_ _ _ _ _ _ _ _ H _ _ _ _ _ Y _ _ _ _ B _ _ _ .com

Kenneth Fisher from SQLServerCentral.com

Join the debate, and respond to today's editorial on the forums

ADVERTISEMENT
SQL Prompt

Write, format, analyze, and refactor SQL fast with SQL Prompt

Writing SQL is 50% faster with SQL Prompt. Your SQL code can be formatted just the way you like it, you can create and share snippets with your team, and with code analysis you get suggestions to improve your SQL as you type. Download your free trial

SQL Source Control

How to track every change to your SQL Server database

See who’s changing your database, alongside affected objects, date, time, and reason for the change with SQL Source Control. Get a full change history in your source control system. Learn more

Featured Contents

 

Stairway to Advanced T-SQL Level 6: Creating Rows Of Data Using The UNPIVOT Operator

Gregory Larsen from SQLServerCentral.com

The UNPIVOT operator does just the opposite of the PIVOT operator, which we looked at in the previous level. By using the PIVOT operator we can take multiple rows of data and create as single row as output. The UNPIVOT operator will take values from a single row and will create multiple rows. Microsoft introduced the UNPIVOT operator when they rolled out SQL Server 2005. In this level I will be showing you different examples of how to use the UNPIVOT operator. More »


 

Free eBook: SQL Server Execution Plans, Second Edition

Press Release from Redgate

Every day, out in the various online forums devoted to SQL Server, and on Twitter, the same types of questions come up repeatedly: Why is this query running slowly? Why is SQL Server ignoring my index? Why does this query run quickly sometimes and slowly at others? My response is the same in each case: have you looked at the execution plan? More »


 

Heaps, Deletes, and Optimistic Isolation Levels

Additional Articles from Brent Ozar Unlimited Blog

Erik shows that heaps have even more drawbacks under optimistic concurrency. More »


 

How to use the SQL Prompt snippet placeholders for selecting and copying text

There are four SQL Prompt snippet placeholders that are all about selection and copying of text. These placeholders are very handy if, for example, you have two blocks of code that need to be part of a snippet. One part you hold on the clipboard, and the other part is a block of snippet text, selected using the $SELECTEDTEXT$ placeholder. More »


 

From the SQLServerCentral Blogs - What is Transparent Data Encryption?

Matthew McGiffen from SQLServerCentral Blogs

Transparent Data Encryption (TDE) was introduced in SQL 2008 as a way of protecting “at rest” data. It continues to... More »


 

From the SQLServerCentral Blogs - Deleting Azure SQL Database VNETs

Arun Sirpal from SQLServerCentral Blogs

This is quite a new feature (currently in preview) but an important one where we now have the ability to... More »

Question of the Day

Today's Question (by Steve Jones):

I have a dataframe called "sacks" that looks like this:

> sacks
# A tibble: 5 x 5
   Rank Player                        Sk Years     Tm   
                               
1     1 "Bruce Smith+\\SmitBr00"     200 1985-2003 2TM  
2     2 "Reggie White+\\WhitRe00"    198 1985-2000 3TM  
3     3 "Kevin Greene+\\GreeKe00"    160 1985-1999 4TM  
4     4 "Julius Peppers\\PeppJu99"   154 2002-2017 3TM  
5     5 "Chris Doleman+\\DoleCh00"   150 1985-1999 3TM

I have a second data frame that looks like this:

> sacks2
# A tibble: 5 x 5
   Rank Player                          Sk Years     Tm   
                                 
1     6 "Michael Strahan+\\StraMi02"   142 1993-2007 nyg  
2     7 "Jason Taylor+\\TaylJa03"      140 1997-2011 3TM  
3     8 "DeMarcus Ware\\WareDe99"      138 2005-2016 2TM  
4     9 "Richard Dent+\\DentRi00"      138 1983-1997 4TM  
5    NA "John Randle+\\RandJo00"       138 1990-2003 2TM   

If I want to combine these into sacks1to10 as a single data frame with the same number of columns which command do I use?

Think you know the answer? Click here, and find out if you are right.


We keep track of your score to give you bragging rights against your peers.
This question is worth 1 point in this category: R Language.

We'd love to give you credit for your own question and answer.
To submit a QOTD, simply log in to the Contribution Center.

Yesterday's Question of the Day

Yesterday's Question (by Mohammed Arshad):

When an index is rebuilt, does the fill factor apply permanently to the index until the next index rebuild?

Answer: No

Explanation:

The answer is no.

When an index is rebuilt, SQL server re-arranges the index pages as per the fill factor provided and fills only that amount of space on each  page. If no fill factor is set, the pages are filled. But the real catch is, SQL Server doesn't doesn't leave the free space configured in the fill factor for new pages that are required.

For example, if there are 80 pages in an index with fill factor 100% and it is rebuilt with a fill factor of 80%, SQL Server re-arranges all the 80 pages with 20% free space on each resulting in more total pages because now it has to leave 20% free space on all of them.

When a new transaction requires a new page, SQL Server doesn't apply the 80% fill factor for new pages allocated.


» Discuss this question and answer on the forums

Featured Script

All Link servers working status check and failure alert over E-mail

Subhash Chandra from SQLServerCentral.com

What to do when you have multiple Link servers and want to check daily basis link servers working status as alert over E-mail?

This procedure will help you to automation of link server failure alerts status check with help of SQL agent job scheduling. Job query :- 
exec proc_check_linked_servers 'profiler name','E-mail ID'

More »

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.

SQL Server 2017 : SQL Server 2017 - Administration

Huge Latency in TempDB - Hi All,  We are facing a huge latency in tempdb, what will be the reason??? Latency 1174 1174 1166 1173


SQL Server 2017 : SQL Server 2017 - Development

Checking for duplicate clients before INSERT - I'm involved in developing a client based application, and I'm working through how to do a duplicate check prior to...


SQL Server 2016 : SQL Server 2016 - Administration

Access users can't use SQL 2016 (?) - I'm migrating several Access backends from SQL Server 2005 to SQL Server 2016. I have successfully gotten the ODBC connections...

Add column into an existing table and add values - I just created a backup table from an existing table (The existing table contain some values in 'Marital Status' column...

DatabaseIntegrity CheckDB Job - Hi, i am using the ola's script for checkDB integrity,its all working well and i set the job to send...

SQL user account lost its stored procedure execution access - Hi, SQL user account lost its stored procedure execution access . how to  find what caused it to lose the access and...

SSRS - Inherited Server - Unable to find instance - Is it possible to repair? - Hello! On the SQL 2016 Server I am a "DBA" of now, I was looking to setting up SSRS.  At first...


SQL Server 2016 : SQL Server 2016 - Development and T-SQL

Apply targets to each month between two dates - I have a table in SQL which lists a monthly target for a particular contract (tblTarget). tblTarget has a layout like...

Sequential 'Alter Table' queries - Since my last visit, I've gotten by with just using my "Teach yourself SQL" book and lots of web searches. ...

Sort comma separated value in SQL Table - Hi  I want to sort a column value alphabetically which is already in a sql table to something like below...

Need counts of orders per week grouped by week - Hello Everyone,      I hope someone can help me out with this.  I have an order table that stores order information.

Trigger insert - Hi, I have a table that keep track of the store procedures and it log errors. I want to add the...


SQL Server 2014 : Administration - SQL Server 2014

SQL Server best practice.... - We recently created some new database servers (VMs), moving content to them from old servers approaching end of life.  Our...


SQL Server 2014 : Development - SQL Server 2014

Stored proc with variables - Heloo, i have a problem with the follow storedproc in my VB program i have a lot of tables with SQL...

Logic to check for empty table before joining - Hi All, I have a requirement which requires me to display report as per the dimension access to the user trying to pull the...


SQL Server 2012 : SQL 2012 - General

Sending emails to customers in their language - Hi Everyone I was wondering if it's possible to send emails to customers in their native language? Our Server/DB is in us_english...


SQL Server 2008 : T-SQL (SS2K8)

Show data based on MAX Action date - end of the month - Hi, I have the below query and like to show only the values highlighted in yellow in 2018-01-31. The previous months...


SQL Server 2008 : Working with Oracle

Cannot convert between unicode and non-unicode string data types - I am working on an SSIS project, to pull data from Oracle 10.2g into SQL Server 2008R2, 64-bit. This project...


Data Warehousing : Integration Services

Moving zip files - Hi guys This sounds like it should be simple but I'm banging my head on the brick wall again. I have an...

Package variables reference environment variables? - I have a package where network file paths are set up as package parameters, and these parameters are referenced in...

This email has been sent to {user_email}. To be removed from this list, please click here.
If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com.
This newsletter was sent to you because you signed up at SQLServerCentral.com.
Feel free to forward this to any colleagues that you think might be interested.
If you have received this email from a colleague, you can register to receive it here.
This transmission is ©2018 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com