|
|
-
13 Liked
| 14 Learned
| 3 Comments
|
|
Today my colleague asked me a question, "how to find size of table only for certain rows?". My initial reply was "No. Its not possible". However, immediately sys.fn_PhysLocFormatter(%%Physloc%%) struck in my mind, which gives the page number. By findi......
|
|
-
13 Liked
| 13 Learned
| 16 Comments
|
|
Hi,
Just now i Wrote one query to remove special characters from a string..
Hope this is useful.
DECLARE @I VARCHAR(100)
SELECT @I ='abhi *s d ^.l'
WHILE PATINDEX('%[^A-Za-z0-9 ]%' , @I ) <> 0
BEGIN
SELECT @I= STUFF(@I,PATIN...
|
|
-
14 Liked
| 13 Learned
| 1 Comments
|
|
From, SQL Server help file,
"An UPDATE, INSERT, or DELETE statement that has an OUTPUT clause will return rows to the client even if the statement encounters errors and is rolled back. The result should not be used if any error occurs when you run th......
|
|
-
13 Liked
| 13 Learned
| 1 Comments
|
|
We might have used below commands while working on Tuning to identify the CPU time, Elapse Time and ,No.of Reads.
SET STATISTICS IO ON
SET STATISTICS TIME ON
We can combine this two commands on a single line by separating them with commas as bel......
|
|
-
12 Liked
| 13 Learned
| 1 Comments
|
|
Recently I noticed that Deleting a database which is in offline leaves physical files intact......
|
|
-
15 Liked
| 13 Learned
| 2 Comments
|
|
Yesterday, in PASS summit. SQL Server 2012 has been announced. Denali is going to be named as SQL Server 2012 and will be released in first half of next year.......
|
|
-
16 Liked
| 12 Learned
| 11 Comments
|
|
Hi,
We know the hint , how to get all the column names of a table into query window using drag and drop of Columns Folder under TableName.
![SSMS Hint][1]
Today , i learned another method to do the same,
**Select the query** and **right click** on...
|
|
-
13 Liked
| 12 Learned
| 1 Comments
|
|
sysname is a special datatype and by default it does not allow NULL, you need to explicitly add NULL in table definition to allow null. sysname is defined as
nvarchar(128) not null
Below code will give error
declare @t1 table ( c1 int, c2 sy...
|
|
-
13 Liked
| 12 Learned
| 1 Comments
|
|
With help of below query we can quickly find the node on which sql is currently running. This is useful in clustered environments.
Select serverproperty('ComputerNamePhysicalNetBIOS')...
|
|
-
12 Liked
| 12 Learned
| 4 Comments
|
|
Just tried to move a 400 GB table into a new file group by rebuilding the clustered index. After the operation, only 200 GB of data was moved to the new file group.
That reminded me that, when rebuilding a clustered index into a new file group only t......
|
|