Tag Archives: database

How do you check if automatic statistic update is enabled for a database?

The following query can be used to determine if Automatic Statistic update is enabled: Continue reading How do you check if automatic statistic update is enabled for a database?

How do you get data from a database on another server?

If you want to import data only through a T-SQL query, then use the OPENDATASOURCE function. To repeatedly get data from another server, create a linked server and then use the OPENQUERY function or use 4-part naming. Continue reading How do you get data from a database on another server?

Rename a published SQL Server database

Scenario

I have a transactional replication configured in production. I am wondering if we could rename the publication database in transactional replication without having to drop and recreate the replication set up. Also, is it possible to rename the database files of the publication database without affecting the replication configuration.

Solution

Let’s look at three different scenarios for renaming a database:

  • Renaming the Publication Database
  • Renaming the Publication Database Logical File Names
  • Renaming the Publication Database Physical Files

Continue reading Rename a published SQL Server database

Database mail setup for Gmail,Hotmail,Yahoo or AOL

Scenario

One great feature of SQL Server is the ability to get alerts when there are issues.  The alert process can send email notifications using Database Mail after you have configured your SMTP settings and setup your jobs and alerts to use this account.  In some cases you may not have a mail server, but still want to setup alerts.  In this tip we will walk through how you can setup Database Mail to use email services like Gmail, Hotmail, Yahoo, etc…

Solution

For this example, I have a SQL Server test environment configured and I want to test the alert mechanism using Hotmail. The following outlines the settings to do this. Continue reading Database mail setup for Gmail,Hotmail,Yahoo or AOL