Sports

Categories

  • No categories

SEARCH

I’m Attending

CodeMash

 
SQL Server Backup and Restore Across Server Username Fix

I run into this a lot while deploying new fixes. If you have a production and a stage environment, before deploying to production, you should backup and restore your database to the staging database to do all your UAT. However, if your usernames are the same, then you may run into an issue where SQL […]

Visit this Project »

LogParser Hits Per Day on Specific Page

I was trying to get hits per week on a specific page, but I had to settle for exporting to a CSV and doing the rest in Excel. logparser -i:IISW3C -o:CSV "SELECT TO_STRING(TO_LOCALTIME(TO_TIMESTAMP(date, time)), ‘yyyy-MM-dd’) AS [Day], COUNT(*) AS [Requests] INTO hits_per_day.csv FROM *.log WHERE cs-uri-stem = ‘/login.aspx’ GROUP BY [Day] ORDER BY [Day]"

Visit this Project »

Reindex All Tables in Database (SQL Server)

Another thing I do a lot and always forget about: EXEC sp_MSforeachtable @command1=”print ‘?’ DBCC DBREINDEX (‘?’, ‘ ‘, 80)” GO EXEC sp_updatestats GO

Visit this Project »

Music of 2010

Every year, Brad Wilson reviews the albums of the year.  I thought that I would put together my own list of songs of Electronica that I listen to each day at work for this last year. D-Mad – She Gave Happiness (Arty Remix) Deadmau5 – Some Chords – 4×4=12 Pendulum – Part 2 (Dusk) – […]

Visit this Project »

Building SQL Server T-SQL with Error Handling

Today, my manager asked me how I build my T-SQL scripts when I need to update a bunch of data in SQL Server.  I hadn’t really thought much about it, but this is what I normally use. DECLARE @ErrorCode INT BEGIN TRANSACTION –UPDATE A TABLE OR SOMETHING SELECT @ErrorCode = @@ERROR IF (@ErrorCode <> 0) […]

Visit this Project »