Thursday, August 13, 2009

SQL Saturday in Redmond, WA

I just signed up to speak at SQL Saturday in Redmond on October 3rd. I will be presenting two sessions:
I really enjoyed the SQL Saturday here in Portland and look forward to Redmond.

Wednesday, August 12, 2009

[Not SQL-related] Networking Through Existing House Wires

I seldom write about non-SQL topics, but this product was just too great. Last night I purchased and installed a Linksys Powerline AV Network Kit (model PLK300).

Problem: We moved to a new house about two months ago. Our wireless (N) router is at one end of the house on the main floor. I was trying to connect a computer in the basement on the other end of the house. That room receives zero cell service, and I found that the wireless signal was too weak. I purchased two different receivers, but neither worked.

Solution: After talking with someone at Best Buy about what options we had, we purchased the "Powerline Network Kit". It routes the network signals over your home's existing power wires.

Installation was dead simple. Plug one unit into the router; plug the other unit into the receiving computer. They both plug into the regular wall outlet. Bingo. It worked. The only thing I had to do was plug both into the outlet without going through a surge suppressor. That was explained in the brief installation instructions.

The receiver has four ethernet ports, but I'm only using one. The speed seems quite good.

Nice product. Great solution to my problem.

[Slight] Caveat: The little stands are a waste. The units are so light that the cables make them fall over. Pitch the stands and just lay them down flat. That works great.

Monday, August 03, 2009

Table Variables and Transactions

Did you know that table variables are not affected by ROLLBACKs? After I discovered it in my testing, I searched Google and found many references to it. Apparently everyone knew about this besides me.

Here is a simple example:
-- Create two tables: one a temp table and one a table variable
IF OBJECT_ID('tempdb..#t') IS NOT NULL DROP TABLE #t
CREATE TABLE #t (Col1 int NOT NULL)
DECLARE @t TABLE (Col1 int NOT NULL)

-- Begin a transaction
BEGIN TRAN

-- INSERT two values into each table
INSERT INTO @t VALUES (1)
INSERT INTO @t VALUES (2)
INSERT INTO #t VALUES (1)
INSERT INTO #t VALUES (2)

-- ROLLBACK and check values
ROLLBACK TRAN

PRINT '#t'
SELECT * FROM #t
PRINT '@t'
SELECT * FROM @t

-- Just in case
IF @@TRANCOUNT > 0 ROLLBACK TRAN
Result:
#t
Col1
----

@t
Col1
----
   1
   2
The table variable (@t) is not affected by the ROLLBACK.

References: