Delete will delete the records one by one where as truncate will delete all the records at a time. Also you can roll back the records if you use the delete statement but not when you use truncate...
Type: Posts; User: nageshkota; Keyword(s):
Delete will delete the records one by one where as truncate will delete all the records at a time. Also you can roll back the records if you use the delete statement but not when you use truncate...
Hi Satheesh,
In SQL server 2005, By default auto commit is on. So if you want to use the commit transaction, then you must have to use the begin and end transactions even to use the roll back.
Yes, Hash table means a temp table.
Hi Saritha,
You use the fallowing query to see the total information of the table. from that you can use to delete or drop the primary or forign keys.
select * from sysobjects where type='u'...
Hi Pooja,
We have 2 types of Hash tables, they are local and global
Local is used as #tablename, which is having the scope with in the SP's or Functions or in Programs, Out of this scope you can...
Prasanth,
u r right u can assign to null value as u given in the sample query, but u can't use the "=" in the where clause, in that case you have to use only "IS".
Priya,
In the database one null value never equals to the another null value, so you can't use "=" for null check. You have to use "IS Null" like that...
Sorry boreddy u cant use month is quotes.
Use
select datename(month, dateadd(month,-1,getdate())), datename(month,
dateadd(month,-2,getdate())),datename(month, dateadd(month,-3,getdate()))
Hi jrameshvjr,
your query will give the only one record, if there are many number of employees holding the same salary then it won't be applicable..
You can use the Query as fallowed
SELECT * FROM <TABLENAME> T1 WHERE n=
(SELECT COUNT(DISTINCT <COLUMNNAME>) FROM <TABLENAME> T2 WHERE T1.<COLUMNNAME> <=T1.<COLUMNNAME>)
where 'n' is the nth...
Hi mobin,
It is possible to create more than one clustred index on a table.
so You answer is wrong...
Self join is joining the one table to itself, but when you come to the corealted queries we can use the different tables and in the corelated queries the inner query executes first, but it will...
If you know the exact value to check then you can use the operator '=' else you can use like operator if some part in the search condition known.
If you know the exact value then better to use '='...
Hi Kadhar,
Your question is not clear, explain some more.
Hi,
This Decode function will work in the Oracle only, but if we use the case then it will work for the all.
You can use the fallowing statement
select * from tablename where the reference conditions
It is not possible to insert a column in the middle of the table, But there is one way to do that in Oracle and SQL Server also. you can insert the column at the end and create a temp table in the...
Hi,
The Self Join is the concept joining the same table to it self, in that we use the alias concept to differ the tables.
In the Outer join we can use 3 types left, right or full, we can use...
Hi,
Guys did you checked the Code, Is this Code works?
In my knowledge it will fail.
If we create a primary key then automatically it creates an unique clusterd index, but for any table there is only one clusterd index is allowed, If i want to create an uniue clusterd index on other...
If we know the columns set then only we can use the case statement, if did not know the column set then what is the way to get?
Y we can't we use that in the function
Hai,
It is very much better to use the sub queries.
If we use the views it is nested upto 32 levels only..
If it crossed you may get errors.
Is it possible for us to create a table or update a table or delete a table in the function?
To delete the duplicate data we may use the temporory tables, but with out using any teporory tables can we delete the duplicated data, if how it is possible?