SQLServer DBA常見問題
In the latest installment of the SQL Server interview questions, we will outline questions suitable for a DBA interview to assess the candidates skills related to SQL Server system databases. In this tip, the questions are there to read, but the answers are intentionally hidden to really test your skills. Once you read the question and have determined your answer, then highlight the answer to see how you did.
Solution
Question Difficulty = Easy
Question 1: What are the SQL Server system databases and can you outline the general functionality of each database?
Master - Database responsible for SQL Server instance related data. You can also think of this database corresponding to the Windows SQL Server service account.
Resource - Database responsible for SQL Server system objects. This database was introduced in SQL Server 2005 and is intended to ease the upgrade and rollback of SQL Server system objects.
Model - Template database for the creation of new user defined databases.
MSDB - Database responsible for SQL Server Agent related data such as Jobs, Alerts, Operators, etc.
TempDB - Temporary database to store temporary tables (#temptable or ##temptale), table variables, cursors, work tables, row versioning, create or rebuild indexes sorted in TempDB, etc. Each time the SQL Server instance is restarted all objects in this database are destroyed, so permanent objects cannot be created in this database.
Distribution - Database responsible for managing replicated data. This database could reside on the publisher or subscriber.
Additional information: SQL Server 2005 Books Online - System Databases
Question 2: True or False - Can you create objects in the Master, Model and MSDB databases?
True.
Question 3: Is it a good idea to create objects in the system databases?
In general , objects should not be created in the system databases. In general, it is a best practice to create a separate database for user defined objects that would be used instanc
相关文档:
SQL-Structured Query Language
--(开启SQL服务:net start mssqlserver)
--(在命令行中输入'sqlwb'命令可打开SQL管理器 )
--(如果要执行多条命令中的一条,鼠标选定后再按F5执行)
create database sales --创建一个名为sales的数据库
on
(
name='sales_dat ......
概述:
配置 Web 同步
url: http://technet.microsoft.com/zh-cn/library/ms151810(SQL.90).aspx
若要对复制使用 Web 同步,请执行下列步骤:
配置发布,以允许使用 Web 同步。
配置运行 Microsoft Internet 信息服务 (IIS) 的计算机以同步订阅。支持 IIS 5.0 和 6.0 版。
配置一个或多个订阅以使用 Web 同步。
......
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient; ......
原文出处:http://www.cnblogs.com/luoht/archive/2010/03/01/1676049.html
用IN写出来的SQL的优点是比较容易写及清晰易懂,这比较适合现代软件开发的风格。
但是用IN的SQL性能总是比较低的,从SQL执行的步骤来分析用IN的SQL与不用IN的SQL有以下区别:
SQL试图将其转换成多个表的连接,如果转换不成功则先执行 ......
using System.Data.SqlClient;
using System.Data.OleDb;
private void button1_Click(object sender, EventArgs e)
{
OleDbConnection conn = null;
try
&nbs ......