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

DNA for Data Storage

In all my years of working with data, there's one think I've learned: it always grow. Over the years, I've gone from having to store data in these sizes:

  • A few KB on cassette tapes as a middle school kid
  • Using 360k floppies to 720k for programming, then 1.44MB to 100MB ZIP drives to 600MB CDs to 4GB DVDs
  • 10MB HDDs that grew quickly to be GBs and currently are TB sized in my desktop
  • A flip phone that could handle dozens of contacts with a SIM card to MBs of data in a T-Mobile G1 to a 64GB phone today

In that time, I've often filled up many of those devices and needed more space. I am looking forward to seeing capacities grow again. My 64GB phone is full of pictures and video, and I need to manage the space periodically. The same thing for the 500GB in my laptop and the 2TB on my desktop. I need to add storage, and archive off some older information, but I certainly don't want to lose any data, especially my pictures. Those might be the most valuable bits I have.

I am alternately disappointed and amazed by storage technology advances. Capacities have grown tremendously, but speed and latency have had fits and starts. SSDs were a great improvement, and I do look forward to the newer 3D flash for laptops and high performance servers. I am glad there are these large capacity HDDs, but maybe there's a better way to store lots of data for the long term.

I ran cross this piece the shows the University of Washington and Microsoft working together to store data in synthetic DNA. They managed to store 200MB, which breaks the old record of 22MB. If they can improve the technology and make a commercial version, the theoretical storage could hold 1EB in a cubic inch. Even if we got 10% of this, 100TB in a little cube would be amazing. You can read more about the project at Microsoft Research.

I have no idea what the write and read latencies are, but this could provide a nice backup for lots of data that we want to keep around, especially for images, video, perhaps even old auditing or other data that needs cheap, reliable storage that lasts years. I know I'd like to have this capability as my collection of data continues to grow, sometimes at amazing rates. I just hope this is cheap enough for general use, since as a data guy, I'd likely want 3 copies of everything. You know, just in case.

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.5MB) 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 Monitor

New SQL Monitor Reporting Module

SQL Monitor now includes a new Reporting module. It allows you to create customized reports, combining the individual server performance metrics available in SQL Monitor with summary information on your entire SQL Server estate. These reports can then be exported to pdf and emailed to you on a scheduled basis. Download SQL Monitor now and get a 14 day free trial.

SQL Prompt

Could your SQL coding be more efficient?

Data Platform MVPs and SQL Server experts share their tips on how to standardize formatting whilst stripping out the repetition of coding with SQL Prompt. Over these 20 short videos we will help you write better, shareable SQL faster. Check out the tips.

Featured Contents

 

Stairway to U-SQL Level 14: Local U-SQL Scalar Functions with C#

Mike McQuillan from SQLServerCentral.com

Learn how U-SQL leverages C# to support flexible scalar functions in your scripts. More »


 

Free eBook: Understanding SQL Server Concurrency

Press Release from Redgate

When you can’t get to your data because another application has it locked, a thorough knowledge of SQL Server concurrency will give you the confidence to decide what to do. More »


 

Tempdb size resets after a SQL Server service restart

Additional Articles from MSSQLTips.com

Have you ever checked the size of the SQL Server tempdb after restarting SQL Server to find that it's reset? Simon Liew explains this behaviour. More »


 

Validate Integer and Decimal Values in SQL Server

Additional Articles from MSSQLTips.com

Bhavesh Patel shows how to validate specific use-cases for integer and decimal values in SQL Server. More »


 

From the SQLServerCentral Blogs - Fischer’s Exact Test – with T-SQL and R

Mala Mahadevan from SQLServerCentral Blogs

This post is a long overdue second part to the post on Chi Square Test that I did a few months... More »

Question of the Day

Today's Question (by Steve Jones):

How can I determine my current directory in R?

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.

ADVERTISEMENT

Exam Ref 70-761 Querying Data with Transact-SQL

Direct from Microsoft, this Exam Ref is the official study guide for the new Microsoft 70-761 Querying Data with Transact-SQL certification exam, the first of two exams required for MCSA: SQL 2016 Database Development certification. Get your copy today from Amazon.

Yesterday's Question of the Day

Yesterday's Question (by Stanley Kapfunde):

Which of the following is not a valid system database in SQL Server 2014?

Answer: replication

Explanation:

The correct answer is:F,replication.

In addition to the four system databases model,msdb,master and tempdb, SQL Server 2014 has two additional databases that are resource and distribution. There is no system database called replication.

Ref: System Databases - click here

SQL Server 2014 Development Essentials by Basit A. Masood-Al-Farooq page 53.


» Discuss this question and answer on the forums

Featured Script

Function to Round or Truncate DateTime

Shane Clarke from SQLServerCentral.com

This Function is used to round to Second, Minute, Hour or Day or to Truncate to Second, Minute, Hour, Day, Month or Year and return Datetime Value

To Use Ths function use the following syntax

SELECT [dbo].[fn_TruncateOrRoundDatetime] ( <@dt, datetime,> ,<@Datepart, varchar(10),> ,<@TruncateOrRound, varchar(10),>)

eg: SELECT 'Round to Closest Hour',[dbo].[fn_TruncateOrRoundDatetime] ('2017-05-23 14:53:45.607' ,'hour' ,'round')

Returns:  "2017-05-23 15:00:00.000"

Valid values for @Datepart:

  Seconds = 'seconds', 'ss','s'

  Minutes = 'minute','mi','n'

  Hours = 'hour','hh','h'

  Day = 'day','dd','d'

  Month = 'month',mm','m'

  Year = 'year','yyyy','y'

Valid values for @TruncateOrRound:

"Truncate"

"Round"

More samples:

------ Use in conjunction with other tables / views

SELECT [dbo].[fn_TruncateOrRoundDatetime] (crdate ,'Month' ,'round') MonthCreated, * from sysobjects

------ Round to Closest Second

SELECT 'Round to Closest Second',[dbo].[fn_TruncateOrRoundDatetime] ('2017-05-23 14:53:45.607' ,'second' ,'round')

------ Truncate to Seconds

SELECT 'Truncate to Second',[dbo].[fn_TruncateOrRoundDatetime] ('2017-05-23 14:53:45.607' ,'second' ,'truncate')

------ Round to Closest Minute

SELECT 'Round to Closest Minute',[dbo].[fn_TruncateOrRoundDatetime] ('2017-05-23 14:53:45.607' ,'minute' ,'round')

------ Truncate to Minutes

SELECT 'Truncate to Minute',[dbo].[fn_TruncateOrRoundDatetime] ('2017-05-23 14:53:45.607' ,'minute' ,'truncate')

------ Round to Closest Hour

SELECT 'Round to Closest Hour',[dbo].[fn_TruncateOrRoundDatetime] ('2017-05-23 14:53:45.607' ,'hour' ,'round')

------ Truncate to Hours

SELECT 'Truncate to Hour',[dbo].[fn_TruncateOrRoundDatetime] ('2017-05-23 14:53:45.607' ,'hour' ,'truncate')

------ Round to Closest Days

SELECT 'Round to Closest Day',[dbo].[fn_TruncateOrRoundDatetime] ('2017-05-23 14:53:45.607' ,'day' ,'round')

------ Truncate to Day

SELECT 'Truncate to Day',[dbo].[fn_TruncateOrRoundDatetime] ('2017-05-23 14:53:45.607' ,'day' ,'truncate')

------ Truncate to Month

SELECT 'Truncate to Month',[dbo].[fn_TruncateOrRoundDatetime] ('2017-05-23 14:53:45.607' ,'month' ,'truncate')

------ Truncate to Year

SELECT 'Truncate to Year',[dbo].[fn_TruncateOrRoundDatetime] ('2017-05-23 14:53:45.607' ,'year' ,'truncate

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

Dynamic script to backup many DBs and restore them on different instance - Hello All, I need to move about 50 DBs from my instance to anoter instance. Can you please share with me a...


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

Need replacement t-sql to obtain SHOWCONTIG values - This older query still executes fine as it refers to the "compatibility view" called sysindexes --- but I'd like to upgrade...

Performance degraded after migrating to 2016 from 2012 - I migrated my SQL Server database from 2012 to 2016 and I can see 2016 database performance is degraded instead...


SQL Server 2014 : Administration - SQL Server 2014

SQL 2014 & NICs - I just purchased a Dell PE730 which has 4 embedded NICs.  I teamed the first two NICs, and I was...

Changing IP Addresses of AlwaysOn Group - We have 2 nodes in an AlwaysOn group. SQL2014 Enterprise. We need to change the IP addresses of the nodes, the...

Malicious Mischief - How to identify the perpetrator? - Recently, there's been a spate of malicious mischief one of my employer's key servers. > A database created, the owner falsified. >...


SQL Server 2014 : Development - SQL Server 2014

Create a trigger after insert to encrypt columns in a table - Hello All, I'm trying to create a trigger that will encrypt a column when an insert operation is done on table....

UNION returns null values - I have a Query which works fine but when I convert that query into a dynamic query, I get NULL...


SQL Server 2012 : SQL 2012 - General

Script to Determine SQL Server Version and if the patch level is still in support for large estate - Hi, I am wondering does anybody have a script to determine the SQL Server Version and whether or not it is...

Stopping remote dtsx from connecting to SQL - HI, Does anyone know if there is a way to stop users from running dtsx packages from connecting to SQL 2012?...

How to create backup using Mdf and ldf files to another location - Hi, I took backup  of  mdf and ldf  file in another location. But when i try to attach the files using the...

Problem with net framework 3.5 installing sql 2012 server - Hi to all. During an installation of SQL 2012 server I had a problem with feature .net 3.5. I tried to install...


SQL Server 2012 : SQL Server 2012 - T-SQL

Need some help with some "XML Hell" please. - I'm working on an expansion of an incredible idea by Fabiano Amorimthat (https://blogfabiano.com/2012/07/03/statistics-used-in-a-cached-query-plan/) which uses Trace Flag 8666 to add...

Adding conditional logic, help wanted - Hi all, I want to add a couple of features to my code,  to add a flag column and then add...


SQL Server 2008 : SQL Server 2008 - General

Bulk insert statement cannto open file on the share - I am trying to execute a bulk insert statement in SQL management studio. BULK INSERT PSStudentAccess FROM '\\servername\pj_sharepoint\external\autosend\myfile.txt" WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '' ) Cannot bulk load because...


SQL Server 2008 : T-SQL (SS2K8)

UPDATE Duplicates Except for One Record in a Table - Hi All, I need to set a field in a product table for a bunch of products. We have some duplicated...


SQL Server 2008 : SQL Server Newbies

Adding Minutes to DATETIME2 - Hi guys. I'm having some problems compiling a scalar function using the DATETIME2 datatype. CREATE FUNCTION func_IncDatetime2 ( @toIncrease datetime ) RETURNS datetime AS BEGIN DECLARE...


SQL Server 2008 : SQL Server 2008 Performance Tuning

Performance issue due to index - Hi All, Yesterday on a production environment we got complaints about very bad performance. I logged in and found out that all...


Data Warehousing : Integration Services

Time dimension key as HHMM (text) or HMM (int) - Hi All Is it worth the extra time to cast my time key from HHMM text to HMM int? I have read...


SQL Server 2005 : SQL Server 2005 Integration Services

ODBC Exception running package as SQL Server Agent job - Help! I have an SSIS package with multiple data flow tasks. Each of these uses an ODBC data provider. When I run...

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