| A community of more than 1,600,000 database professionals and growing |
| | Avoiding Development Taxes When I first worked in an environment where multiple developers needed to release software, I found too many rules and constraints for smooth development. The process was developed by one person, or for one application, and somehow expanded to encompass all work being done in the organization. It was if we weren't trying to think about our creative work as developers and DBAs, and instead viewed our systems composed of widgets built in a factory, each one a copy of the others, perhaps just a bit bigger or smaller. We used the same set of rules for the mission critical finance program as we did for the department vacation scheduling application. While working inside an overreaching command-and-control mentality, the idea of moving faster or releasing software more often was seen as really dangerous. Two decades of Agile methodologies, and the rise of DevOps have started to change this for many companies. Each year the State of DevOps report seems to show more and more organizations finding ways to build better software, often by having their operations people embrace the concepts and processes used by software developers as a way of building and managing their environments. Databases still lag behind, and as Donovan Brown says in this piece, if you're not automating the back-end work of code deployments to the database, you're still "faking" some of your DevOps process. Databases must maintain the state of data, even as transactions take place around code changes. Ensuring that we properly handle those data changes is a challenge. However, by treating the database changes as similarly as possible to application changes, we can minimize risk and learn database development techniques that help us push forward without being reckless. Tools have gotten better for database development. Microsoft has some tools for SQL Server, and various other vendors such as Redgate have others. Good tools are essential, but each new one adds some complexity to the environment. That's one reason why having a minimal number of tools and platforms reduces the friction of getting things done. I see this as a big reason SQL Server on Linux might take off. Plenty of companies don't want Windows in their infrastructure when most of their systems are on Linux. Not that Windows is hard, but consistency makes everything easier for a staff. This is the same reason why I'd say that it's worth sticking with a database platform or two and not experimenting with each new type of system that comes out. If your staff knows SQL Server, then adding in MongoDB or Cassandra means there's a learning curve, or a "tax" as the piece notes, to getting things done. This same tax gets paid with each new vendor, platform, language, or technology you take on. Database work is hard, and once your staff gets good at building and deploying changes, you want to take advantage of their knowledge. For companies that have solid development and deployment practices, stick with the things that work well. However, if you have staff that turns over regularly and don't have a mature process, you can reduce the "tax" you pay for database development. There are companies that have paid some of that integration tax, that learning effort, and they've got tooling to help you build code better and faster. Just as I wouldn't want to code my own build server, I don't want to code my own database deployment tools. I could, but I'd rather spend my time solving problems and use the tooling that someone else has built to make my job easier, and provide a consistent coding experience for my developers. Steve Jones from SQLServerCentral.comJoin the debate, and respond to today's editorial on the forums |
| The Voice of the DBA Podcast Listen to the MP3 Audio ( 5MB) podcast or subscribe to the feed at iTunes and Libsyn. 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 | | Write, format, and refactor SQL effortlessly 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 tab coloring you’ll never deploy to the wrong environment again. Download your free trial |
| | Register now for SQL in the City Streamed Redgate’s popular SQL in the City Streamed virtual event takes place again this December. Wherever you are, tune in on Wednesday December 13 to watch some of the best-known speakers from the database world present the latest technologies and tools from Redgate. Register free now |
|
|
|
| | | John F. Tamburo from SQLServerCentral.com See how the ITIL Framework's Asset Management standards make the DBA's job easier. Use the CMDB and DML to keep your data assets under tight control. More » |
| In the last few years, Black Friday and Cyber Monday have become synonymous with both getting a good bargain and causing retail pandemonium. So how can you prepare your data platform for the increase in traffic? More » |
| Additional Articles from SimpleTalk SQL Server produces some great features, but it would be impossible to get them spot-on target every time. We are now quietly advised to use caution about using some of them, such as AutoShrink or the Index Advisor. Others, like the database diagramming tool, almost seem to have been quietly abandoned. Robert Sheldon investigates. More » |
| Devin Knight from SQLServerCentral Blogs In this module you will learn how to use the Image Timeline Custom Visual. The Image Timeline is a great... More » |
| Anthony Nocentino from SQLServerCentral Blogs There was a question this morning on the SQL Server Community Slack channel from SvenLowry about how to launch SQL... More » |
|
|
| | Today's Question (by Thomas Franz): What will the following query return: SELECT CHECKSUM(x) chk_x, CHECKSUM(y) chk_y, CHECKSUM(z) chk_z FROM (VALUES (CAST(NULL AS INT), CAST(NULL AS VARCHAR(10)), CAST(NULL AS DATETIME)) ) sub (x, y, z) |
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: checksum. 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 | Automate your workload and manage more databases and instances with greater ease and efficiency by combining metadata-driven automation with powerful tools like PowerShell and SQL Server Agent. Automate your new instance-builds and use monitoring to drive ongoing automation, with the help of an inventory database and a management data warehouse. Get your copy from Amazon today. | | |
|
|
|
|
|
| Yesterday's Question of the Day |
| Yesterday's Question (by J. Drew Allen): What results do you get when you run the following query? DECLARE @holidays TABLE( holiday DATE, holidayDatetime AS CAST(holiday as datetime) ) INSERT @holidays VALUES('2017-01-02'), ( '2017-01-16'), ( '2017-05-29'), ( '2017-07-04'), ( '2017-09-04'), ( '2017-11-23'), ( '2017-11-24'), ( '2017-12-25') SELECT CAST(MAX(CAST(holiday AS BINARY(6))) AS DATE), CAST(MAX(CAST(holidayDatetime AS BINARY(6))) AS DATETIME) FROM @holidays Answer: 2017-05-29, 2017-12-25 00:00:00.000 Explanation: DATETIME values are stored with the least significant byte on the right whereas DATE values are stored with the least significant byte on the left. This can be seen by running the following query: WITH Dates AS ( SELECT DATEADD(DAY, ROW_NUMBER() OVER(ORDER BY @@version), CAST('2016-12-31' AS DATE)) AS dt FROM ( VALUES(1), (1), (1), (1), (1), (1), (1), (1), (1), (1) ) t(n) ) SELECT dt, CAST(dt AS BINARY(3)), CAST(CAST(dt AS DATETIME) AS BINARY(6)) FROM Dates The max function uses the leftmost byte as the least significant, so the value returned by the max function will be different if the data type is date vs binary. I ran into this issue when the minimum date in my sample turned out to be the maximum when converted to binary. I couldn't figure out why it was always using the minimum. » Discuss this question and answer on the forums |
|
|
| | Mike Tanner from SQLServerCentral.com SQL Server has DateAdd and DateDiff functions, but lacks a DateTrunc function to truncate a date to some time interval (or multiple thereof). Using DateTrunc is a convenient way of e.g. listing sales by week or month. Whilst the SQL fragment to do the truncation is simple, if subtle, I find I can never remember the syntax and always need to look it up. The code supplied provides a simple and easy-to-remember function for doing this. An example of use might be as follows, to return a count of jobs by quarter: select dbo.DateTrunc('q', JobDate, 1) as qtr, count(*) as cnt from Job group by dbo.DateTrunc('q', JobDate, 1) order by 1 Whilst, as a function, it is slower than the equivalent code [dateadd(qq, datediff(qq, 0, JobDate) , 0) in this case] it is fine for ad-hoc use on all but the largest tables. And it provides a convenient place to store the definitions to save looking it up on the web each time even if you usually use the explicit variant. The final parameter, @Num, is useful if, for example, you wanted the number of calls for every 5 minutes or 15 seconds or whatever. It works and is tested in SQL Server 2005. The stored procedure is based on code in the following article, click here, but with a tweak for the seconds calculation (where there is a danger of overflow). 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. Amount of RAM in server - Just curious - how much RAM do you have in your SQL server? Why dbid is 1 for master, 2 for tempdb, 3 for model and 4 for msdb? - Hi Is there any reason why the below DBid order is maintained? Master - 1 TempDB - 2 Model - 3 MSDB - 4 Reporting service Edition for 2017 - I understand reporting service is a separate download for SQL 2017. I go to the download site there is only... Date - Hi, I would like to add new variable(Current Complete Week -1) to the SP for below condition. Current Complete Week -1: Intention is... Date Ranges - Simple, but seemingly impossible - Hi all, I've done a lot of research and tried so many things for around a week. I'm desperate at this... Database Corruption - Hi All, I hope that I could had some Help concern to a issue that currently I am facing. So I have... A different end table by parameter - Hi guys, I have loads of stored procs that gather data but need an option to be inserted into different tables. Basically... Add only changed or new rows to table - Hi I am a DBA who does a small bit of SSIS / TSQL development and have been given a project... Migration of SQL Logins - I am working on migration project from 2005 to 2012. We have many SQL logins in current server which i... Combine rows by applying grouping and data validation - Hello All, I have master data, based on that i am trying to prepare query in such way that rows can... Create a white space column in SQL 2012 - Hello, I am working on a project that requires I insert white space columns in a file that will be exported... Force execution plan in a view - I'm having an issue right now. We removed an identity column that is mostly irrelevant to a table. However, this... Trigger table read? - Is there a trigger that is activated when a table/row is read? Updating stats make things worse - We have an older 2008 R2 Standard server that has been migrated to SQL 2012 Enterprise. There was very little... SQL server restart - Dear Experts, Where does SQL server store the contents of the memory buffer when a server is restarted. From where does... Index Key Re-Ordering - Dear Experts, Please advise when does the re-ordering of a index pages occur when a key value is updated. Does it... Log file R drive- What is consuming it - Good Morning Experts. We have a SQL Server instance. All the user databases log files are on R drive. We have... Suspect production database - Good Morning Experts, We have a production database that has gone into suspect state. What are the step-by-step process to fix... Excel drivers for ssis package - Hi, I am trying to connect to excel source but its throwing connection error. After googling it suggested my system might... Query taking long time - Hi, The below query is taking around 1000 Seconds. SELECT ar.MOVE_QTY,ar.DM12,ar.AL_OR,ar.OR_CODE,ar.CAI_CODE,ar.CAI_DESCRIPTION,ar.CST_CODE,ar.AL_NO AL_NO,ar.OPEN_QTY,ar.WH_CODE,ar.ETA_DATE, ar.CATEGORY,ar.AL_DATE,ar.OD_CODE, ar.SHIPTO_CODE,ar.AL_LINE AL_LINE,ar.ORIG_QTY,ar.CNCL_QTY,b.SHIP_QTY SHIP_QTY,ar.LOCAL_CODE,0 AL_TXT_LINE,b.AVIEXP_NO, b.UC_NUMBER, b.AVIEXP_DAT |
|
| This email has been sent to [email protected]. To be removed from this list, please click here. If you have any problems leaving the list, please contact the [email protected]. | 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 ©2017 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. Contact: [email protected] |
|
|