SQLServerCentral - www.sqlservercentral.com

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

Featured Contents

The Voice of the DBA

Who Works on What?

We have a five developers in our small business. We are moving to a new building, and each of the developers is supposed to have a customized workspace with specific post it notes, their favorite beverage, and a poster that is themed to the language they specialize in. The developers sit in a line of offices, so left and right refer to their relative placement in the office layout.

Unfortunately, the project manager quit, leaving all the supplies in a single box. The new project manager wants to impress the developers as they move in. Unfortunately, interviews with the support staff have given a limited number of clues. Can you solve the puzzle and help the project manager ensure that each developer gets in the right office with the correct supplies?

Developers

1

2

3

4

5

Post Its: pink
brown
red
white
gray
Drink: tea
mountain dew
beer
water
coffee
Language: T-SQL
C#
Javascript
PowerShell
HTML/CSS
Action:

The Clues

  • There is one developer between the pink and brown developer.
  • The C# sits directly to the left of the mountain dew drinking developer.
  • The T-SQL developer sits to the left of the red developer.
  • Developer 2 does not drink mountain dew.
  • There are two developers between the Javascript and the tea drinking developer.
  • Developer 2 is the PowerShell developer.
  • There is one developer between the developer drinking beer and the pink developer.
  • The PowerShell developer lives directly to the right of the gray developer.
  • There are two developers between the C# and the Javascript developers.
  • There is one developer between the developer drinking tea and the brown developer.
  • There is one developer between the T-SQL developer and the coffee drinking developer.
Steve Jones from SQLServerCentral.com

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

ADVERTISEMENT
Webinar

How to extend DevOps practices to the database

Including the database in DevOps initiatives greatly improves performance. We will walk you through Redgate’s Database DevOps solution, showing reliable, scalable and repeatable processes for automating your database development and deployment.
Register now

SQL Provision

NEW SQL Provision: Create, protect, & manage SQL Server database copies for compliant DevOps

Create and manage database copies effortless and keeps compliance central to the process. With SQL Provisions virtual cloning technology, databases can be created in seconds using just MB of storage, enabling business to move faster. Sensitive data can be anonymized or replaced with realistic data to ensure data is protected as it moves between environments. Download your free trial

Featured Contents

 

Using SQL Server Dynamic Online Catalog to Explore Keys and Relationships: Stairway to Exploring Database Metadata Level 4

Phil Factor from SQLServerCentral.com

This level introduces keys, constraints, and relationships. More »


 

Free eBook: Inside the SQL Server Query Optimizer

Press Release from SQLServerCentral.com

This free eBook from Redgate Software will take you from the fundamentals of Statistics, Cost Estimation, Index Selection, and the Execution Engine, and guide you through the inner workings of the Query Optimization process, and throws in a pragmatic look at Parameterization and Hints along the way. More »


 

Granting View Definition Permission to a User or Role in SQL Server

Additional Articles from MSSQLTips.com

In SQL Server 2005 by default users of a database that are only in the public role cannot see the definitions of an object while using sp_help, sp_helptext or the object_definition function. More »


 

From the SQLServerCentral Blogs - Snapshot Agent Acquires schema modification (SCH-M) lock on all the articles of a publication

As the business requirement, It is very common to see a request for adding a new article or subscription to... More »


 

From the SQLServerCentral Blogs - Analyze Actual Execution Plan

Grant Fritchey from SQLServerCentral Blogs

One of the many new sets of functionality introduced in SQL Server Management Studio 17 is the new option “Analyze... More »

Question of the Day

Today's Question (by Steve Jones):

I write a function in Python that is supposed to split out the names of a SQL Saturday event and return the number. This is contained in a file called sqlsat.py and the function looks like this:

 def getsqlsatnum(event): Slices = event.split() return(Slices[1].strip('#')) 

I want to test this in the REPL, so I open one and type this:

 >>>import sample >>>getsqlsatnum("SQLSaturday #1 - Orlando 2007") 

I get an error that the name 'getsqlsatnum' is not defined. Why?

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: Python.

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

ADVERTISEMENT

Exam Ref 70-774 Perform Cloud Data Science with Azure Machine Learning

Prepare for Microsoft Exam 70-774 and help demonstrate your real-world mastery of performing key data science activities with Azure Machine Learning services. Designed for experienced IT professionals ready to advance their status, Exam Ref focuses on the critical thinking and decision-making acumen needed for success at the MCSA level.  Get your copy today from Amazon.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

What is returned from this code:

 DECLARE @SomeVar DECIMAL(10,4) = -2.5 SELECT ROUND(@SomeVar,0,1) 

Answer: -2.0000

Explanation:

The correct answer is -2.0000. The third parameter is the truncate parameter for ROUND().

Ref: ROUND() - click here

Rounding Tips and Tricks - http://www.sqlservercentral.com/articles/T-SQL/145448/


» Discuss this question and answer on the forums

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

Help finding Fullback up file upon which differential backup is based - New to SQL and SQL server and faced with making sure our company is properly backing up all our DBs. ...


SQL Server 2017 : SQL Server 2017 - Development

Different behavior between "alter table drop column if exist" (new syntax) and the legacy one "if exists() alter table drop column " : is this a bug? - Hi I have notice something weird with the new syntax with a "drop if exist" It looks like the new syntax fire...

Join on next available non null value - Hi folks, I have costs that I need to convert into a different currency based on the currency at the time. ...

Update failing from CSV if data not in table - First post here guys so sorry if Im in the wrong place for this.  Its been the bain of my...

ADDING FIELDS WITH A SELECT STATEMENT - Can someone kindly help me with the query below: SELECT 1 AS ID, '1    Field, COALESCE(SUM(Field1)/1000,'0.0')  AS Field FROM Table WHERE Condition='Money' and SecondCondition...

Row-by-row insert with error handling -- Stored Procedures vs. SSIS - Hello, I have dynamic inserts and update statements that are created based on a select from sys.columns. My inserts and updates...


SQL Server 2016 : SQL Server 2016 - Administration

SQL 2016 SP2 - CU2 - Security Patch KB293807 - Maintenance Plans Issues - Over the weekend we installed SP2-CU2 and KB293807 on our SQL Server failover cluster.  Now maintenance plans aren't work on...

SPN Registration hostname vs dns - Hello, Does anyone know if you need to register both the DNS address of a server and the hostname of the...


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

Best way to join onto same table to extract different data - I'm the original poster of this question https://www.sqlservercentral.com/Forums/1990728/Multiple-Joins and during the conversation I was told my existing code was bad because...

Multiple Joins - Hi guys, just a general question. I'm writing a query in order to create quite a large report. I have multiple...


SQL Server 2014 : Administration - SQL Server 2014

Transactional Replication - Inserting Duplicate Keys - Hi All This seems like a strange one to me. We added a few new articles into a publication yesterday, and...


SQL Server 2014 : Development - SQL Server 2014

Will temp tables be dropped when Transaction commits? - Hi gurus! It is been a long time since I asked you for your input to clear my self doubt :) I...

Enforce Unique Constraint Across Two Tables - I have an interesting problem.  An application allows users to "Tag" events with a label.  Each user can put a...

INSERT EXEC statement cannot be nested - I have a requirement to get data from a deep chain of procs.  However, there is already an "INSERT EXEC"...


SQL Server 2012 : SQL 2012 - General

Unicode Support and Conversion - I have SQL Server 2012 and all my inputs got changed to Unicode. I have a week to change my...

Procedure Result taking more time - Below stored procedure taking more time(1 minute 56 seconds) for completing the execution.First table PDF_MSDS only having more records compare...


SQL Server vNext : SQL Server 15 - Administration

Enable Logging of both failed and successful logins on Linux - Anyone seen how you do this? On a Windows Environment you can just do this via the Server Properties Window,...


SQL Server 2008 : SQL Server Newbies

Prevent duplicates in a table - I am entering 'salaries' information into a sql server table called 'salaries'. Fields are : id (pk,identity),c_id (int),month,year,salary. I use a stored procedure...


SQL Server 2008 : SQL Server 2008 Performance Tuning

Non Clustered Index on Phone column - Dear All, I have a Lead table with below fields. LeadId int (Not a primary key) Telephone ... ...Table have 4 millions records Client always search the...


SQL Server 2005 : SQL Server 2005 Integration Services

SSIS suddenly takes longer time to run - I am relatively new to SSIS. I have an ssis package which used to run in less than 9 minutes....

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