Mitdasein in the experience of encountering the customer in our common having been cast into the opening of beyng

Monday, July 30, 2007

Using sqlcmd with BCM v3 databases

From a command line, on the same machine as the database and logged in as a user with permissiion to access the database, run:

sqlcmd -E -S .\MSSMLBIZ -d MSSmallBusiness

That should connect to database MSSmallBusiness. You'll see a prompt.

Type in a command, e.g.:

SELECT BusinessAddressStreet FROM PublicAccountsView
GO

That should dump the results to the screen.

Type EXIT to get out of sqlcmd.

Monday, July 02, 2007

Changing dbo (database owner)

Sometimes you need to change the user (login) that owns a database.

For example, you may need to restore a database backup, and the user that made the backup is not a user on your current machine.

There's a Sql Server sproc (stored procedure) to change owner: sp_changedbowner.