A community of more than 1,600,000 database professionals and growing
The Voice of the DBA
Who's Got Your Data?
The headlines lately have been filled with the plight of Edward Snowden, along with his disclosures on how the US National Security Administration (NSA) has been gathering, cataloging, and examining all sorts of data about people in the world. It's not just terrorists, criminals, or anyone suspected of illicit activities, but also many ordinary people that may not feel they should have been subjected to this level of surveillance. Whether you think this was a proper way to disclose this information or not, there's a separate issue here.
We are producing a tremendous amount of data about ourselves all the time. There are so many ways in which companies can gather data points about us, often with logging activity that we might not find intrusive. Our houses produce logs of electrical activity along with the various types of services we might use (water, trash, etc.). We use cell phones, whose locations and usage are recorded, and we often use on line services for mail, research, entertainment, and more that all produce logs of our activities. Purchases on line are stored, and purchases off line might be stored if you use any type of loyalty card. I can imagine it not being long before any card purchase can be linked to the actual items themselves, regardless of whether you want this to occur.
We can add in any services we use that store data in the cloud, from physical activity to medical information to even your location from status updates. While much of this data is stored separately, and not necessarily aggregated, that might not be the case in the future. The government could potentially request this data, which is unnerving to me, but what is more disconcerting is the idea that businesses might engage in complex deals to share much, or all, of your data without you knowing about it. This could be under the guise of providing better services, which makes sense, but that's not what concerns me.
What concerns me is the lack of care that so many companies take with our data. It's lots constantly, and the more data that might be shared between companies, and need to be transformed and loaded into new data warehouses, the more people that will touch this data. And the more developers that will have copies of it on their laptops as they build new applications. It's scary to think about the lack of control we have, and now many mistakes will be made in the future.
I wish I had a good suggestion on how to improve the situation, but I don't. However I do think disk encryption, for all machines that touch data, is a good place to start.
Today's 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. You can also follow Steve Jones on Twitter to find links and database related items and announcements.
‘10 Tips for Efficient Disaster Recovery’
Learn Steve Jones’ disaster recovery lessons, and be better prepared for future disasters, big or small. Read now.
Compare and sync databases with SQL Compare
“SQL Compare is fast, extremely easy to use, full-featured and affordable. I wouldn't bother messing around with anything else.” Adam Machanic, SQL Server MVP. Download a 14-day free trial.
Before you start to think about your database schema or tables, you need to consider your data: the type of data it is, the scale you use for values. It needs to be unique, precise and unambiguous. Then you need to name it in such a way that it can be generally understood. Joe Celko explains... More »
If you have lost the password for sa account or does not have any administrative account and you are locked... More »
Question of the Day
Today's Question (by Kathiravan P):
What happens when this code is executed?
CREATE TABLE #MainTable
INSERT INTO #MainTable SELECT 1, 1.23
INSERT INTO #MainTable SELECT 2, 2.45
INSERT INTO #MainTable SELECT 3, 3
INSERT INTO #MainTable SELECT 4, 4.3
-- Statement 1
SELECT * FROM #MainTable WHERE Val LIKE '%'
-- Statement 2
SELECT * FROM #MainTable WHERE Val = '%'
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: like.
We'd love to give you credit for your own question and answer.
To submit a QOD, simply log in to the
SQL Server 2012 Query Performance Tuning leads you through understanding the causes of poor performance, how to identify them, and how to fix them. You’ll learn to be proactive in establishing performance baselines using tools like Performance Monitor and Extended Events. You’ll learn to recognize bottlenecks and defuse them before the phone rings. You’ll learn some quick solutions too, but emphasis is on designing for performance and getting it right, and upon heading off trouble before it occurs. Delight your users. Silence that ringing phone. Put the principles and lessons from SQL Server 2012 Query Performance Tuning into practice today.
Explanation: If the left and right expressions have different integer data types (for example, the left expression is SMALLINT and the right expression is INT), the argument of the smaller data type is converted to the larger data type. In this case, the TINYINT expression is converted to an INT.
If you've designed your SQL code intelligently, and implemented a sensible indexing strategy, there's a good chance your queries will "fly", when tested in isolation. In the real world, however, where multiple processes can access the same data at the same time, SQL Server often has to make one process wait, sacrificing concurrency and performance, in order that in order that all can succeed, without destroying data integrity. Transactions are at the heart of concurrency. I explain their ACID properties, the transaction isolation levels that dictate the acceptable behaviors when multiple transactions access the same data simultaneously, and SQL Server's optimistic and pessimistic models for mediating concurrent access. Pessimistic concurrency, SQL Server's default, uses locks to avoid concurrency problems.
Use this function to break a full file name into four parts: a drive, a path, a filename, and an extension. It handles any missing parts. The function returns a table with the four parts as columns so you can use "cross apply" if needed.
"D:" as drive
"\MyDir\MySubDir\" as the path
"MyFile" as filename
"MyExt" as extension
OR try this:
SELECT physical_name, x.*
FROM sys.database_files df
cross apply (select * from dbo.FileNameSplitter(df.physical_name)) as x;
- alter procedure [dbo].[pocc]
create TABLE #TempEmployees
-- Insert result from the SP to temp table
INSERT INTO #TempEmployees
how to insert foreign key value in my table?
- Hai friends,
i ve two tables
create table users
users_id int primary key,
insert into users values('0001','Ram','ram@123','IT','programmer')
insert into users...
How to compate cross column values
I am having requirement for to check cross column values,
Below is the example table
col1 col2 col3 col4
1 2 1/7/2013 5/7/2013
1 2 8/7/2013 9/7/2013
1 2 9/7/2013 10/7/2013
1 2 11/7/2013 12/7/2013
Out put should be as below
col1 col2 col3 ...
Update Table with get-date
i want to update my table Field Date_Import=get-date -f (without time)
[Count_Import] int NULL,
[Count_Fault] int NULL,
[Date_Import] date NULL
$Command = $Connection.CreateCommand()
Header row is different than detail row
- Hello Folks,
I have a file with a header row that is different than all the other detail rows.
ABC 20130627 123
Access Query ported to SQL
- Here is the "inner" part of a query in Access.
UPDATE [Vehicle Detail] SET [Vehicle Detail].ReturnDate = #4/29/2013#, [Vehicle Detail].ReturnSource = 'ReturnProcess'
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.