Change HostName in Linux Machines Edit /etc/hostname , make the name change, save the file. You should also make the same changes in /etc/hosts file Run sudo /etc/init.d/hostname restart or sudo service hostname restart /etc/hostname /etc/hosts sudo /etc/init.d/hostname restart sudo service hostname restart
Backup-Zip-Copy-Unzip-Restore-Notify SQL Server Databases
Backup-Zip-Copy-Unzip-Restore SQL Server Databases: I am sure we all try to bring databases from One Environment to Another Environment whether its to accomplish testing, debugging or maintaining the parity between production and lab. I used to spend little bit of time doing these tasks manually , after …
SQL Server : Find SQL Server TCP Port and IP Address
SQL Server : Find SQL Server TCP Port and IP Address SELECT @@SERVERNAME AS ServerName , local_tcp_port,local_net_address FROM sys.dm_exec_connections WHERE session_id = @@SPID Results : ServerName local_tcp_port local_net_address DEVENV\2008R2 59663 192.168.63.223
SQL Server – Create and Parse Comma Seperated List
XML Approach: Reads : 2 Duration:5 ms Substring Approach: Reads : 16 Duration: 14 ms –declare a variable and populate it with a comma separated string DECLARE @SQLString VARCHAR(MAX) SET @SQLString = N’94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, …
Removing Additional Data Files from TempDB
I had a need to remove TempDB DataFiles in one of our environments. When I ran the simple DBCC SHRINKFILE Command, I encountered following error. DBCC SHRINKFILE: Page 4:11283400 could not be moved because it is a work table page. DBCC SHRINKFILE (N’tempdev9′ , EMPTYFILE) …
Quick way to Reindex all tables on SQL Server Database
USE NMPortal GO EXEC sp_MSforeachtable @command1=”print ‘?’ DBCC DBREINDEX (‘?’, ‘ ‘, 80)” GO EXEC sp_updatestats GO
Rename SQL Server Database
Rename SQL Server Database: Change the Database to Single User Mode and Rollback all the existing Transactions. This is done because you need to obtain Exclusive Database Lock. That way you don’t encounter errors related to obtaining database lock. Rename the Database and then Turn …
Import Excel Into SQL Server
Copied from here. http://blogs.technet.com/b/sqlthoughts/archive/2008/10/03/out-sql-powershell-function-export-pipeline-to-a-new-sql-server-table.aspx http://tools.perceptus.ca/text-wiz.php http://dnhlmssql.blogspot.com/2013/05/from-excel-to-insert-into-another.html ############################################################################## ## ## out-sql.ps1 ## ## by Alexey Yeltsov, Microsoft Corp. ## Raju Venkataraman Added some fixes for Table creation and Inserts ## Export pipeline contents into a new SQL table ## ## Parameters: ## $SqlServer – SQL Server …
How do I Change SQL Database from Single_User to Multi_User Mode
How do I Change SQL Database from Single_User to Multi_User Mode: Sometimes, we have the need to set the database in Single User Mode to do some upgrades or blocking all the access to the Database. Set the Database to Single User Mode : ALTER …
Nissan Murano 2010 Rack and Pinion Cost
Dealership VS Non-Delarship Price I have NISSAN Murano 2010 AWD and I started noticing the Stiffness in power steering. I went to the NISSAN Dealer to Diagnose the problem and they found the Rack and Pinion was leaking. Obviously, the next question from me was …