Ever restored a database in SQL Server. And then had all this disconnected logins hanging around. Logins in the database that got restored, but have no SQL Server login name associated with them. Fear no more, here's the help:
sp_change_users_login
And here's how to use it:
sp_change_users_login @Action='Update_One', @UserNamePattern='dbuser', @LoginName='sysuser', @Password=Null
This will reconnect the database user dbuser with the login name in the system sysuser. Normally both user names are the same.
Enjoy
20070524
20070518
SQL Server 2005 Management Studio Scripting
Something that bugs me now and then. using SQL Server 2005 Management Studio to script tables and stored procedure is really a great tool. Couldn't do without it and would certainly have to write something similar. Except now and then it throws all the object definitions into a EXEC dbo.sp_executesql @statement = N format, and that throws me off, and doesn't smell right.
Then I go scrambling, trying to figure out which of the many scripting options it is that sets this up.
For my own future sanity and for anybody who cares, it is (drum roll):
Include IF NOT EXISTS clause
Which makes sense, since then the whole definition needs to fit in an if clause.
Then I go scrambling, trying to figure out which of the many scripting options it is that sets this up.
For my own future sanity and for anybody who cares, it is (drum roll):
Include IF NOT EXISTS clause
Which makes sense, since then the whole definition needs to fit in an if clause.
20070509
.NET String Format
How many times have you sat there and browsed MSDN for a comprehensive list of format strings in .NET ?
I've done it countless times, and while the documentation is technically accurate, it is missing an essential overview in one spot.
Here is my two alternative SteveX Compiled » String Formatting in C#
Enjoy
I've done it countless times, and while the documentation is technically accurate, it is missing an essential overview in one spot.
Here is my two alternative SteveX Compiled » String Formatting in C#
Enjoy
20070315
Bob Seger and The Silver Bullet Band
Saw them on Tuesday, at the Joe Louis Arena. What a concert. Just incredible, and this of course is his home town. I had to save my voice on Wednesday, we called him back for two encores. Uncle Cracker opened for him (they could play a concert on their own)
Here's the set list
Encore 1
Encore 2
Here's the set list
- Nutbush City Limits
- Tryin’ to Live My Life Without You
- Wreck This Heart
- Mainstreet
- Old Time Rock and Roll
- Wait for Me
- Face the Promise
- Sunspot Baby
- Betty Lou’s Gettin' Out Tonight
- We've Got Tonight
- Turn the Page
- Travelin’ Man/Beautiful Loser
- Roll Me Away
- Ramblin Gamblin Man
- C'est La Vie (You Can Never Tell)
- Real Mean Bottle
- The Answer is in the Question
- The Fire Down Below
- Horizontal Bop
- Katmandu
Encore 1
- Night Moves
- Hollywood Nights
Encore 2
- Against the Wind
- Rock and Roll Never Forgets
20070204
How to take a proper shower
When it's 5 degrees out there !
First you make sure that you have at least 1/2 our of time available. Then you make sure that you won't be disturbed. Lock the door ! Block it with a chair. Tell everybody to use te other bathroom !
And then make sure you have a shower, that has limited flow, so you won't run out of hot water. Get one of those rain-fall heads with a flow of 2.5 gpm or less.
Turn on the water
Make sure it's not too hot in the beginning, we'll turn it up later
Get in, and take your time
Take you time
AFter 10 minutes reduce the cold water some more
Make sure the curtain is completely closed, so no cold air can come into the shower. Use the condensation and the showercurtain to stick the curtain against the edges of the tub enclosure.
That way the shower will be filled with delicious hot steamy air.
Stay in there ! gradually reduce all cold water to zero, and steam boil yourself like a lobster
Enjoy the fruits of our civilization. Running hot water. See how the window is frosted up, and remember it's colder than a witches t.... out there.
Enjoy
First you make sure that you have at least 1/2 our of time available. Then you make sure that you won't be disturbed. Lock the door ! Block it with a chair. Tell everybody to use te other bathroom !
And then make sure you have a shower, that has limited flow, so you won't run out of hot water. Get one of those rain-fall heads with a flow of 2.5 gpm or less.
Turn on the water
Make sure it's not too hot in the beginning, we'll turn it up later
Get in, and take your time
Take you time
AFter 10 minutes reduce the cold water some more
Make sure the curtain is completely closed, so no cold air can come into the shower. Use the condensation and the showercurtain to stick the curtain against the edges of the tub enclosure.
That way the shower will be filled with delicious hot steamy air.
Stay in there ! gradually reduce all cold water to zero, and steam boil yourself like a lobster
Enjoy the fruits of our civilization. Running hot water. See how the window is frosted up, and remember it's colder than a witches t.... out there.
Enjoy
20061219
MFC and SQLFetch
This is probably an old bug, but nevertheless one that cost me a few hours. When using a recordset in MFC 4.2 (comes with Visual Studio 6) and an odbc driver, do not open the recordset with a sql statement. That forces the first parameter in the open to be default (or dynaset which is the same). With a dynaset, MFC decides to call SQLExtendedFetch, like here
AFX_ODBC_CALL(::SQLExtendedFetch(m_hstmt, wFetchType, nRow, pdwRowsFetched, m_rgRowStatus));
And guess what ? SQLExtendedFetch returns the number of rows fetched, which AFC_ODBC_CALL freely interprets as an error code. Sure, your saying, who's using MFC4.2 now, or why not just change the source code ? All valid points, but after all, most people use the out of the box stuff, even nowadays.
All right, nuff said
AFX_ODBC_CALL(::SQLExtendedFetch(m_hstmt, wFetchType, nRow, pdwRowsFetched, m_rgRowStatus));
And guess what ? SQLExtendedFetch returns the number of rows fetched, which AFC_ODBC_CALL freely interprets as an error code. Sure, your saying, who's using MFC4.2 now, or why not just change the source code ? All valid points, but after all, most people use the out of the box stuff, even nowadays.
All right, nuff said
20061201
Have fun racing
A new job (Cimulus) and some more time on my hand. So I'm sitting here surfing the web, when I come across these youtube videos of BBC's topgear show. Check out their race from Guildford to Nice, or the one from Alba to London. Check it out, if you like cars you like this
20060919
What am I listening too right now
Bob Seger Face the promise
Back after a long time - back with a very strong album. Here in the midwest - in A2 - where he's from - a must to listen too. Here's my 2 cents worth on those songs
1. Wreck This Heart
I can understand the thought behind this song - going on even when it ends up hurting you
2. Wait For Me
Wanderlust and the plea for the loved one to wait for one to come back - and the promise to be back for sure
3. Face The Promise
A road song - again Wanderlust and the taste of what drives someone to go far. Also about this big country of ours - the USA. So long small town - hello big city, bright lights.
4. No Matter Who You Are
The circle of life : life and death, it affects us all - and no matter who you are, you will lose a loved one eventually, you will have to give up things - in the end, you can't take it with you.
5. Are You
Could this be about the war ? Are you gonna see his bluff. On the other hand - maybe it goes with the next song - the shelves are overstocked - a criticism on our commercialism and consumerism - and the blatant disregard for the rest of the world. this world's gonna drive you under, if you never have enough
6. Simplicity
Definitely very clear - and right down my line. When you have had it - simplicity will work. Focus on your loved ones, and the stuff money can't buy. Partners, friends, spouses and children. Pets, Parents and siblings. Forget about fast cars, big tvs and all the other bling bling
7. No More
The best anti-war song in a while. Should be mandatory listening in all schools. And Bush should have to listen to it at least once a day - so he understands what he got us into, and how much he damaged this country's image in the world. It's also a little poppy with it's violins and the orchestra - but the truth remains, this president got us into a mess, that it's gonna be hard to get out of. I also don't want this
8. Real Mean Bottle (with Kid Rock)
A great country rock song - I wonder who they sing about - maybe Johnny Cash ? Or themselves ?
9. Won’t Stop
You can cry if you want to ... but you won't stop there - a great song about addiction and demons that ride us.
10. Between
'This world is out to get you just like it got me. .. World keeps getting hotter'. A very accurate statement of politics and life in this nation
11. The Answer’s In The Question (with Patty Loveless)
A nice quiet song - great duet
12. The Long Goodbye
a VERY quiet song about our mortality - or is it just me interpreting this wrong - probably
And I respect the fact that he took time off for his family. And I'm grateful, that he's back
Back after a long time - back with a very strong album. Here in the midwest - in A2 - where he's from - a must to listen too. Here's my 2 cents worth on those songs
1. Wreck This Heart
I can understand the thought behind this song - going on even when it ends up hurting you
2. Wait For Me
Wanderlust and the plea for the loved one to wait for one to come back - and the promise to be back for sure
3. Face The Promise
A road song - again Wanderlust and the taste of what drives someone to go far. Also about this big country of ours - the USA. So long small town - hello big city, bright lights.
4. No Matter Who You Are
The circle of life : life and death, it affects us all - and no matter who you are, you will lose a loved one eventually, you will have to give up things - in the end, you can't take it with you.
5. Are You
Could this be about the war ? Are you gonna see his bluff. On the other hand - maybe it goes with the next song - the shelves are overstocked - a criticism on our commercialism and consumerism - and the blatant disregard for the rest of the world. this world's gonna drive you under, if you never have enough
6. Simplicity
Definitely very clear - and right down my line. When you have had it - simplicity will work. Focus on your loved ones, and the stuff money can't buy. Partners, friends, spouses and children. Pets, Parents and siblings. Forget about fast cars, big tvs and all the other bling bling
7. No More
The best anti-war song in a while. Should be mandatory listening in all schools. And Bush should have to listen to it at least once a day - so he understands what he got us into, and how much he damaged this country's image in the world. It's also a little poppy with it's violins and the orchestra - but the truth remains, this president got us into a mess, that it's gonna be hard to get out of. I also don't want this
8. Real Mean Bottle (with Kid Rock)
A great country rock song - I wonder who they sing about - maybe Johnny Cash ? Or themselves ?
9. Won’t Stop
You can cry if you want to ... but you won't stop there - a great song about addiction and demons that ride us.
10. Between
'This world is out to get you just like it got me. .. World keeps getting hotter'. A very accurate statement of politics and life in this nation
11. The Answer’s In The Question (with Patty Loveless)
A nice quiet song - great duet
12. The Long Goodbye
a VERY quiet song about our mortality - or is it just me interpreting this wrong - probably
And I respect the fact that he took time off for his family. And I'm grateful, that he's back
20060908
Back from the Valley
Spend a great time over labor day weekend in the valley ! What a dynamic environment, time to make a move there !
While walking down 4th street in SFO, I stumbled across a door that indicated that Moveable Type and a couple of other outfits are in that building. For a company with as big an internet presence as them and then only a door ! I scratched my head !
While walking down 4th street in SFO, I stumbled across a door that indicated that Moveable Type and a couple of other outfits are in that building. For a company with as big an internet presence as them and then only a door ! I scratched my head !
20060810
VB6 and Page Heaps
Yeah, Yeah I know, long time. but here's something I just ran across, trying to find this darned memory problem
You cannot run vb6 with page heap protection. Something in the mechanism on how extensions are plugged in (SourceSafe in specific), gives you an access violation (0xc0000005). Bummer, since the bugs happen much faster in the VB6 IDE than in the executable.
Stay tuned....
You cannot run vb6 with page heap protection. Something in the mechanism on how extensions are plugged in (SourceSafe in specific), gives you an access violation (0xc0000005). Bummer, since the bugs happen much faster in the VB6 IDE than in the executable.
Stay tuned....
Subscribe to:
Posts (Atom)