Quantcast
Channel: SQL 2005 – Sql And Me
Browsing all 27 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

SQL Server – Auditing Schema Changes using DDL Triggers

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...

View Article


Image may be NSFW.
Clik here to view.

SQL Server – Denali CTP3 – DATEFROMPARTS() and TIMEFROMPARTS()

These are new functions in SQL Server "Denali". DATEFROMPARTS() returns a DATE value with specified day, month and year. It takes three arguments: DATEFROMPARTS (@Year, @Month, @Day) If the arguments...

View Article


Image may be NSFW.
Clik here to view.

SQL Server – Denali – Management Studio – Restore Database

In Management Studio 2008 R2, restore database dialog is as below: Management Studio 2008 R2 You need to select the backups which you need to restore from the backup set list. This dialog box is...

View Article

Image may be NSFW.
Clik here to view.

SQL Server –"Denali"– String Formatting using FORMAT()

SQL Server "Denali" introduces a new function FORMAT() for formatting of DATETIME and numeric values. In Earlier versions we did date and time conversions using CAST and CONVERT as below: – © 2011 –...

View Article

Image may be NSFW.
Clik here to view.

SQL Server –"Denali"– Conditional Operator/Logical Function – IIF()

Denali introduces a new function IIF(), which is a shorthand way of writing a CASE expression. IIF() evaluates specified expression and returns specified true/false values. You might be already...

View Article


Image may be NSFW.
Clik here to view.

SQL Server – Horizontally partitioning a SQL Server Database Table

Partitioning was introduced in SQL Server 2005, it allows you to different database files, which can be located on different disks to improve performance. In earlier versions this was achieved by...

View Article

Image may be NSFW.
Clik here to view.

SQL Server –"Denali”– String Concatenations using CONCAT()

“Denali” introduces a new function CONCAT() for string concatenation. CONCAT() returns a string by concatenating two or more strings. CONCAT() requires 2 to 254 arguments. for example, CONCAT() can be...

View Article

Image may be NSFW.
Clik here to view.

SQL Server –"Denali"– End of Month using EOMONTH()

SQL Server Denali CTP3 introduces a new date/time function EOMONTH(). EOMONTH() returns the last day of the month for the given date. It also accepts an optional argument which is an integer expression...

View Article


Image may be NSFW.
Clik here to view.

SQL Server –"Denali"– Conversion Function – PARSE() and TRY_PARSE()

PARSE() and TRY_PARSE() are new function introduced in SQL Server Denali. PARSE() returns the result of an expression, translated to specified data type if the translation is possible, otherwise, it...

View Article


Image may be NSFW.
Clik here to view.

SQL Server –"Denali"– Analytic Functions – LAG() and LEAD()

LAG() function can be used to access data from a previous row in the result set without using a self-join. And it’s counterpart LEAD() can be used to access data from a subsequent row in the same...

View Article

Image may be NSFW.
Clik here to view.

SQL Server – How to check if you are running 32-bit or 64-bit version

There are two different command you can use to check if you are running 32-bit or 64-bit version of SQL Server. Using @@VERSION: You can user @@VERSION system variable to determine edition and...

View Article

Image may be NSFW.
Clik here to view.

SQL Server – Finding TCP Port Number SQL Instance is Listening on

By default SQL Server listens on TCP port number 1433, and for named instances TCP port is dynamically configured. There are several options available to get the listening port for SQL Server Instance....

View Article

Image may be NSFW.
Clik here to view.

SQL Server – How to find Default data and log path for SQL Server 2012

To identify default data and log directories in SQL Server 2012 you can use SERVERPROPERTY() function. In SQL Server 2012 two new parameters are added to SERVERPROPERTY() function namely,...

View Article


Image may be NSFW.
Clik here to view.

SQL Server – How to Move Table to Another Schema

Starting with SQL Server 2005 all tables are grouped into schemas. While creating a table if the schema name is not specified it is created in the default schema of the user creating it. you can use...

View Article

Image may be NSFW.
Clik here to view.

SQL Server – Get SQL Server Service Account using T-SQL

SQL Server service account information is stored in Windows Registry database. You can get this information from Services Console or SQL Server Configuration Manager. To get account information from...

View Article


Image may be NSFW.
Clik here to view.

SQL Server – How to get last access/update time for a table

Modify date and create date for a table can be retrieved from sys.tables catalog view. When any structural changes are made the modify date is updated. It can be queried as follows: USE [SqlAndMe] GO...

View Article

Image may be NSFW.
Clik here to view.

SQL Server – Different Ways to Check Object Definition

sp_helptext is widely used for checking object definition in SQL Server. sp_helptext can be used to check definition of various database objects like Views, Stored Procedures and User Defined...

View Article


Image may be NSFW.
Clik here to view.

SQL Server –"Denali"– End of Month using EOMONTH()

SQL Server Denali CTP3 introduces a new date/time function EOMONTH(). EOMONTH() returns the last day of the month for the given date. It also accepts an optional argument which is an integer expression...

View Article

Image may be NSFW.
Clik here to view.

SQL Server –"Denali"– Conversion Function – PARSE() and TRY_PARSE()

PARSE() and TRY_PARSE() are new function introduced in SQL Server Denali. PARSE() returns the result of an expression, translated to specified data type if the translation is possible, otherwise, it...

View Article

Image may be NSFW.
Clik here to view.

SQL Server –"Denali"– Analytic Functions – LAG() and LEAD()

LAG() function can be used to access data from a previous row in the result set without using a self-join. And it’s counterpart LEAD() can be used to access data from a subsequent row in the same...

View Article
Browsing all 27 articles
Browse latest View live


Latest Images