http://exchange.braintapper.com/listing/tag/sql_server/atom2012-05-21T12:57:11.000-05:00Braintapper Exchange - Feed for tag: sql serverSteven Nghttp://exchange.braintapper.com/sql-server-moving-the-tempdb2010-03-24T11:29:49.000-05:002010-03-24T11:29:49.000-05:00Code Snippet: SQL Server: Moving the tempdb<p>If you need to move the tempdb to another drive in SQL Server, use this SQL:</p>
<pre class="prettyprint"><code>use master
go
Alter database tempdb modify file (name = tempdev, filename = 'E:\Sqldata\tempdb.mdf')
go
Alter database tempdb modify file (name = templog, filename = 'E:\Sqldata\templog.ldf')
Go
</code></pre>
<p>Don't forget to modify the paths according to your own server paths.</p>
slantyyzhttp://exchange.braintapper.com/sql-server-updating-logins-after-a-detach-or-restore2010-03-24T11:26:34.000-05:002010-03-24T11:26:34.000-05:00Code Snippet: SQL Server: Updating Logins after a Detach or Restore<p>If you ever migrate a SQL Server database from one server to another, you'll find that the database IDs get messed up when you reattach the database.</p>
<p>Use the SQL below to migrate the database's legacy ids to the new server's ids:</p>
<pre class="prettyprint"><code>USE dbname
go
EXEC sp_change_users_login 'Update_One', 'oldid', 'newid'
</code></pre>
slantyyz