SQL SERVER – What is a NULL value and What are the pros and cons of using NULLS
A NULL value takes up one byte of storage and indicates that a value is not present as opposed to a space or zero value. A NULL is not a space or empty string or a zero. But some value undefined...
View ArticleSQL SEREVER – What is a View and An Indexed View
A view is a virtual tables that is made up of one or more tables. It can be used for security purpose, hiding complex queries. An Indexed view is a view that has unique clustered index created on it....
View ArticleSQL SERVER – What is the difference of a LEFT JOIN and an INNER JOIN statement
A LEFT JOIN will take ALL values from the first declared table and matching values from the second declared table based on the column the join has been declared on. An INNER JOIN will take only...
View ArticleSQL SERVER – What is the difference between group by and order by
Group by controls the presentation of the rows, order by controls the presentation of the columns for the results of the SELECT statement. EX 1 : Group By helps us display any aggregate of any column...
View ArticleSQL SERVER 2008 – How to rename a column
There are many ways where in we can rename a column but what I prefer is using predefined stored Procedure sp_rename . Syntax : exec sp_rename ‘tablename.ColumnName’, ‘NewColumnName’, ‘column’...
View ArticleSQL SERVER – What is @@Rowcount, @@Error and @@Identity
@@Rowcount is used to display the number of rows affected by last SQL statement. @@Error displays the error number for the last SQL statement executed. The value is zero,if there is no error....
View ArticleSQL SERVER – what are the DBCC commands that are commonly use for database...
DBCC CHECKDB, DBCC CHECKTABLE, DBCC CHECKCATALOG, DBCC CHECKALLOC, DBCC SHOWCONTIG, DBCC SHRINKDATABASE, DBCC SHRINKFILE etc. But there are a whole load of DBCC commands which are very useful for DBAs....
View ArticleSQL SERVER – CREATE INDEX myIndex ON myTable(myColumn)What type of Index will...
Non-clustered index. Important thing to note: By default a clustered index gets created on the primary key, unless specified otherwise. Reference : Dilip Kumar Jena ( http://sqlexplore.wordpress.com )
View ArticleWe have a table with a CHARACTER data type field. We apply a “>” row...
This is something so many asked me because I also faced the same situation before, so having a NULL in a row when compared will give an UNKNOWN result. The result will not be correct hence creates an...
View ArticleSQL SERVER – How to work with Row Constructors , inserted and deleted tables...
There are many ways to track changes made to the table in SQL Server one of the method is to use inserted and deleted tables and get the result set and use in code appropriately. Step 1: Creating Table...
View Article
More Pages to Explore .....