Rebuild all Indexes in SQL SERVER
SQL Server 2000 Rebuild all indexes with keeping the default fill factor for each index USE EXEC sp_MSforeachtable @command1=”print ‘?’ DBCC DBREINDEX (‘?’)” Rebuild all indexes with specifying the fill…
Convert Integer to String in SQL Server
This is how to convert an integer to string in SQL SERVER. Let’s suppose we want to present the year as a string SELECT CAST(dbo.Employees.HireYear AS nvarchar(4))
SQL Server Collations
Below table contains the details of SQL Server Collations: Albanian_BIN Albanian, binary sort Albanian_BIN2 Albanian, binary code point comparison sort Albanian_CI_AI Albanian, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive Albanian_CI_AI_WS Albanian, case-insensitive, accent-insensitive,…
SQL Server select and update null values in query
Let’s say we have a table Employees with a field Time and we want to update all Null fiels to 0 This the right statement to identify and update null…
Find the Computer Name from IP Address in Windows 7
Sometimes in a local network, we know the IP address of a workstation and want to find the computer name. This can be found by using the nbtstat commnad with…
Find the start up menu of a user on windows 7
It isn’t so obvious for administrators to find the start up folder of a user, when accessing a computer remotely on windows 7 This is the path you have to…
Terminal services manager and Windows 8
Terminal services manager does not exist in Windows 8. But fear not, the Remote Desktop Services Manager will do the trick. To actually enable the feature go to, “Programs and…
Change Security settings on Domain Controller to windows 2008
This is how to change the Security settings on Domain Controller to windows 2008 Click Start, click Run, type gpmc.msc, and then click OK. In the console tree, right-click Default…
SQL Server 2008 issue with the execution of queries with order clause
There is a major issue in SQL server 2008 when running queries from views having the ORDER by clause. The outcome is with random order. Example. We create the following…
SQL Server Convert String to Number
This is how to convert a string to number to an SQL Server sentence. SELECT CAST(YourVarcharCol AS INT) FROM Table examples Convert to Integer Select Cast(Customers.CodeId as Int) from Customers…