|
|
-
|
|
Yesterday, I posted about
SQL Server – Management Studio – Schema Changes History Report and Default
Trace and their limitations. It does not capture the details of modification. i.e.
When a new column is added to a table, you can find out when the changes to th......
|
|
-
|
|
Schema Changes History Report produces the list of changes done using DDL. It pulls this information from the Default Trace.
You can access the report from Management Studio:
1. Right Click on Database, for which you want to view the report,
2. Go to Reports > Standard Reports > Schema Changes Hi......
|
|
-
|
|
Since SQL Server 2005 we have LOGON Triggers, these are DDL Triggers which are created
at Server level. These triggers are created to respond to a Login Event. LOGON Trigger
executes after the Authentication has been made successfully.
LOGON Triggers can be useful in may ways,......
|
|
-
|
|
By using GROUPING SETS() we can specify multiple groupings in a single query.
GROUPING SETS() generates the result by producing a UNION ALL set
of the result sets generated by specified grouping sets.
for example, consider below data:
-- © 2011 – Vishal (http://Sql......
|
|
-
|
|
SQL Server Login Auditing can be used to monitor login activities on SQL Server Database Engine. SQL Server can log both failed and successful login attempts on the server. It provides four different options for Login Auditing.
1. None – No Login activity is logged,
2. Failed logins only &nd......
|
|
-
|
|
CUBE() produces the result set by generating all combinations of columns specified in GROUP BY CUBE(). As with GROUP BY ROLLUP() it adds sub-total and grand-total rows as well.
For example, consider below data:
-- © 2011 – Vishal (http://SqlAndMe.com)
SELECT [Group], [Name], [S......
|
|
-
|
|
GROUP BY groups the result set into summary rows by provided columns. For example, consider below data which contains sales figures by region.
Group Name SalesYTD
—————— ——————- ......
|
|
-
|
|
STUFF() can be used to stuff a string into another string. It inserts the string at a given position, and deletes the number of characters specified from the original string.
-- © 2011 – Vishal (http://SqlAndMe.com)
DECLARE @string1 VARCHAR(20) = 'Microsoft Server'
DECLARE @string2 ......
|
|
-
|
|
CHARINDEX()
can only be used to search a literal string in the specified expression. In other
words you cannot use wildcards. PATINDEX() provides this capability. It takes
two arguments, the pattern to be searched and the expression.
– © 2011 – Vishal (http://S......
|
|
-
|
|
CHARINDEX() returns the starting position of an expression in another expression.
It takes below arguments:
CHARINDEX ( exp1, exp2, position )
Where, exp1 = expression to be searched,
exp2 = the main expression which contains exp1,
position = this is optional, it spe......
|
|