Despite all the advances in software tools, there seem to be several enduring truths about software development. By understaning these 'laws', Ziv’s law, Humphrey’s Law and Conway’s Law for example, you can remove some of the mystery of the process. Al Noel discusses these and other laws that seem to apply generally to the art of programming. More »
Lets start discussing about this subject by closely looking at the term Redundancy. What is redundancy all about ?
Wikipedia defines redundancy as “In engineering, redundancy is the... More »
Editorial - Relying on Algorithms
We are increasingly living in a world that is affected by software (and the data it uses). I have to admit that I'm slightly worried about this as I look at the quality of software, the bugs, the lack of effective testing. It's not that companies don't perform a lot of testing; many do, but it seems that many developers, and even QA people, don't really know how to effectively test. This is especially true of testing for abnormal or unexpected situations. It there's one area of software development that seems woefully immature, it's testing.
However testing isn't the only problem. We might not like the way that software is designed, and used, to alter our world. As we become more dependent on software to accomplish tasks for us, we will run into new situations that the software may not have been designed to handle. This opinion piece on the ways in which software might alter our lives is both fascinating and scary. How do we want software to behave in unfamiliar situations? It's not an easy question to answer, and it's certainly not a question with a simple answer in many scenarios.
We learn to depend on systems when they work for us. Whether in business, government, or our personal lives, when a system works, we want to use it more. However that's not always the best long term solution. Humans adapt, and software, especially the systems using a constant stream of historical data for decisions, has flaws. More than a few of you might have encountered this type of situation with Netflix or Amazon recommendations when you have kids sharing your account.
In some sense I think that we not only need adaptive algorithms, that we can customize over time, but we also need to understand the data that flows through the algorithms. We need ways to remove some data from consideration by the software, when we find it is removing more value than it is adding.
create table #temptable1
insert into #temptable1
select name1,name2,zip, COALESCE(name1,name2,zip) AS name3
While executing the select statement, an error for a data type conversion is returned. Which row (numbered in insert order) gives the error?
By Chirag Patel
Think you know the answer? Click here, and find out if you are right.
This question is worth 2 points in this category: Coalesce. We keep track of your score to give you bragging rights against your peers.
We'd love to give you credit for your own question and answer. To submit a QOD, simply log in to Contribution Center.
Securing SQL Server
Written by Denny Cherry, a Microsoft MVP for the SQL Server product, a Microsoft Certified Master for SQL Server 2008, and one of the biggest names in SQL Server today, Securing SQL Server, Second Edition explores the potential attack vectors someone can use to break into your SQL Server database as well as how to protect your database from these attacks. In this book, you will learn how to properly secure your database from both internal and external threats using best practices and specific tricks the author uses in his role as an independent consultant while working on some of the largest and most complex SQL Server installations in the world. This edition includes new chapters on Analysis Services, Reporting Services, and Storage Area Network Security.
Using SQL Server 2012 or 2008R2, I create the following table
CREATE TABLE dbo.Orders
(orderid INT NOT NULL,orderdate DATETIME NOT NULL,
empid INT NOT NULL,custid VARCHAR(5) NOT NULL,
qty INT NOT NULL,salesprice MONEY NOT NULL
CONSTRAINT PK_Orders PRIMARY KEY(orderid));
ALTER TABLE dbo.Orders ADD
TotalSales AS (Salesprice * qty) PERSISTED
I then insert the following data into the table dbo.Orders
SELECT grouping_id(custid,empid) AS grp_id
,custid,empid,YEAR(orderdate) AS orderyear,salesprice,
SUM(qty) AS qty,TotalSales
GROUP BY GROUPING SETS (
( custid,empid),( custid, YEAR(orderdate)),
( empid, YEAR(orderdate)),( empid,TotalSales),
( custid,salesprice),()) ORDER BY grp_id;
Select the four(4) correct answers
The highest value sold to one custid is $499.95
The highest quantity sold to any custid is 50
Empid with highest value sold is 3
The year 2013 has the highest quantity sold
Explanation: Groups a selected set of rows into a set of summary rows by the values of one or more columns or expressions in SQL Server 2012. One row is returned for each group. Aggregate functions in the SELECT clause
Teach yourself the programming fundamentals of SQL Server 2012—one step at a time. Ideal for beginning SQL Server database administrators and developers, this tutorial provides clear guidance and practical, learn-by-doing exercises for building database solutions that solve real-world business problems.
which one is best query?
- first query
select COUNT(id) from tbl_birthmaster1 where status_info=1
select COUNT(id) from tbl_birthmaster1 where isnull(pdffilepath,'')!='' and status_info=1
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.