thiyagaraj


{ City }
< Country > india
* Profession *
User No # 15834
Total Questions Posted # 0
Total Answers Posted # 4

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 129
Users Marked my Answers as Wrong # 30
Questions / { thiyagaraj }
Questions Answers Category Views Company eMail




Answers / { thiyagaraj }

Question { 38609 }

What is the difference between a local and a global variable?


Answer

Local Variable :
The scope or lifetime of the local variable
is with in a block or procedure..
Eg: DECLARE @Variable1

Global Variable :
The scope or lifetime of the global
variable throughout the execution of the program..
Eg: DECLARE @@Variable1

Is This Answer Correct ?    119 Yes 23 No

Question { 6739 }

How do you use DBCC statements to monitor various aspects of
a SQL server installation?


Answer

DBCC stands for database consistency checker. We use these
commands to check the consistency of the databases, i.e.,
maintenance, validation task and status checks.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.

Is This Answer Correct ?    3 Yes 1 No


Question { 7439 }

Can a stored procedure call another stored procedure. If yes
what level and can it be controlled?


Answer

Yes, a stored procedure can call another stored procedure.
It can be controlled at any levels..

Is This Answer Correct ?    5 Yes 5 No

Question { 7412 }

In one table there is 10 records without id num,without
primary key and it is not sorted then how to extract last 6
record from table?


Answer

CREATE TABLE Sample
(
Col1 varchar(5)
)
insert into Sample values('j')

TABLE:
Col1
j
r
c
r
e
f
g
h
x
j

USING CURSOR: ANSWER

DECLARE @COL1 VARCHAR(5)
DECLARE @COUNT VARCHAR(5)
SET @COUNT=0
DECLARE c1 CURSOR
FOR
SELECT COL1 FROM SAMPLE
OPEN C1
FETCH NEXT FROM C1
INTO @COL1
WHILE @@FETCH_STATUS=0
BEGIN
SET @COUNT=@COUNT+1
IF @COUNT>=5
BEGIN
SELECT @COL1
END
FETCH NEXT FROM C1
INTO @COL1
END
CLOSE C1
DEALLOCATE C1

Is This Answer Correct ?    2 Yes 1 No