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

SQL Crossword - Best Practices

Across

5. Set this to leave some for the server.

6. How long will it take you to recover?

8. Do this regularly or corruption may sneak up on you.

9. Data source for cubes.

11. Not 5. More like 50.

14. How do you know if performance has gotten worse or not?

16. Update this at the database level when you upgrade an instance.

18. Turn this on for remote connections now before you actually need it.

21. Instant

22. You can have more than one, but SQL is only going to use one at a time, so most of the time it's really pointless.

23. Make sure you can do this if something goes wrong.

Down

1. Security granted to the SQL Server service account.

2. Take them, test them.

3. Where does the database go? (by default)

4. Adding this option will almost always speed up your backup.

7. They should all be the same size.

10. Generally, 8 or lower, depending.

11. Remove a lookup.

12. Make sure this supports your calculations.

13. Do this with everything before putting it in production.

15. How much data are you going to lose if the server goes down?

16. Backup/restore option that helps make sure it's not corrupt.

17. Cycle it occasionally. (daily?)

19. Generally, it's just going to grow again, so just don't.

20. This dimension is your best friend.

Kenneth Fisher from SQLServerCentral.com

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

ADVERTISEMENT
SQL Monitor

Don’t just fix SQL Server problems, prevent them from happening

SQL Monitor helps teams looking after SQL Server be more proactive. Not only does SQL Monitor alert you to current issues, it gives you the information you need to stop them happening in the future. Download SQL Monitor now and get a 14 day free trial

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

Featured Contents

 

Stairway to SQL Server Agent - Level 4: Configuring Database Mail

Richard Waymire from SQLServerCentral.com

Examines the database mail system configuration in depth. You will learn how to configure database mail to work with SMTP mail systems, and get some troubleshooting tips. More »


 

Free eBook: Defensive Database Programming

Press Release from Redgate

Resilient T-SQL code is code that is designed to last, and to be safely reused by others. The goal of defensive database programming, the goal of this book, is to help you to produce resilient T-SQL code that robustly and gracefully handles cases of unintended use, and is resilient to common changes to the database environment. More »


 

How SQL Monitor Monitors Azure-based SQL Server Failover Cluster Instances

This article will show you how to set up SQL Monitor to monitor Azure-based clustered instances right alongside your on-premise clusters. More »


 

From the SQLServerCentral Blogs - Dynamics AX Event Session

Jason Brimhall from SQLServerCentral Blogs

Many moons ago, I wrote about how to enable the context info for Dynamics AX. Having the context info enabled... More »


 

From the SQLServerCentral Blogs - SQL Homework – January 2017 – Inspect an Execution Plan

Kenneth Fisher from SQLServerCentral Blogs

It’s a new year and yet education never ends. So this month let’s take a look at an important part... More »

Question of the Day

Today's Question (by Steve Jones):

I have a new class that I've created in R with this code (s4 version):

 > setClass( + "NFLTeam", + representation( + name = "character", + City = "character", + conference = "character", + division = "character" + ) + ) 

How do I create an instance of the class and assign it to the "denver.broncos" variable?

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 Steve Jones):

I have a PowerShell script where I've gathered results of Get-SqlDatabase for a database in the $db variable. I want to check if the Recovery Model is set to Full with a simple script. I have this:

 if () { # Run a log backup } 

What code should I insert in between the parenthesis for the IF statement?

Answer: $db.RecoveryModel -eq 'Full'

Explanation:

In PowerShell, the tests for boolean logic are -eq, -gt-, -lt, -ne. These correspond to =, >, <, <> in T-SQL. The structure of the IF statement would be the object.property, in this case $db.RecoveryModel with the -eq operator and the 'Full' string.

Ref: An Introduction to PowerShell for a DBA - http://www.sqlservercentral.com/articles/PowerShell/163460/


» Discuss this question and answer on the forums

Featured Script

Get Index Scan Count

Mohammed Arshad from SQLServerCentral.com

This script extract the Number of Scans done on all index objects , their  name, the corresponding Schema name  , the table its built on , and also the average fragmentation. It can be edited accordingly to get other details.

Please run this on test database first before running on production. 

Can be run using SSMS.

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

Metldown and Spectre - Has anyone deployed any of the patches released for SQL 2016 and SQL 2017 to any of their environments.  Is anyone...


SQL Server 2017 : SQL Server 2017 - Development

Error running execute xp_cmdshell - Hi All I can run this from the command prompt C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Unrestricted -File C:\DailyEtlData\EtlScripts\Powershell\MoveFileDirtoDir.ps1 -SourceServer C:\inetpub\ftproot\ -DestinationServer C:\DailyEtlData\Connect\PreLoadFilesFromFtp\ -Filename 20171202.dump.gz if...

Divide column data into equal parts - I want to split one of the column's data into 8 equal parts. For eg. i have 73 rows currently...


SQL Server 2016 : SQL Server 2016 - Administration

Migrating Database Engine, SSIS, SSRS off of a server to have SSAS be on its own server - I have a requirement to make an existing server only run SSAS and migrate the Database Engine(and the perspective databases),...

IN-Memory tables - Hello All! I would like to know what is the the pros & cons of In-Memory tables in SQL Server 2016 In addition...

Suspect database - not urgent - Had an issue recently where I found a database in Suspect mode.  No access was possible. Started to look through logs...

Ola's maintenance solution taking too long on VLDB's - All, I am looking into optimizing Ola's maintenance solution by tweaking around some parameters that is part of the stored proc....


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

Row inserts for groups of rows (Totals for groups of like data). - I want to group data like all invoices from a supplier which is easy enough but when selecting multiple suppliers,...


SQL Server 2014 : Development - SQL Server 2014

Detecting change week over week in SQL table - Hello everybody, trying to figure what is the best way to figure out change between snapshots of project records. Snapshots are...

SELECT all negative values, that have a positive value - Hello, I need to identify in SQL server table all entries with a negative value, that have a positive value. How...

Issue with ROW OVER partition - I was able to get this far from other posts in this forum, but keep getting error . . . invalid column . . Max_Date The...

Convert from datetime to varchar to int - Hi All, So I've been working on an SSIS package and part of it involves pulling data from a table's datetime...


SQL Server 2012 : SQL 2012 - General

CASE statement slows down query drastically - If i comment out the case statement in this query, it takes less than  a second.  With the case statement,...


SQL Server 2012 : SQL Server 2012 - T-SQL

Searching strings - Hi all We've got a 3rd-party application and an associated database. We need to join two tables together but, unfortunately, there's no...


SQL Server 2008 : SQL Server 2008 - General

Weird Character - I imported data into SQL Server using a link server.  Imported an Excel version and a CSV version.  One cell...

Composite Key Assistance - Hello, While I've searched this topic with some hits, I've never been able to fully digest this to my satisfaction.  My...

How to Pivot Financial Data Rows Into Dynamic Columns - I'm assuming this technique has a commonly used name/term and has been solved many times and if that's the case...


Reporting Services : Reporting Services 2008 Development

error: non-existing report parameter - Hello Everyone, I get this error: "The value expression for the query parameter '@eDate' refers to a non-existing report parameter 'eDate'....


Reporting Services : SSRS 2012

The version of the report server database is either in a format that is not valid, or it cannot be read. The found version is '164'. The expected version is '163'. - we are getting the following when we updated from SQL 2012 SP2 to SQL 2012 SP3 The version of the...


SQL Server 7,2000 : Replication

Error 208: Invalid object name ''msdb.dbo.MSdistpublishers'' - Hi Guys, We have a server setup as a distribution server, which manages the replication to & from 3 other SQL servers. Last...

This email has been sent to newsletter@newslettercollector.com. 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