SQL Server Interview Questions
Questions Answers Views Company eMail

Delete duplicate rows from a table without primary key by using a single query Table Employee empname salary A 200 B 300 A 200 C 400 D 500 D 500 Output should be A 200 B 300 C 400 D 500

14 12802

One table Test with single column. These are the values in the table a b c d e f g h I need a query (without using any variable) with output as - a b c d e f g h

1 1745

how to get the maximum among two tables,for example table 1 (dep1) have (emp_id,emp_name,salary) columns and table 2 (dept2) have (emp_id,emp_name,salary) columns,i want which employee have the maximum salary among two tables?

Deloitte, Lason,

9 17918

A left outer join B B right outer join A gives the same result then what is the use of two?

1 3444



2 6044

event classes in sql server

Accenture, AFE,

2 4469


L&T, CarrizalSoft Technologies,

4 7305

what is macro?

Wipro, Excel, Global Innovation,

5 8529

After recovering the database by using tail log backup.How to verify the data has been sucessfully restored or not.?



A successfully created SSIS package in SQL Server 2005 runs fine in MS BIDS and Integration Services. But gives error when run through an SQL-Job. What are the possible reasons?


2 3044

What is the disadvantage of using subquery exact after a select statement?ex. select (select * from sometable)

1 9719

What is Files and Filegroups in SQL Server & it's implementation.


1 6543

What is the joins and how many types of Joins in sql server a diffrentiate ever one give a suaitable query


2 3815

what is the difference detween pairwise comparison subquary and non pairwise comparison subquary?

2 11986

Diff between Composite key, Alternate Key, Candidate Key, Primary Key, Unique Key, Super Key, Foreign Key

1 8687

Post New SQL Server Questions

Un-Answered Questions { SQL Server }

I have a table Events Events containing cardno,time,id,name--each id has a cardno my requirement is every day each employee swipe the card several times i want to calculate first and last time of each card the output should be name 1 2 6 7 in out in out holiday holiday xxx 09:30 06:30 09:40 06:45 where 1,2...... are dates for example january 1,2, etc. 6 and 7 are saturday and sunday how it is posssible


If the job running very slow what is the action you do


This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?


What is Fragmentation and Defragmentation? For 32GB Table,How can we do the fragmentation?


Which is the best place or learning center for MS SQL?????In Bangladesh?????


1.how to find the dead lock in sql server? 2.How to fine the memory leaks in sql server? 3.suppose transaction log file increasing what action will take ?


How do use Having,Group by,Group function in SQL?


Issues related in upgrading SQL Server 2000 to 2005 / 2008


how to overcome kernel isssues


You are doing log shipping due to some reasons it is failing. How you will proceed from there


Write a Select Query to display title for each group of records, which are collected with Compute Clause? Like titlefield column-A column-B ..... ..... ..... Sum ... titlefield column-A column-B ..... ..... ..... Sum ...


tell me the disaster recovery plan


hi, the following are the outputs of sp_spaceused and sp_tempdbspace sp_spaceused ------------ database size unallocated size tempdb 77752.95 MB 28026.99 MB sp_tempdbspace ------------- database size spaceused tempdb 77752.945312 1.007812 the unused space in sp_spaceused is nearly 28 Gb and in sp_tempdbspace is nearly 76 Gb cany any one explain about this output and why its giving different results.


which backup strategy you are following at ur company


In my application I have a process which picks the scanned files (tif format) from a shared location and it links to application and shown on it.The actuall issue is that my process picks the file before it is completly written or scanned which results in displaying few parts of the image or incomplete image.I need to check if the file is not completly scanned or written then do not link it to application.Please help if any body tell me that how can i check that file is in written phase or locked through DTS.thanking you in advance