Tag Archives: sql

Restoring Sharepoint content database from backup

A small script to quickly restore a Sharepoint 2007 content database from backup: USE master GO ALTER DATABASE SITE_WSS_Content SET SINGLE_USER WITH ROLLBACK AFTER 5 GO RESTORE DATABASE SITE_WSS_Content FROM DISK = 'path_to_backup\SITE_WSS_Content_backup_201201122000.bak' WITH REPLACE GO ALTER DATABASE SITE_WSS_Content SET … Continue reading

Posted in Work | Tagged , , , , | Leave a comment

Listing subcategories for a category in Commerce Server 2007 using a SQL query

As promised, here is the follow-up to the last post. This query gets us the names of all subcategories of a particular category in Commerce Server 2007.

Posted in Work | Tagged , | Leave a comment

Listing categories for a product in Commerce Server 2007 using a SQL query

Commerce Server API is not exactly known for being lightning-fast, so sometimes you want to skip it altogether and just use plain old SQL to get the data. This time I needed to find all categories (at a particular level) … Continue reading

Posted in Work | Tagged , | Leave a comment

Script for extracting SQL Server users, roles and role assignments

A nice little script to generate a script for extracting all users. roles and role memberships in a SQL Server database

Posted in Work | Tagged , , , , | Leave a comment