Check these links
Below are some of the questions withs answers
1. Which TCP/IP port does SQL Server run on?
SQL Server runs on port 1433 but we can also change it for better security.
2. From where can you change the default port?
From the Network Utility TCP/IP properties. Port number.both on client and the server.
3. Can you tell me the difference between DELETE & TRUNCATE commands?
Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually remove all the rows from a table and there will be no data in the table after we run the truncate command.
4. Can we use Truncate command on a table which is referenced by FOREIGN KEY?
No. We cannot use Truncate command on a table with Foreign Key because of referential integrity.
5. What is the use of DBCC commands?
DBCC stands for database consistency checker. We use these commands to check the consistency of the databases, ie maintenance, validation task and status checks.
6. Can you give me some DBCC command options?(Database consistency check)
DBCC CHECKDB - Ensures that tables in the db and the indexes are correctly linked and DBCC CHECKALLOC - To check that all pages in a db are correctly allocated. DBCC SQLPERF - It gives report on current usage of transaction log in percentage. DBCC CHECKFILEGROUP - Checks all tables file group for any damage.
7. What command do we use to rename a db?
sp_renamedb 'oldname' , 'newname'
8. Well sometimes sp_reanmedb may not work you know because if some one is using the db it will not accept this command so what do you think you can do in such cases?
In such cases we can first bring to db to single user using sp_dboptions and then we can rename that db and then we can rerun the sp_dboptions command to remove the single user mode.
9. What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?
Having Clause is basically used only with the GROUP BY function in a query. WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.
10. What do you mean by COLLATION?
Collation is basically the sort order. There are three types of sort order Dictionary case sensitive, Dictionary - case insensitive and Binary.
Thanks & Regards,