Home > MSSQL > SQL Server Basic Queries

SQL Server Basic Queries

SELECT sqlserver_start_time FROM sys.dm_os_sys_info

SQL Server TempDB Relocation:

Alter  database  tempdb  modify  file (name = tempdev, filename = ‘E:\Sqldata\tempdb.mdf’)

Alter  database  tempdb  modify  file (name = templog, filename = ‘E:\Sqldata\templog.ldf’)

SQL Server Default Mail Profile Find:

exec msdb.dbo.sysmail_help_principalprofile_sp

Send Test Mail From SQL DB Mail Profile:

EXEC msdb.dbo.sp_send_dbmail
@profile_name = ‘profilename’,
@recipients=’abc@example.com’  ,
@subject =’Test Mail’,
@body =’This is a test message sent from the newly created database mail account’ ,
@body_format = ‘html’

Advertisements
Categories: MSSQL
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: