|
|
-
58 Liked
| 55 Learned
| 18 Comments
|
|
Suppose you have three tables named test1,test2 and test3 and you want to drop all these three, you can do it in a single DROP statement
[code]DROP table test1,test2,test3[/code]......
|
|
-
49 Liked
| 46 Learned
| 31 Comments
|
|
Suppose you have a huge table which has say 30-40 columns and you want to select all of them or most of them say around 30 columns. It is a tedious job to type each of the column names. Here is a quick way to get a comma separated list of all the column......
|
|
-
44 Liked
| 42 Learned
| 11 Comments
|
|
The IN clause in T-SQL can be used to find a single value present in any one of multiple supplied columns. For example, in the AdventureWorks database:
[code]
SELECT Title, FirstName, MiddleName, LastName, Suffix
FROM Person.Contact
WHERE 'Lee' I......
|
|
-
37 Liked
| 29 Learned
| 18 Comments
|
|
Goto www.google.com, type 3+4 in the search text box and press enter. You can also do something like 12*(5+5)-12/4......
|
|
-
25 Liked
| 27 Learned
| 3 Comments
|
|
I have been working on creating my demo scripts for "Tech-ED India 2012" and while trying different options, realized that the FORMAT function can be (mis)used to embed external strings into the format specification.
PRINT FORMAT( GETDATE(), '"-...
|
|
-
37 Liked
| 26 Learned
| 5 Comments
|
|
What if you want to find out if a specific field contains a certain value?
For example you want to find out all employees who have 0 vacation hours and 0 sickhours.
Common way is to write a where clause with 'or'.
Another way to do this is to use 'i......
|
|
-
20 Liked
| 25 Learned
| 13 Comments
|
|
Recently read an article, which explains the surprising trick to reveal the folder which has all system management shortcuts.
1. Create a new folder in any of drives.
2. Rename the folder with the text "GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}......
|
|
-
27 Liked
| 22 Learned
| 5 Comments
|
|
While you are working in Query window, if you want to delete the current row, you have to highlight entire row and press delete key. Another alternate is to use SHIFT+DEL key. The cursor can be at any position and the entire row will be deleted......
|
|
-
23 Liked
| 21 Learned
| 3 Comments
|
|
How do I know which deprecated features I’m using?
To find out, run the following query:
[code]
SELECT instance_name AS 'Deprecated Feature', cntr_value AS 'Times Used'
FROM sys.dm_os_performance_counters
WHERE object_name = 'SQLServer:Deprecated F......
|
|
-
19 Liked
| 21 Learned
| 8 Comments
|
|
Assume that there are two tables table1 and table2 which have same structures and table1 has 10 millions rows and you want to move all rows from table1 to table2. The quickest method that I have learnt is to use Partition Switching
[code]
alter table......
|
|