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 …
SQL Server – Generic Error Handling I use
This is generic Error Handler I use for my Adhoc Scripts as Well as functions, stored procedures,etc. — Adding the error message. USE master; GO EXEC sp_addmessage 50001, 16, N’The Record doesn”t exist. Parameter : %s , Value : %s’,@replace=’Replace’; GO — Standard Variables Declarations …
PHP Drivers for MSSQL Issues
PHP Drivers for MSSQL Issues I wanted to setup my Mac Book Pro to access the SQL Server RDS Instance on AWS.My intial thinking was just google on how to setup PHP Drivers on Mac OSX and follow the steps. So I thought it shouldn’t …
SQL Script Header Footer I use
SQL Script Header Footer I use : /****************************************************************************************************** ** Desc: This File will create the XXXXXXXXXXXXXXXXXXXXXXX . ** Auth: Raju Venkataraman ( [email protected] ) ** Date: 09/21/2014 Created ************************** ** Change History ************************** ** CR Date Author Description ** —– ———-– ———– ———————————————————— ** 1 …
Checklist for SQL Server Installation
Feature Selection : We don’t want to install all the features. Identify the features needed and install only those features. Model Database Properties : Figure out all the Model database Properties and configure them Correctly. File Layout : Make sure Data and log files are …