SQL Server Interview Questions
Questions Answers Views Company eMail

In the below query i have performed the commit transaction statement but still the values after the save are not saved. Can you please let me know why are the statements after save are rolled back even after commiting the data. help me with the understanding declare @trans2 varchar(10)='transaction2' begin transaction @trans2 insert into emp values(100,'xy',600); save transaction @trans2 insert into emp values(200,'pq',700); insert into emp values(300,'pq',800); commit transaction @trans2 rollback tran @trans2

AllState,

1 1710

Repair mdf file

2 1462

Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you

655




sql database suspect We have a sql database that is showing as suspect. How can we recover?

766

what is cursor?why we will go to cursor?advantages &disadvantages of cursors?

1 1303

How do you find value of first column before inserting value into the second column in the same table for checking that second column must have different value than first column.

L&T,

2 2403

How do I repair damaged sql server mdf file database? In previous day my mdf file has got damage due to unknown reasons then I used dbcc chekcdb command but it failed, MDF file is important for me, I don’ know that how to get back mdf file data. Please anyone suggest me?

673

Restore database SQL2000, SQL2012 Backup of base is created in Microsoft SQL Server 2000 - 8.00.2066, I can't restore on Microsoft SQL Server 2012 - 11.0.2100.60

IT Decisions,

3 1476




two tables are there.1st table EMP has two columns ID and name and contains data 1,A 2,B 3,C 2nd table EmpSal has 2 columns ID and Salary Contains data -1,1000 2,5000 3,3000 Find name of employee having maximum salary ?

CSE,

5 1959

I have a table emp , Fields with empname,dnname,dno,salary. now I want copy distinct salary with all emp detail from emp into new table which is not already exist in database. how would I do this ?

Techno Labs,

2 1583

how to copy only distinct data into another table which is not already exist in database?

Spectra,

2 2178

difference between function and procedure

HCL, Theorem, TCS, Cognizant,

3 2422

2) Consider a Table name A which has below records ID --- 5 5 5 5 5 Consider another table B which has below records ID -- 5 5 5 5 5 5 5 5 How many rows will be returned by each of the below queries a) select * from A inner join B on A.id = b.ID b) select * from A left join B on A.id = b.ID c) select * from A right join B on A.id = b.ID

Synechron, TCS,

2 2376

How to read 2nd highest sal from EMP table?

IBM, TCS,

5 2399

how to overcome kernel isssues

Fortune,

515


Post New SQL Server Questions






Un-Answered Questions { SQL Server }

What is Lock table in SQL?

327


what is the Ticketing tool used in Wipro technologies at Bangalore...???

5219


Explain Capacity planning to create a database? and how to monitor it?

2906


How to check what was the last restore transaction LSN in Log shipping or Mirroring? when we don't have a Monitor or witness server.

2731


how to take backup bcp out for a column in table in sql server?

902






how can you select rexcord(rows) from table A which is not present in Table B . Id being the FK in Table B referencing to ID Table A

425


Delete duplicate rows without using rowid.

243


What are the dis_advantages of stored procedures, triggers, indexes?

1022


role of sql sever 2005 in database rather than any other database

924


what’s the difference between Covering Indexes and Clustered Indexes ? how to use clustered index small ?

912


What is RMS migrations?

1006


In one interview...interviewer ask me question pleas tell me sql server architecture.. can any body tell me the sql server architecture with digram

859


how do you determine the Load performance of any query in sql server {example how do u determine performance of a select stmnt which returns Dynamically many no of records ... some times 100,1000,10000 etc., }

1100


If a stored procedure is taking a table data type, how it looks?

4761


Why do you want to join software field as you have done your BE in Electronics?

1071