How stupid do I feel for just now finding that T-SQL 2005 has try/catch?
Archive for the ‘SQL Server’ Category
SQL 2005 Try/Catch
Friday, May 1st, 2009SSIS property: ProtectionLevel
Friday, October 5th, 2007The values for ProtectionLevel:
0: Strip sensitive information.
1: Sensitive information is encrypted by using local user credentials.
2: Sensitive information is encrypted by using the required password.
3: The package is encrypted by using the required password.
4: The package is encrypted by using local user credentials.
5: The package uses SQL Server storage encryption.
SQL Server Books On Line: Creating a Deployment Utility
Technet: Setting the Protection Level of Packages
KB906562: How to use the dtutil utility (Dtutil.exe) to set the protection level of a batch of SQL Server Integration Services (SSIS) packages in SQL Server 2005
.dtsConfig Searching
Monday, August 20th, 2007For whatever reason, the windows explorer “Search…” does not work when I’m searching the .dtsConfig files on my development laptop. It will routinely return “no results” found when I KNOW there are files containing the text I am searching for. Since I use the .dtsConfig files to contain connection strings, I typically am searching to make sure I am not connecting to the test server I think I am.
Luckily, this led me to discover a new favorite utility in Visual Studio the rest of the world already knew about - Find and Replace. From the VS.NET menu: Edit >> Find and Replace >> Find in Files (or [Ctrl]+[Shift]+F for keyboard jockeys)
you can launch “Find and Replace”
which made me happy enough for accurately searching the .dtsConfig files (as opposed to Windows Explorer’s Search…) But what my new favorite VS.NET feature, Folder Sets. By clicking the browse ellipses next to the “Look in”drop down, I can set the search folders with the “Choose Search Folders” dialog:
where I can set (and save) a batch of folders I want the Find and Replace utility to search. So simple, I see myself using this a lot in the future.
SSIS:Logging Dynamic SQL Statements
Monday, July 30th, 2007In this post at SSIS Junkie, I saw one complaint regarding how to evaluate dynamically generated SQL statements. There, Jamie suggests using the watch windows in the debugger. This is a great tip for development, but I also like to track SQL in the proverbial “wild”.
Here is how I log dynamically generated SQL statements, built using the Script component within SSIS. This is based on an example I saw online somewhere - but I can no longer remember where to give proper credit.
Write a Script component that contains code similar to this:
Public Sub Main()
Dim DynamicSQLStatement As String
Dim emptyBytes(0) As Byte
Try
' Build Dynamic SQL Statement
DynamicSQLStatement = "SELECT MyColumn FROM MyTable"
' Generate Log Statement
Dts.Log("Dynamic SQL Generated: " & DynamicSQLStatement, 0, emptyBytes)
' Return the dyanmic SQL for user in OLE Source component
Dts.Variables("DynamicSQLStatement").Value = DynamicSQLStatement
Dts.TaskResult = Dts.Results.Success
Catch ex As Exception
Dts.TaskResult = Dts.Results.Failure
End Try
End Sub
Enable the “ScriptTaskLogEntry” for this component. Note: I already have logging enable at the package level, but I override it for the script component to gain access to the “Script Task Log Entry”. (click image to enlarge)
In this case, I have SQL Server logging configured, so the log entry appears in the table dbo.sysdtslog90.
This is incorporated into a larger logging & auditing system (largely based on the Kimball method presented by Joy Mundy here), so that I can trace what SQL was used by a particular ETL batch.
Format .dtsConfig files
Friday, July 6th, 2007In BIDS: Ctrl-K, Ktrl-D
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=263780&SiteID=1
VS Live In San Francisco
Thursday, March 22nd, 2007I will be at VS Live in San Francisco next week focusing on the Team System and SQL Server 2005 tracks. I’m most interested in getting ideas & hearing about others’ experiences with automated testing of SSIS ETL packages. If you’ll be there and are interested in such discussions, I’d be happy to meet up and talk further– just drop me a line in the comments or via email: tito/at/titoperez/dot/com. SSIS and (especially) VSTS are relatively new to me, and I’m part a nascent BI/DW project using both.
Of course, I’m still open to ideas from those who won’t be there, too.
roundup
Monday, March 19th, 2007Joy Mundy webcast: Using SQL Server 2005 Integration Services to Populate a Kimball Method Data Warehouse
Performance Dashboard for Microsoft SQL Server, Part I
On the heels of the release of Service Pack 2 for MSSQL Server 2005 comes what will, perhaps, be the most warmly received Reporting Services “report pack†to date, the Performance Dashboard for Microsoft SQL Server (“Performance Dashboard Reportsâ€). The Performance Dashboard Reports are a set of custom report files designed to be run from within SQL Server Management Studio.
Top 100 Most Influential People in IT
webcast: Designing A Data Warehouse: Part 1 Dimension Type briefly covers different dimension change typs (SCD Types 0,1,2,3) and inferred members
What makes an enterprise wiki?
Build Date Generators and Manipulate Date and Time Data in SQL
patterns & practices Visual Studio Team System: “insightful and practical guidance around using Microsoft Visual Studio Team System”
roundup
Friday, March 16th, 2007Using SQL Server Files for Unit Testing in VS2005 TS
One of the nice features of VSTS is data-driven testing. It’s as easy as hooking up a couple of attributes to the test classes, which then allows tests to be run for multiple sets of input data. The problem is when you want to include data with the test project.
(a solution follows)
Using capistrano to manage EC2 instances (amazon.com’s “virtual computing environment”). The comments also have some interesting discussion about the considerations made in choosing to use Amazon’s services for a startup. See also: Building a Web Application with Ruby on Rails and Amazon S3.
Dare Obasanjo pondering the future of Amazon’s S3 & EC2 services:
What I suspect is that without some catalyst (e.g. the next YouTube is built on S3 + EC2)these services will not reach their full potential. This would be unfortunate because I think in much the same way we moved from everyone rolling their own software to shrinkwrapped software, we will need to move to shrinkwrapped Web platforms in the future instead of everyone running their own ad-hoc cluster of Windows or LAMP servers and solving the same problems that others have solved thousands of times already.
Passing Variables Between Packages
Monday, March 12th, 2007I recently came across a roadblock in an SSIS project — how to pass the variables scoped in one package to a “child” package executed via an “Execute Package Task”. Like most SSIS speedbumps, the solution was easy to implement once I found the answer (at SQLIS.com) — Package Configurations.
On the menu bar: SSIS >> Package Configuration ….
From the Configuration Type dialog, select “Parent package variable” and go through the wizard to map the Parent package variable to the variable in this Child package
