A blog about SQL Server, Books, Movies and life in general
Saturday, December 01, 2007
Screencast: SQL Server 2008 - Table valued parameters
Table-valued parameters are a new parameter type in SQL Server 2008 and are declared by using user-defined table types.
Watch the screencast(SWF)
Watch the screencast(WMV)
Tuesday, November 27, 2007
Integer Math In SQL Server
SELECT 3/2
If you said 1.5 then you are wrong! The correct answer is 1, this is because when doing division with 2 integers the result will also be an integer.
There are two things you can do
1 multiply one of the integers by 1.0
2 convert one of the integers to a decimal
Integer math is integer result
DECLARE @Val1 INT,@val2 INT
SELECT @Val1 =3, @val2 =2
SELECT @Val1/@Val2Result 1
Convert explicit or implicit to get the correct answer
DECLARE @Val1 INT,@val2 INT
SELECT @Val1 =3, @val2 =2
--Implicit
SELECT @Val1/(@Val2*1.0)
--Explicit
SELECT CONVERT(DECIMAL(18,4),@Val1)/@Val2
Result 1.50000000000000
Visual Studio 2008 Training on Channel 9
This session was presented by Jaime Rodriguez
Come and learn how to build Windows Presentation Foundation (WPF) applications with the help of the new WPF designer in Visual Studio 2008 This session focuses on the construction of a real-world application demonstrating how to get the best out of the designer's capabilities. Learn the basics of building WPF applications in the Visual Studio 2008 WPF designer; have a clear view on when you'll want to work in XAML Code and on the Visual Studio design surface to get your WPF application built; and see how you can use Microsoft Expression Blend in conjunction with Visual Studio 2008 WPF designer.
Watch the screencast here: http://channel9.msdn.com/ShowPost.aspx?PostID=359715#359715
VS2008 Training Kit: What's New in Windows Presentation Foundation 3.5
This session was presented by Kevin Moore
Learn about the work being done in the Orcas release of WPF, including improved 3D with UIElement3D, increased animation smoothness, better cookie and FireFox plug-in support for XBAPs, as well as support for AddInControl, LINQ, ADO.NET and much more!
Download it here: http://channel9.msdn.com/ShowPost.aspx?PostID=359713#359713
VS2008 Training Kit: Introduction to Silverlight
This session was presented by Adam Kinney
Silverlight is a cross platform UI framework for creating compelling Web experiences. Come learn the high-level architecture of Silverlight and the tools that are available to build Silverlight applications.
Download it here: http://channel9.msdn.com/ShowPost.aspx?PostID=359712#359712
VS2008 Training Kit: Building Web Applications with Visual Studio 2008
This session was presented by Ryan Dunn
This session covers the new design and development features in Visual Studio 2008 for creating rich web applications. Topics include the new CSS and HTML design tools, much improved Javascript Intellisense and debugging support, and the new ASP.NET 3.5 controls supporting LINQ and AJAX.
Download it here: http://channel9.msdn.com/ShowPost.aspx?PostID=359711#359711
VS2008 Training Kit: Introduction to ASP.NET AJAX
This session was presented by Steve Marx
In this session, you'll learn how to use ASP.NET AJAX to build a richer, more responsive user experience. Topics include partial rendering, web services, structured scripting, and integration with Silverlight.
Download it here: http://channel9.msdn.com/ShowPost.aspx?PostID=359706#359706
Monday, November 26, 2007
.NET Framework 3.5 Common Namespaces and Types Poster Available For Download
Get it here: http://www.microsoft.com/downloads/details.aspx?FamilyID=7b645f3a-6d22-4548-a0d8-c2a27e1917f8&DisplayLang=en
Sunday, November 25, 2007
World Cup Soccer 2010 Qualification - UEFA draw, England And Croatia In The Same Group Again!
Portugal, Sweden, Denmark, Hungary, Albania, Malta
Group 2:
Greece, Israel, Switzerland, Moldova, Latvia, Luxembourg
Group 3:
Czech Rep., Poland, Northern Ireland, Slovakia, Slovenia, San
Marino
Group 4:
Germany, Russia, Finland, Wales, Azerbaijan, Liechtenstein
Group 5:
Spain, Turkey, Belgium, Bosnia-Herzegovina, Armenia, Estonia
Group 6:
Croatia, England, Ukraine, Belarus, Kazakhstan, Andorra
Group 7:
France, Romania, Serbia, Lithuania, Austria, Faroe Islands
Group 8:
Italy, Bulgaria, Ireland, Cyprus, Georgia, Montenegro
Group 9:
Netherlands, Scotland, Norway, Macedonia FYR, Iceland
Croatia and England again in the same group :-)
Group 7 doesn't look easy either
Friday, November 23, 2007
Whitepaper on Malware to Attack Databases
Brian Kelly on his blog mentiones a whitepaper by Cesar Cerrudo: Data0: Next generation malware for stealing databases. This whitepaper describes how malware could be crafted to steal information out of databases.
The attack will use the following techniques:
- Discovery
- Exploitation
- Escalate Privileges (if necessary)
- Cover Tracks
Print it out and read it while you wait in line on Black Friday
Thursday, November 22, 2007
Just For My English Friends
England and Croatia in the same group again for World Cup 2010 qualifications:
Group 6: Croatia, England, Ukraine, Belarus, Kazakhstan, Andorra
Wednesday, November 21, 2007
Thanksgiving SQL Teaser COUNT
USE tempdb
GO
CREATE TABLE Customer (CustomerID INT PRIMARY KEY)
INSERT Customer VALUES (1)
INSERT Customer VALUES (2)
INSERT Customer VALUES (3)
INSERT Customer VALUES (4)
SELECT COUNT(*) Customer
Visual Studio 2005 Support for SQL Server 2008, Community Technology Preview
“This server version is not supported. Only servers up to Microsoft SQL Server 2005 are supported.”
This CTP addresses this issue, and enables the following Visual Studio functionality for SQL Server 2008 CTP5 :
- Server Explorer successfully connects to SQL Server 2008, and database objects such as stored procedures and table data can be viewed and edited. Note that table schemas still cannot be viewed or edited in this release.
- SQL CLR projects that target SQL Server 2008 CTP5 can be created and deployed to the server.
- T-SQL and SQL CLR debugging are now enabled for SQL Server 2008 CTP5.
Data binding features in Client and Web Projects are enabled.
This CTP does not support the following features for SQL Server 2008 Nov CTP:
- Creating and editing table schemas in Table Designer or Database Diagrams. The table designer feature in SQL Server Management Studio 2008 can be used to edit table schemas in SQL Server 2008 CTP5.
Download it here: http://www.microsoft.com/downloads/details.aspx?FamilyID=e1109aef-1aa2-408d-aa0f-9df094f993bf&displaylang=en
Tuesday, November 20, 2007
Surface Area Configuration Tool Is Discontinued, SQL-DMO Removed from Microsoft SQL Server 2008 Express
Just reading the readme file in SQL Server 2008 November CTP. I noticed that in addition to SQL Server Notification Services the following two things are also being removed.
SQL-DMO Removed from Microsoft SQL Server 2008 Express
Surface Area Configuration Tool Is Discontinued
The Surface Area Configuration Tool is discontinued for SQL Server 2008. The following table shows what you can use to configure settings, options, and component features in the November CTP.
Protocols, and connection and startup options
Use SQL Server Configuration Manager.
Database Engine features
Use Declarative Management Framework.
SSAS features
Use the property settings in SQL Server Management Studio.
SSRS features
Edit the RSReportServer.config configuration file.
Monday, November 19, 2007
Microsoft SQL Server 2008 CTP November 2007 Available For Download
There are several formats available.
DVD image files:
X86 DVD Image
X64 DVD Image
IA64 DVD Image
Self-extracting executables:
X86 Executable
X64 Executable
IA64 Executable
Express 2008 Executable
Get it here: http://www.microsoft.com/downloads/details.aspx?FamilyId=3BF4C5CA-B905-4EBC-8901-1D4C1D1DA884&displaylang=en
Visual Studio 2008 RTM Available On MSDN
Okay I downloaded it and installed it.
Saturday, November 17, 2007
Visual Studio 2008 Available For Download Early Next Week
Visual Studio 2008 is anticipated out early next week, with availability for Subscribers. Check out the "Top Subscriber Downloads" area on http://msdn2.microsoft.com/subscriptions for VS 2008 downloads.
Wednesday, November 14, 2007
Microsoft Buiness Intelligence Screen Casts
This screencast is the first in a series BI Developer screencasts recorded as part of a workshop built on SQL Server 2005 that has been delivered around the globe by Microsoft and Microsoft Partners. This training event takes the student through the Microsoft BI Platform giving a BI Developer the introduction and basic comfort needed to tackle a BI project using Microsoft technology.
This first screencast will take you through the Microsoft BI Platform briefly touching on each of the technologies.
Microsoft BI - Platform Integration
This screencast shows how to use SQL Server Integration Services (SSIS), Microsoft's ETL tool, to send conditional email alerts during a load.
Microsoft BI - Developing a Query-Driven E-mail Delivery System
Tuesday, November 13, 2007
INTERCEPT In SQL Server 2005
Try it yourself
CREATE TABLE testnulls (ID INT)
INSERT INTO testnulls VALUES (1)
INSERT INTO testnulls VALUES (2)
INSERT INTO testnulls VALUES (null)
CREATE TABLE testjoin (ID INT)
INSERT INTO testjoin VALUES (1)
INSERT INTO testjoin VALUES (3)
SELECT * FROM #testjoin
INTERSECT
SELECT * FROM #testnulls
SELECT * FROM #testjoin
INTERCEPT
SELECT * FROM #testnulls
Feature, Bug?
Okay, it actually doesn't matter what you type between the two statements
SELECT * FROM #testjoin
sdsdsdsdsd
SELECT * FROM #testnulls
That runs just as if you executed the query without sdsdsdsdsd
??????
WAKE UP!!! That acts as an alias, now where is my caffeine.
How Is Your Sensitive Data Encrypted In The Database?
So you probably think that I am crazy and no one would ever steal a database server. Wrong! C I Host a Chicago-based co-location got robbed 4 times since 2005. One company lost 20 servers in the latest heist. You can read more details about that here: http://www.theregister.co.uk/2007/11/02/chicaco_datacenter_breaches/
Without going into too much detail, this is what we are doing. Our data is encrypted by a corporate crypto tool which can only be accessed from within the DMZ. Keys are created for specific machines; these keys can easily be revoked at any time. Even if you would somehow steal our web and database server you would still be out of luck because of that. The data is encrypted by the tool and stored encrypted in the DB.
Identity theft will cost you in the future.
The Identity Theft Enforcement and Restitution Act of 2007 has been introduced and was scheduled for debate on November 1st; the Senate and the House still have to vote on it. This is a bill to amend title 18, United States Code, to enable increased federal prosecution of identity theft crimes and to allow for restitution to victims of identity theft.
Follow the developments here:
S. 2168: Identity Theft Enforcement and Restitution Act of 2007
Friday, November 09, 2007
SQL Teaser: Printing Without Using PRINT
Print the @SQL variable without using PRINT
DECLARE @SQL varchar(49)SELECT @SQL = 'Print This Now ' + CONVERT(VARCHAR(30), GETDATE())
--Your Code Here
Thursday, November 08, 2007
E-Learning: What's New in Microsoft SQL Server 2008
In this 3 hour online collection, IT Professionals will learn about the new features in SQL Server 2008. Topics covered within these clinics include:
What's New in SQL Server 2008 for Enterprise Data Platform
What's New in SQL Server 2008 for Business Intelligence
What's New in SQL Server 2008 for Database Development Student
Below are the links to the three lessons:
Clinic 6188: What's New in Microsoft SQL Server 2008 for Enterprise Data Platform
Clinic 6189: What's New in Microsoft SQL Server 2008 for Business Intelligence
Clinic 6190: What's New in Microsoft SQL Server 2008 for Database Development
Tuesday, November 06, 2007
Return Null If A Value Is A Certain Value
There are three different ways.
NULLIF
DECLARE @1 char(1)
SELECT @1 ='D'
SELECT NULLIF(@1,'D')
REPLACE
This should not really be used, I just added it here to demonstrate that you can in fact use it.
DECLARE @1 char(1)
SELECT @1 ='D'
SELECT REPLACE(@1,'D',NULL)
CASE
With case you can test for a range of values. You can test for example for values between A and D. If you reverse the logic then you also don't need to provide the ELSE part since it defaults to NULL anyway.
DECLARE @1 char(1)
SELECT @1 ='D'
SELECT CASE @1 WHEN 'D' THEN NULL ELSE @1 END
--No else needed
SELECT CASE WHEN @1 <> 'D' THEN @1 END
And this is how you test for a range.
--Null
DECLARE @1 char(1)
SELECT @1 ='D'
SELECT CASE WHEN @1 BETWEEN 'A' AND 'D' THEN NULL ELSE @1 END
--E
DECLARE @1 char(1)
SELECT @1 ='E'
SELECT CASE WHEN @1 BETWEEN 'A' AND 'D' THEN NULL ELSE @1 END
Christmas Is Coming Early This Year
"All,
It looks like we have some book money left for this year that we can spend.
Please select 2 books each that you have wanted and send the titles to me and I’ll get them on the list."
Very nice, I picked the following two books below.
The Art of SQL
SQL Server 2005 Practical Troubleshooting: The Database Engine
What would you have picked?