You are currently browsing the Blog weblog archives for June, 2009.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| « Feb | Jul » | |||||
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | ||||
- IIS (1)
- Open Source (1)
- Performance (3)
- Personal (2)
- Powershell (1)
- SQL (1)
- SQL Server (20)
- T-SQL (14)
- Uncategorized (6)
- Utilities (4)
- Windows OS (13)
- 23. August 2010: Alert for long-running SQL datbase backups
- 7. April 2010: Learning SMO & Powershell
- 25. February 2010: SQL Generators for moving database files
- 28. January 2010: Index to Filegroup mapping
- 20. January 2010: PowerShell Script to Clean Up Old Files Based on Age
- 7. January 2010: Quick & Dirty way to identify orphan files
- 29. July 2009: Trigger Mass Enable / Disable
- 29. June 2009: Moving Master and Resource databases
- 11. June 2009: Quick and Dirty CSV import to SQL Server
- 2. February 2009: Getting data file space usage
Archive for June 2009
Moving Master and Resource databases
29. June 2009 by Bennett.
You may encounter the error message “SQL SERVER is in SINGLE USER MODE and only one administrator can connect” when moving the Master and Resource databases when following the procedure in BOL. It happens right after you bring up SQL Server in Master-only, single-user mode using the T3608 trace flag like this:
NET START MSSQLSERVER /f /T3608
For me the problem was that a remote process was grabbing the lone connection faster than I could. The fix was to go into SQL Server Configuration Manager, Expand SQL Server Network Configuration, drill down into Protocols for MSSQLSERVER, and then change the TCP/IP settings to point to a different port number. In the example below, I pointed to port 14331 instead of 1433.
Once the port settings were changed, I stopped and restarted SQL Server and was able to finish moving the system databases. Don’t forget to change back to port 1433 once you’re done!!!!
References:
http://msdn.microsoft.com/en-us/library/ms345408(SQL.90).aspx
Posted in Uncategorized | Print | 1 Comment »
Quick and Dirty CSV import to SQL Server
11. June 2009 by Bennett.
You can use LogParser (a free, unsupported utility from Microsoft) to quickly import a CSV file into a SQL Server table using syntax like this:
logparser “SELECT * INTO MyTable FROM d:\MyFile.csv” -i:csv -o:SQL -server:MyServer -database:MyDatabase -createTable:ON
There are many other uses for LogParser. Two of the most common are analyzing Windows Event Logs and IIS logs.
Posted in Windows OS, SQL Server | Print | No Comments »
