SQL Server interview questions

Started by Kalyan, May 12, 2008, 10:20 PM

Previous topic - Next topic

Kalyan

SQL Server interview questions

      How do you read transaction logs?

      How do you reset or reseed the IDENTITY column?

      How do you persist objects, permissions in tempdb?
     
      How do you simulate a deadlock for testing purposes?

      How do you rename an SQL Server computer?

      How do you run jobs from T-SQL?

      How do you restore single tables from backup in SQL Server 7.0/2000? In SQL Server 6.5?

      Where to get the latest MDAC from?

      I forgot/lost the sa password. What do I do?

      I have only the .mdf file backup and no SQL Server database backups. Can I get my database back into SQL Server?

      How do you add a new column at a specific position (say at the beginning of the table or after the second column) using ALTER TABLE command?

      How do you change or alter a user defined data type?

      How do you rename an SQL Server 2000 instance?

      How do you capture/redirect detailed deadlock information into the error logs?
 
      How do you remotely administer SQL Server?
 
      What are the effects of switching SQL Server from 'Mixed mode' to 'Windows only' authentication mode? What are the steps required, to not break existing applications?

      Is there a command to list all the tables and their associated filegroups?

      How do you ship the stored procedures, user defined functions (UDFs), triggers, views of my application, in an encrypted form to my clients/customers? How do you protect intellectual property?

      How do you archive data from my tables? Is there a built-in command or tool for this?

      How do you troubleshoot ODBC timeout expired errors experienced by applications accessing SQL Server databases?

      How do you restart SQL Server service automatically at regular intervals?

      What is the T-SQL equivalent of IIF (immediate if/ternary operator) function of other programming languages?

      How do you programmatically find out when the SQL Server service started?

      How do you get rid of the time part from the date returned by GETDATE function?
     
      How do you upload images or binary files into SQL Server tables?

      How do you run an SQL script file that is located on the disk, using T-SQL?

      How do you get the complete error message from T-SQL while error handling?

      How do you get the first day of the week, last day of the week and last day of the month using T-SQL date functions?

      How do you pass a table name, column name etc. to the stored procedure so that I can dynamically select from a table?

      Error inside a stored procedure is not being raised to my front-end applications using ADO. But I get the error when I run the procedure from Query Analyzer.

      How do you suppress error messages in stored procedures/triggers etc. using T-SQL?

      How do you save the output of a query/stored procedure to a text file?

      How do you join tables from different databases?

      How do you join tables from different servers?
 
      How do you convert timestamp data to date data (datetime datatype)?

      Can I invoke/instantiate COM objects from within stored procedures or triggers using T-SQL?

      Oracle has a rownum to access rows of a table using row number or row id. Is there any equivalent for that in SQL Server? Or How do you generate output with row number in SQL Server?

      How do you specify a network library like TCP/IP using ADO connect string?

      How do you generate scripts for repetitive tasks like truncating all the tables in a database, changing owner of all the database objects, disabling constraints on all tables etc?

      Is there a way to find out when a stored procedure was last updated?

      How do you find out all the IDENTITY columns of all the tables in a given database?

      How do you search the code of stored procedures?

      How do you retrieve the generated GUID value of a newly inserted row? Is there an @@GUID, just like @@IDENTITY?