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

The Remote DBA

I'll start this week with a question, which I hope some of you answer in the discussion: would you like to, or do you, work at home the majority of the time?

I remember when I worked in a company and needed to leave my desk and walk to a room somewhere to get some work done on a server console. Some of those rooms were cold rooms, which necessitated me keeping a jacket at my desk. I still remember going to a large company that had cables run from the data center to a couple specific workstations near the administrators' cubes. At one point we installed a remote IP device allowing us to get to the console of any server without having to walk downstairs, or even use RDP, which was just becoming to Windows machines.

That was the end of my visiting servers in person, and since then, the only times I've ever really needed to look at a server was when a critical error prevented me from connecting remotely. Even then, at many of the co-location facilities I've contracted with, I could call and have an individual go press a power button. These days, with cloud providers and virtual machines, even that is unnecessary.

Those of us that have worked with SQL Server typically understand that we always make a network connection to work with the server. Even when we're working on the server console, SSMS, SQLCMD, and more all make a "connection" to the database server. Therefore, is it really necessary that we ever work near a particular system?

I've been working from home as a telecommuter for about 8 years. My wife worked in technology from home for nearly 20 years. More and more people are doing so, in fact, there was a piece on Fast Company recently that noted more people work from home than ever before. Unfortunately, this study shows that most people end up working more hours, adding a few from home to the 40 or more they spend at work.

That's not good, but if we can get some work done at home, why not more? I know meetings and face to face time matter, especially in some jobs, but more and more I find that lots of people that need time working alone could do a portion, perhaps a significant portion, of their work away from the office.

So this week, would you like to do more work from home (or elsewhere)? Do you want more virtual meetings, more communication over email, Slack, Skype, or some other tool? Let me know.

Steve Jones from SQLServerCentral.com

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


The Voice of the DBA Podcast

Listen to the MP3 Audio ( 4.0MB) podcast or subscribe to the feed at iTunes and Mevio . feed

The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. Support this great duo at www.everydayjones.com.

Everyday Jones

Follow Steve Jones on Twitter to find links and database related items and announcements.

ADVERTISEMENT
SQL Compare

The industry standard tools for comparing SQL Server schemas and data

How do you save time comparing and deploying SQL Server database schemas, create error free deployment scripts in minutes, and fix errors caused by differences between databases? Find out with a free trial.

DLM Dashboard

Track schema changes for free

DLM Dashboard tracks SQL Server databases to show you exactly what schema changes have been made, by who, and when. You get a full history, with line-by-line differences, and a clear audit trail of your database moving from development to production. Download free tool.

DLM Demo

Redgate DLM Demo (Using Migration Scripts in SQL Source Control)

Learn how Redgate DLM works with Git, TeamCity & Octopus Deploy to set up continuous delivery for your databases, with our free DLM Demo webinar. Grant Fritchey will show how to use SQL Source Control to version control your databases, and how to use DLM Automation to include your databases in your CI process and set up automated deployments. Register now. Watch now.

Featured Contents

 

Stairway to T-SQL: Beyond The Basics Level 8: Coding Shortcuts using += and -= Operators

Gregory Larsen from SQLServerCentral.com

No one wants to use more keystrokes than they have to when they write a chunk of T-SQL code. To help with minimizing the number of characters a T-SQL developer needs to type the Microsoft team introduced three new shortcuts operators when they release SQL Server 2008. These shorts cuts are the String Concatenation, Add EQUALS, and the Subtract EQUALS operators. More »


 

A Happy Birthday Present from Minionware

Press Release from SQLServerCentral.com

The Midnight DBAs and Minionware are having a birthday celebration. You can get your present of a free license today only. More »


 

SQL Server 2016 Temporal Table Query Plan Behaviour

Additional Articles from SQLPerformance.com

For this month's T-SQL Tuesday, Rob Farley takes a look at a couple of unexpected aspects of query plans you might observe when using Temporal Tables in SQL Server 2016. More »


 

From the SQLServerCentral Blogs - Know How to Handle Deadlock in SQL Server

zorastalin from SQLServerCentral Blogs

Introduction To Deadlock Deadlock in SQL server is a condition in which two or more system server processes IDS (SPIDs) are... More »


 

From the SQLServerCentral Blogs - Choosing Content for the Summit

Steve Jones from SQLServerCentral Blogs

This is a series of posts on the PASS Summit and SQL Saturdays. I’m outlining some thoughts here, sometimes for... More »

Question of the Day

Today's Question (by Steve Jones):

What happens when I run this batch in SQL Server 2014? 

 CREATE TYPE Steve FROM NUMERIC(4, 2); CREATE TABLE Steve ( id INT ); GO 

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: T-SQL.

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

SQL Server AlwaysOn Revealed

Get a fast start to using AlwaysOn, the SQL Server solution to high-availability and disaster recovery. Read this short, 150-page book that is adapted from Peter Carter’s Pro SQL Server Administration to gain a solid and accurate understanding of how to implement systems requiring consistent and continuous uptime. Get Your Copy Today

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

I've got a table and a few view definitions below. If I wanted to run this insert statement, would it work?

 INSERT dbo.RoomCapacity VALUES (1, '344a', 25) 

DDL:

 CREATE TABLE Schedules ( PersonID INT , BuildingID INT , RoomNumber VARCHAR(20) , DayNumber tinyint , StartTime TIME , EndTime TIME , Capacity tinyint ) GO CREATE TABLE Classes ( Classname INT , BuildingID INT , RoomNumber VARCHAR(20) , DayNumber tinyint , StartTime TIME , EndTime TIME ) GO CREATE VIEW BuildingSchedule ( BuildingID, RoomNumber, DayNum, StartTime, endtime, capacity) AS SELECT s.BuildingID ,s.RoomNumber ,s.DayNumber ,s.StartTime ,s.EndTime ,s.Capacity FROM dbo.Schedules AS s INNER JOIN Classes c ON s.BuildingID = c.buildingid AND s.DayNumber = c.daynumber AND s.StartTime = c.StartTime GO CREATE VIEW RoomCapacity AS SELECT bs.BuildingID ,bs.RoomNumber ,bs.Capacity FROM dbo.BuildingSchedule AS bs GO 

Answer: Yes, this works fine.

Explanation:

This will actually work fine. Inserting into a view works when the view can insert into one table and the underlying columns will allow NULL for those columns not included in the view or insert.

Ref: CREATE VIEW - https://msdn.microsoft.com/en-us/library/ms187956.aspx

Looking at VIEWs, Close Up - https://www.simple-talk.com/sql/t-sql-programming/looking-at-views,-close-up/


» Discuss this question and answer on the forums

Featured Script

Find Orphan users for each database in a given SQL Instance

Prime SQL from SQLServerCentral.com

This is a simple script that will you give you an output in  a tabular format of Database name,UserName and UserSid 

Open your SQL Server Management Studio(SSMS) and copy the above code and paste it in SSMS and Execte(F5 or Ctrl+E or Alt+x) and you will see the results.

Please use this on a test server or test it before you use it on production servers, we are not responsible for any consequences, please do a code review.

In case of any error or issue of using above code please do a comment  

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 2016 : SQL Server 2016 - Administration

Microsoft SQL Developer Certification For beginers - Hello, Anyone suggest for Microsoft SQL Developer Certification For beginners. Please let me know topics, exam level wise, fee where we can...


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

how to find number of days between successive visists? - PatientId PatientNO Initials---- Patients Table 1 1 ABC 2 3 DEF 3 4 HIJ VisitId PatientID VisitNo VisitDate 1 1 1 12-Jan -2005 2 1 2 23-Jan-2005 3 1 3 28-Jan-2005 4 2 1 01-Feb-2005 5 2 2 08-Feb-2005 6 3 1 03-Feb-2005 7 3 2 08-Feb-2005 Produce a report showing the...

Database Documentation - Not quite sure this is the right place for this, forgive me if I have it wrong. :blush: To rapidly document...


SQL Server 2014 : Administration - SQL Server 2014

A problem of concurrency on a small table - Hi all, i have a problem on an application. Details: Table AAA, about 500 records, not growing Many users (about 100) make a read...


SQL Server 2014 : Development - SQL Server 2014

Simple CLR request - I'm trying to create what I believe should be a very simple Table Valued Function CLR. Here's a T-SQL version...


SQL Server 2012 : SQL 2012 - General

Unable to delete from the table, takes forever - All, I have a query I am running to delete some records from the table but not able to. I...

SQL Server Latches and indication of performance issues - Hello all, I have received a request from customer "Performance is related to latency and lag time and virtual server not...

Replicas, indexes and different SQL versions - Hi all We're upgrading on of our servers from SQL2005 to SQL2012. On the 2005 box, we have mirroring set up to...


SQL Server 2008 : SQL Server 2008 - General

How to use a table value function that splits a string - I have a TVF that takes two parameters, string and delimter but, I don't know how to pass the field...

SSIS derived column transformation failing on converting Blank rows from excel while converting the column from string to int - Hi, I have flat file source from which data is imported to a Sql table.The target column is int and input...

High Latch Waits/Sec - Hi, One of my Servers running on SQL Server 2008 R2 , while monitoring perfmon I can see high values for latch...


Reporting Services : Reporting Services

Connecting to mof in command prompt for Report Configuration - Hi, Whenever I tried to connect to Program Files (x86) using Command prompt, it keeps saying it is not recognized. How...

Trying to get SSRS 2005 reports to work on a user's machine - We've been replacing or upgrading users' machines from Windows XP to Windows 7. After doing that one of the users...


Programming : General

What is the best to remove xp_cmdshell calls from t-sql code - I'm maintaining large t-sql based application. It has a lot of usages of bcp called through xp_cmdshell. It is problematic, because...


Data Warehousing : Strategies and Ideas

Query Question for New Guy - I have a question I am hoping that the members here can help me with. I have little experience but...


Data Warehousing : Analysis Services

Multidimensional vs Tabular - Hey, I'm completely new to SSAS and doing some research whilst working through tutorials to build my first analysis database. One thing...


SQL Server 2005 : Administering

deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. - [b]Message Executed as user: NT AUTHORITY\SYSTEM. Transaction (Process ID 68) was deadlocked on lock | communication buffer resources with another process and...


SQL Server 2005 : SQL Server 2005 General Discussion

Getting "Syntax error in TextHeader of StoredProcedure" error - I'm tried to edit one of our stored procedures in SSMS. When I attempt to open it, I get the...


SQL Server 2005 : T-SQL (SS2K5)

Temp Table 'vs' Table Variable 'vs' CTE. - Hi All, I wants to clear my concept about Temp Table, Table Variable & Common Table Expression Concept. Can anybody please clear me...


Career : Presentations and Speaking

Potential presentation idea: SQL Server for absolute beginners - So, I took today off from work to prepare and travel to [url=http://www.sqlsaturday.com/517/eventhome.aspx]SQL Saturday #517[/url], and something occurred to me...

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 ©2015 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com