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

Held Hostage by the Database

Your database platform will constrain and limit the flexibility you have in evolving your software. It doesn't matter which platform you choose, which type of database, or even the format for your data. At some point, you will be dealing with legacy data in some legacy schema or structure, and your development, and certainly deployment, will be slowed or impacted. Face it, the need to maintain state for your data is an impediment in a relational system. In a NoSQL or other store, the need to maintain code in your application that can interpret your data might be the issue over time.

That's not to imply this need to maintain state has to slow your development. On the contrary, there are many companies that find themselves moving quickly, able to make database changes on a weekly, or even daily, basis. There are multiple tricks and techniques for managing change, but ultimately the real secret is having a process that computers can follow and your developers adhere to.

In other words, having some automation.

Certainly you need to program the automation, or use tools like those from my employer, Redgate Software, but it doesn't matter which what process you use. The process does need to be flexible because it will change over time. I can almost guarantee that the way in which you need to deploy code to the database in your environment will change over time. It has to as the needs and requirements of your business change.

This means the way in which your developers need to build, test, and package changes will need to grow and evolve as well. While every developer and sysadmin needs to work within the process, the process does also need to be flexible as needs change. That isn't to imply that your process should change every week, or for every deployment, but it will need to do so periodically, and hopefully, rarely.

There are techniques to make deploying database changes easier on the developer and system administrator, but there are no magic techniques. All the tools I've encountered, including those from Redgate, do the same types of things you'd do manually. They just save you time and stress by helping you get set up and easily maintain your deployment tasks over time.

Whether you use tools or not, please don't allow the database to hold back your software development. Learn new ways to alter your database. Learn the ways to make changes to large tables. Learn how to avoid downtime. Just learn to design database changes in a better way and then automate the deployment of those changes.

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 ( 3.6MB) podcast or subscribe to the feed at iTunes and Libsyn. 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.

ADVERTISEMENT
SQL Clone

SQL Clone – create database copies fast!

Create copies of production databases and SQL backups in seconds and save up to 99% of disk space using SQL Clone. Redgate’s new tool removes much of the time and resource needed to create and manage database copies, allowing teams to work on local environments to develop, test and diagnose issues faster. Join the beta.

SQL Compare

New Redgate SQL Compare 12 has landed!

SQL Compare 12 has landed with a brand new user interface, support for SQL Server 2016, and a wealth of fixes and improvements. Check out this blog post from Redgate's Carly Meichen to hear more about what’s new, why the team have built it, and how. Read now.

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.

Featured Contents

 

Stairway to U-SQL Level 11: Stored Procedures

Mike McQuillan from SQLServerCentral.com

To finish off our look at the core database objects, we inspect how the venerable stored procedure works in U-SQL. More »


 

SSC 2016 User Survey and Competition

What do you want to see more of on SQL Server Central? Anything you think we should get rid of? Let us know in this 17-question user survey, and at the end you can choose to be entered into a draw to win a $100 Amazon gift card. Thanks to everyone who's already answered, we greatly appreciate the feedback! 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 »


 

More Power BI to your Elbow

Additional Articles from SimpleTalk

Power BI Desktop continues to evolve. There have been many improvements to the reporting side that together make it easier to get from the data to the visualisation as quickly as possible. You can now create line charts that let users drill down into hierarchical data. There are now ways of adding dynamic reference lines to a visualization that provide users with relevant reference points. Robert Sheldon demonstrates how to combine these features to great effect. More »


 

From the SQLServerCentral Blogs - Enabling Cortana for dbareports PowerBi

Rob Sewell from SQLServerCentral Blogs

Last week at the Birmingham user group I gave a presentation about PowerShell and SQL Server It was a very packed... More »

Question of the Day

Today's Question (by Sergiy):

I create a temp table and a table variable with identical structure. Then I populate them within a transaction:

 DECLARE @Table TABLE ( col1 VARCHAR(50) ) CREATE TABLE #Table ( col1 VARCHAR(50) ) BEGIN TRANSACTION INSERT INTO @Table ( col1 ) SELECT 'Value' INSERT INTO #Table ( col1 ) SELECT 'Value' ROLLBACK TRANSACTION

What would be content of both tables after rolling back the transaction?

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

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

Expert T-SQL Window Functions in SQL Server

Expert T-SQL Window Functions in SQL Server takes you from any level of knowledge of windowing functions and turns you into an expert who can use these powerful functions to solve many T-SQL queries. Replace slow cursors and self-joins with queries that are easy to write and fantastically better performing, all through the magic of window functions. Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Junior Galvão - MVP):

What will be the result presented after the processing of the query below?

 SELECT 0 UNION SELECT 1 UNION SELECT 2 UNION SELECT NULL UNION ALL SELECT NULL;

Answer: Null,0,1,2,Null

Explanation:

Answer: The answer is: 0, 1, 2, Null, Null

Explanation: Combines the results of two or more queries into a single result set that includes all the rows that belong to all queries in the union.

The UNION operation is different from combine columns from any tables. Specifies that multiple result sets are to be combined and returned as a single result set.

The Union All, incorporates all rows into the results. This includes duplicates. If not specified, duplicate rows are removed.

References: Union - https://msdn.microsoft.com/en-us/library/ms180026.aspx


» Discuss this question and answer on the forums

Featured Script

Create Database Snapshot Dynamically

Joe McDermott from SQLServerCentral.com

This script generates a snapshot of your database with two variable inputs; database name, and snapshot name appended.

The snapshot will be named @SourceDatabase + '_' + @SnapshotAppend

Use the @Debug variable to print the output first for review.

The script will error if the database or the DATA file path doesn't exist.

Tested on SQL Server 2012

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 - Development and T-SQL

Help with a query runs forever but returns nothing. - Ok the WHERE clause is a Unique index. If I run the SELECT / FROM / JOIN's I get data returned no...

TSQL Formatting tool? - Can someone recommend a (free?) tool to format TSQL Code. Ideally, it should be something working in both SSMS and Visual...

Newbie here... Wishing to learn SQL and SSIS/SSRS/SSAS - Hi all, A newbie here wishing to ask for advice on Microsoft Business Intelligence. Hoping this is the right forum to...


SQL Server 2014 : Administration - SQL Server 2014

Enterprise Edition DB not growing despite available disk space - I got the, "Could not allocate space for object," error on one of our larger databases while it was being...

MSDB jobs in DB mirroring and AlwaysOn availability group - Hi all, As we have already know -> system databases are not mirrored nor replicated in both mirroring and alwayson availability...


SQL Server 2014 : Development - SQL Server 2014

Query - I have a truantday table that has students who has absent, each row is one student, one truant day starting...

Inline table-valued function to list numbers - Hi everyone, I'm a newbie and recently I've come across an excercise quite complex (for me). In short, these are the...

check if record exists then update else insert - i have to check if record exists in table , if there is record then update else insert. Stg_table Id seq name company 1...


SQL Server 2012 : SQL 2012 - General

Tables that start with "DIM" missing in AdventureWorksDatabase2012 - Please help - Please see attached. I am trying to do a tutorial in SSAS and I cant find any of the tables...

Is it possible to limit Maximum Workspace Memory or the portion of it allocated to a single query? - Hi all, We have an issue whereby over-complex filters within queries generated by a report engine are resulting in wildly overestimated...

Intellisense on some databases, not others?? - I have an issue in SSMS that I can't figure out. In SSMS, connected to an SQL Server 2012 instance (Enterprise...


SQL Server 2012 : SQL Server 2012 - T-SQL

Replace uppercase words with bold - I need to replace in given string all uppercase strings longer than two characters with lowercase and set html bold...


SQL Server 2008 : T-SQL (SS2K8)

how to remove characters char(0) to char(31) - Hi there, Sometimes customers add data with unwanted characters in the ascii range 0 to 31. How do I remove them?...


SQL Server 2008 : Working with Oracle

Difference between MySQL and Oracle? What's better? - Hello all! I wanna studying Oracle after a long time working with MySQl.. Is really really difficult to work with Oracle? Does oracle...


SQL Server 2008 : SQL Server Newbies

Insert into table - Hi, I would appreciate some help please. I want to do a select distinct only on Col2 and add rows for those. INSERT...

SQL Query/JOB Error - Hi all, Need advise for my error Executed as user: NT AUTHORITY\NETWORK SERVICE. Arithmetic overflow error converting IDENTITY to data type int....


SQL Server 2005 : SQL Server 2005 General Discussion

Replication between SQL 2005 and DB2 - I am trying to setup transactional replication between SQL 2005 and DB2 on MVS platform. I am using Microsoft's OLE...


SQL Server 2005 : SQL Server 2005 Integration Services

How can automate report from sqlserver to be sent on email everyday. - Hello! Everyday i run a querry in sqlserver 2008 to get a report to sent to my boss, but i...

SSIS : Cannot open the datafile - Hi, If I run the package from BIDS, it works fine. If I run the package inside Management Studio it works...


Career : Presentations and Speaking

Potential presentation idea: The magic of checklists - This morning, I was sitting down with one of my co-workers, going through a procedure. He was referring to a...

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