2011-12-14

SQL | SQLServer


Today I am trying to understand SQLServer well enough to script installation of new users without having admin access.

Here’s the gist of what is needed to add a new admin user:

  1. Stop all SQL Server related processes.

  2. Kill every possible connecting process.

  3. Start SQL server in single user mode:

    sqlservr -f -m -s

  4. Create new user:

    sqlcmd -S -E

    1> EXEC sp_addlogin ‘user’, ‘password’
    2> GO
    1> EXEC sp_addsrvrolemember ‘user’, ‘sysadmin’
    2> GO
    1> EXIT

This can be run from a script as

sqlcmd -f -m -i/path/to/script
  1. Ctrl-C SQL Server to stop it.
  2. Restart SQL Server service.

Just figured out that my blog isn’t viewable on the text based browser I’m using.

For some reason w3m (the browser I’ve been using) doesn’t show the slugs as links to the actual posts.

Looks like it works ok in lynx from the command line (but not lynx in an emacs ansi-term buffer) and in elinks both via command line and in emacs.

Standard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s