Wolves, Jackals and Foxes

A lot of details and some pretty weird stories. Goes on a bit too long, but easy to skim the parts of no interest.

Wolves, Jackals, and Foxes: The Assassins Who Changed History

South of Shiloh

If you are not interested in the Civil War, some of the detail may make your eyes glaze over. Pretty good read overall.

South of Shiloh: A Thriller

The Golden Warrior

Plenty of detail. Post 1919 part a bit tedious. Sheds light on the differences between legend and fact.

The Golden Warrior: The Life and Legend of Lawrence of Arabia

Theodore Roosevelt

I, for one, would rather cut off my hand than see the United States adopt the attitude either of cringing before great and powerful nations who wish to wrong us, or of bullying small and weak nations who have done us no wrong.

Captain Blood

I kept seeing Errol Flynn but found the book surprisingly engaging. Keeps a brisk pace.

Captain Blood (Penguin Classics)

Breakpoint in Application_Error

If you are trapping errors in the Application_Error event, you need to change the VS 2008 Debug settings to let the error pass through to the app event, rather than breaking at point in the code where the error occurred.

Under Options / Debugging / General – uncheck Enable Just My Code

Enter Null value in Management Studio

To enter a NULL value into a table through Management Studio, use ctrl+0 (zero)

Soul Circus

A lot of surprises, especially at the end.

Soul Circus

Right as Rain

How Strange and Quinn met – pretty good. A bit convoluted at the end.

Right as Rain (Derek Strange/Terry Quinn)

The Night Gardener

Some of the characters seemed shoe-horned in. Pretty good read overall.

The Night Gardener

The Big Blowdown

Well written and very entertaining. Pelecanos hitting on all cylinders with this one

The Big Blowdown

return output value from dynamic sql

I was looking for a way to return an Identity value from a dynamic sql statement.

The simplest way is to pass an output parameter along with the sql:

Dim arrParams(0) As SqlParameter
arrParams(0) = New SqlParameter("@iSCID", SqlDbType.Int)
arrParams(0).Direction = ParameterDirection.Output

Then add the following to the end of the sql statement: ” ; Set @iSCID = @@Identity ”

You can then reference the value in this manner (I use the SqlHelper class from MS):

SqlHelper.ExecuteNonQuery(cn, CommandType.Text, strSql, arrParams)
iSCID = arrParams(0).Value

This page has a lot of great information.

The Curse and Blessings of Dynamic SQL

UPDATE: I ran into a situation where I was using triggers for an audit log that caused the above method to return weird @@Identity values. Turns out, if your trigger inserts into another table, that @@Identity will be returned, not the @@Identity from the intended table.

Detailed info – Excerpt below

on the side note: you should NEVER be using @@IDENTITY to get the last inserted identity from a table. this has been shouted down from the havens numerous times. @@IDENTITY will return the last inserted identity from ANY table of TRIGGER within the transaction session. you MUST use SCOPE_IDENTITY(). even IDENT_CURRENT is dangerous from the BOL about the dangers of using anything but SCOPE_IDENTITY():

SCOPE_IDENTITY and @@IDENTITY will return last identity values generated in any table in the current session. However, SCOPE_IDENTITY returns values inserted only within the current scope; @@IDENTITY is not limited to a specific scope.

For example, you have two tables, T1 and T2, and an INSERT trigger defined on T1. When a row is inserted to T1, the trigger fires and inserts a row in T2. This scenario illustrates two scopes: the insert on T1, and the insert on T2 as a result of the trigger.

Assuming that both T1 and T2 have IDENTITY columns, @@IDENTITY and SCOPE_IDENTITY will return different values at the end of an INSERT statement on T1.

@@IDENTITY will return the last IDENTITY column value inserted across any scope in the current session, which is the value inserted in T2.

SCOPE_IDENTITY() will return the IDENTITY value inserted in T1, which was the last INSERT that occurred in the same scope. The SCOPE_IDENTITY() function will return the NULL value if the function is invoked before any insert statements into an identity column occur in the scope.

Hell To Pay

Pretty good. Moves along at a good clip.

Hell to Pay

Drama City

Good for an evening with nothing to do, but don’t ask for much more than that.

Drama City

Stalin

First 1/3 was interesting. The rest was tedious.

Stalin: The First In-depth Biography Based on Explosive New Documents from Russia’s Secret Archives

The Overlook

Author and Bosch seem to be getting a bit tired in this reworked NYT serial.

The Overlook (Harry Bosch)

Sql Server 2005 data file won’t shrink

Usually, setting Recovery Model to Simple in Options is enough to get started in shrinking a Sql Server db.

However, you may also need to rebuild clustered indexes on large tables. This reorganizes the index and releases the space.

The First Crusade

The first 60-80 pages are about papal politics and the overall situation in Europe, which I ended up skimming. Once the crusaders got under way, things started to get interesting. There is actually much more information about the siege of Antioch than Jerusalem. From cannibalism to siege engines to unremitting bloodshed, its hard to imagine how anyone survived.

The First Crusade: A New History: The Roots of Conflict between Christianity and Islam

Genghis Khan

I read this after seeing the movie Mongol which was a pretty good introduction. The scope of the Mongol conquest was awesome. Story lags a bit after Genghis’ death, but a good read overall.

Genghis Khan and the Making of the Modern World

Echo Park

This one stretches the willful suspension of disbelief but is good for a day off.

Echo Park (Harry Bosch)

« Previous PageNext Page »