-->
SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

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

There are two other options which can be used to retrieve object definition:

OBJECT_DEFINITION( object_id ) – is a built-in… Read more

2 comments, 797 reads

Posted in SQL and Me on 14 April 2014

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

There are two other options which can be used to retrieve object definition:

OBJECT_DEFINITION( object_id ) – is a built-in… Read more

2 comments, 147 reads

Posted in SQL and Me on 14 April 2014

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

There are two other options which can be used to retrieve object definition:

OBJECT_DEFINITION( object_id ) – is a built-in… Read more

2 comments, 11 reads

Posted in SQL and Me on 14 April 2014

SQL Server – Hide system objects in Object Explorer – SQL Server Management Studio

By default, SQL Server system objects are listed in Object Explorer in Management Studio. These system objects include system database, system tables/views/procedures and so on.

SQL Server Management Studio provides an option to hide these objects from Object Explorer to prevent *accidental* use.

To enable this option follow below steps. Read more

1 comments, 22 reads

Posted in SQL and Me on 7 April 2014

SQL Server – Hide system objects in Object Explorer – SQL Server Management Studio

By default, SQL Server system objects are listed in Object Explorer in Management Studio. These system objects include system database, system tables/views/procedures and so on.

SQL Server Management Studio provides an option to hide these objects from Object Explorer to prevent *accidental* use.

To enable this option follow below steps. Read more

1 comments, 2,857 reads

Posted in SQL and Me on 7 April 2014

SQL Server – Hide system objects in Object Explorer – SQL Server Management Studio

By default, SQL Server system objects are listed in Object Explorer in Management Studio. These system objects include system database, system tables/views/procedures and so on.

SQL Server Management Studio provides an option to hide these objects from Object Explorer to prevent *accidental* use.

To enable this option follow below steps. Read more

1 comments, 195 reads

Posted in SQL and Me on 7 April 2014

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

SELECT    [TableName] = name,
create_date,
modify_date
FROM    sys.tables
WHERE    name = 'TransactionHistoryArchive'
GO

 

  Read more

2 comments, 118 reads

Posted in SQL and Me on 11 March 2014

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

SELECT    [TableName] = name,
create_date,
modify_date
FROM    sys.tables
WHERE    name = 'TransactionHistoryArchive'
GO

 

  Read more

2 comments, 2,780 reads

Posted in SQL and Me on 11 March 2014

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

SELECT    [TableName] = name,
create_date,
modify_date
FROM    sys.tables
WHERE    name = 'TransactionHistoryArchive'
GO

 

  Read more

2 comments, 12 reads

Posted in SQL and Me on 11 March 2014

SQL Server – Displaying line numbers in Query Editor – SSMS

You can enable line numbers to be displayed in SSMS Query Editor. This is extremely useful when working on a large module.

To enable line numbers in Query Editor windows, follow below steps:

Step1: Go to Tools > Options

Step2: In the Options dialog box navigate to Text Editor >… Read more

0 comments, 10 reads

Posted in SQL and Me on 20 January 2014

SQL Server – Displaying line numbers in Query Editor – SSMS

You can enable line numbers to be displayed in SSMS Query Editor. This is extremely useful when working on a large module.

To enable line numbers in Query Editor windows, follow below steps:

Step1: Go to Tools > Options

Step2: In the Options dialog box navigate to Text Editor >… Read more

0 comments, 683 reads

Posted in SQL and Me on 20 January 2014

SQL Server – Displaying line numbers in Query Editor – SSMS

You can enable line numbers to be displayed in SSMS Query Editor. This is extremely useful when working on a large module.

To enable line numbers in Query Editor windows, follow below steps:

Step1: Go to Tools > Options

Step2: In the Options dialog box navigate to Text Editor >… Read more

0 comments, 173 reads

Posted in SQL and Me on 20 January 2014

SQL Server – Difference between @@CONNECTIONS and @@MAX_CONNECTIONS

@@MAX_CONNECTIONS in SQL Server returns maximum number of simultaneous user connections allowed. Maximum user connections allowed by SQL Server by default is 32,767; this number also depends on application and server hardware limits. This cam also be configured at server-level to avoid too many connections.

@@CONNECTIONS returns number of connection… Read more

0 comments, 130 reads

Posted in SQL and Me on 13 January 2014

SQL Server – Difference between @@CONNECTIONS and @@MAX_CONNECTIONS

@@MAX_CONNECTIONS in SQL Server returns maximum number of simultaneous user connections allowed. Maximum user connections allowed by SQL Server by default is 32,767; this number also depends on application and server hardware limits. This cam also be configured at server-level to avoid too many connections.

@@CONNECTIONS returns number of connection… Read more

0 comments, 933 reads

Posted in SQL and Me on 13 January 2014

SQL Server – Difference between @@CONNECTIONS and @@MAX_CONNECTIONS

@@MAX_CONNECTIONS in SQL Server returns maximum number of simultaneous user connections allowed. Maximum user connections allowed by SQL Server by default is 32,767; this number also depends on application and server hardware limits. This cam also be configured at server-level to avoid too many connections.

@@CONNECTIONS returns number of connection… Read more

0 comments, 10 reads

Posted in SQL and Me on 13 January 2014

SQL Server – Different ways to check Recovery Model of a database

A Recovery Model is property of a database which control how transaction log is maintained. SQL Server supports SIMPLE, FULL and BULK-LOGGED recovery models.

There are multiple ways to check recovery model of a database in SQL Server.

1. Using SQL Server Management Studio:

Right click on Database in… Read more

1 comments, 9 reads

Posted in SQL and Me on 6 January 2014

SQL Server – Different ways to check Recovery Model of a database

A Recovery Model is property of a database which control how transaction log is maintained. SQL Server supports SIMPLE, FULL and BULK-LOGGED recovery models.

There are multiple ways to check recovery model of a database in SQL Server.

1. Using SQL Server Management Studio:

Right click on Database in… Read more

1 comments, 1,807 reads

Posted in SQL and Me on 6 January 2014

SQL Server – Different ways to check Recovery Model of a database

A Recovery Model is property of a database which control how transaction log is maintained. SQL Server supports SIMPLE, FULL and BULK-LOGGED recovery models.

There are multiple ways to check recovery model of a database in SQL Server.

1. Using SQL Server Management Studio:

Right click on Database in… Read more

1 comments, 141 reads

Posted in SQL and Me on 6 January 2014

SQL Server – Calculating elapsed time from DATETIME

Elapsed time can be calculated from DATETIME field by extracting number of hours/minutes and seconds. You can use below query to calculate elapsed time between two dates:

-- Vishal - http://SqlAndMe.com

DECLARE @startTime DATETIME
DECLARE @endTime DATETIME

SET @startTime = '2013-11-05 12:20:35'
SET @endTime = '2013-11-10 01:22:30'

SELECT	[DD:HH:MM:SS] =…

Read more

8 comments, 112 reads

Posted in SQL and Me on 23 December 2013

SQL Server – Calculating elapsed time from DATETIME

Elapsed time can be calculated from DATETIME field by extracting number of hours/minutes and seconds. You can use below query to calculate elapsed time between two dates:

-- Vishal - http://SqlAndMe.com

DECLARE @startTime DATETIME
DECLARE @endTime DATETIME

SET @startTime = '2013-11-05 12:20:35'
SET @endTime = '2013-11-10 01:22:30'

SELECT	[DD:HH:MM:SS] =…

Read more

8 comments, 5,538 reads

Posted in SQL and Me on 23 December 2013

Older posts