Tuesday 24 November 2009

New sql question

How many levels of Nesting a stored Procedure we can Have? 32
How can we fetch the last Identity Column Inserted in the Table @@IDENTITY,SCOPE_IDENTITY(), IDENT_CURRENT(‘DataTable’)

What is maximum number of subqueries we can write in query in SQL Server 32
What is maximum number of parameters we can add in a stored procedure 2100
Which of the following function will generate a new guid/uniqueidentifier in SQL Server
NEWID()
Which of the following function will return last value inserted into the IDENTITY column of a table @@IDENTITY
How many NonClustered Indexes be able to Created on a Table?
Which index will be created on a table by default using unique key? Non-Clustered Index

What's the maximum value can an INT data type hold? 2,147,483,647
How will you throw exception from stored procedure? @@raiseerror

You can view the nest level in a stored procedure by using the following command: SELECT @@NESTLEVEL

In SQL Server 2000, the page size is ? 8kb

We can Get List of Triggers :
select * from Sys.Objects where Type='tr'
SELECT *FROM sys.procedures;
SELECT * FROM sys.Tables

Cursor attribute is belonged to the language? pl/sql

Monday 9 November 2009

CAPTCHA ?

!.Full Form Of CAPTCHA ?
Ans:-Completely Automated Public Turing test to tell Computers and Humans Apart"

Saturday 7 November 2009

Please get the 4 th maximum salary from a table without using any sql keyword (TOP,MAX are mot allowed)

Create Table 'Employee' with columns 'Emp_Name'
and 'Salary'. And, Insert some data.....

Cursor:
declare Cursor_Name cursor scroll
for select salary from Emploee order by salary desc
open Cursor_Name
fetch absolute 4 from Cursor_Name
deallocate Cursor_Name

What is difference between TRUNCATE & DELETE?

TRUNCATE SQL Command:

TRUNCATE is faster and uses fewer system and transaction log resources than DELETE.

TRUNCATE removes the data by deallocating the data pages used to store the table’s data, and only the page deallocations are recorded in the transaction log.

TRUNCATE removes all rows from a table, but the table structure and its columns, constraints, indexes and so on remain. The counter used by an identity for new rows is reset to the seed for the column.

You cannot use TRUNCATE TABLE on a table referenced by a FOREIGN KEY constraint.

Because TRUNCATE TABLE is not logged, it cannot activate a trigger.

TRUNCATE can not be Rolled back.

TRUNCATE is DDL Command.

TRUNCATE Resets identity of the table.

DELETE SQL Command:

DELETE removes rows one at a time and records an entry in the transaction log for each deleted row.

If you want to retain the identity counter, use DELETE instead. If you want to remove table definition and its data, use the DROP TABLE statement.

DELETE Can be used with or without a WHERE clause
DELETE Activates Triggers.
DELETE can be Rolled back.
DELETE is DML Command.
DELETE does not reset identity of the table.

-----------------------------------------------------------
This is the most appropriate answer.
-----------------------------------------------------------


Is This Answer Correct ? 0 Yes 0 No

Monday 2 November 2009

C# question:-

1.Which is the default access modifier of Interface?
Ans:-Public
2.f the method is___________,then we can call the method without creating the instance of the class.
A:-Static
3. Is it possible to restrict accessibility of base class method to child class?
A:Yes
4.Which is the top .NET class from which all thing is derived?
A:System.object
5.What is Denormalization???
A:-De normalization is a technique to move from higher to lower normal forms of database modeling in order to speed up the query processing.
6.In C# Thread.Sleep(time) measures time in:
A:-milliseconds
7.Every class directly or indirectly extends the______class.
A:-Object
8.A variable declared inside a method is called a________variable?
A:-Local
9.An instance method is
A:-Represents the behavior of an object
10.Difference between Value Types and Reference Types?
A:-Value types directly contain their data (while) Reference types can be self-describing types
11. how to pass double "quoted string " with in string variable?
a:-@"""premjit Mohanty"""
12.The maximum size of the textbox is
a:-65536
13.

SET THE COOKIE

SET THE COOKIE

Response.Cookies["test"].Value = TextBox1 .Text ;

Response.Cookies["test"].Expires = DateTime.Now.AddYears(30);

After that

How to Expried Cookie

Response.Cookies["test"].Expires = DateTime.Now.AddYears(-30);

How to Write/Read cookie

/////////check to see if cookie presented//////////

if (Request.Cookies["test"] == null)

{

TextBox2.Text = "No cookie found";

}

Else

{

TextBox2 .Text = Request.Cookies["test"].Value;

}

/////////END check to see if cookipresented//////////