SQL数据库还原语句
---附加数据库
sp_attach_db '数据库名','数据库全路径','数据库日志全路径'
---查看数据库逻辑文件名
RESTORE FILELISTONLY from disk = '备份文件'
---还原数据库
restore database hzrb from disk = '备份文件'
with move '主逻辑名' to '存放mdf路径'
,move '日志逻辑名' to '存放ldf路径'
--修改数据库的逻辑文件名(数据)
ALTER DATABASE NEW
MODIFY FILE(NAME='Old_Data',NEWNAME='New_Data')
GO
--修改数据库的逻辑文件名(日志)
ALTER DATABASE NEW
MODIFY FILE(NAME='Old_Log',NEWNAME='New_Log')
GO
相关文档:
Merge statement
function benefits: 1) provides the ability to conditionally update, insert or delete data into a database table. 2) performs an update if the row exists, and an insert if it is a new row. --> 1) avoids seperate updates, 2) increase performance and ease of use. 3) is useful in dat ......
oracle tips
Exist的用法:
select gw.ndocid from
(select ndocid from wf_doc_gw_shouwen union select ndocid from wf_doc_gw_fawen) gw
where
not exists (select null from wf_doc_gw_sn sn where sn.ndocid=gw.ndocid)
2。把GW表和SN表里相同的NDOCID显示出来
select gw.ndocid from
(se ......
在程序的开发过程中,处理分页是大家接触比较频繁的事件,因为现在软件基本上都是与数据库进行挂钓的。但效率又是我们所追求的,如果是像原来那样把所有满足条件的记录全部都选择出来,再去进行分页处理,那么就会多多的浪费掉许多的系统处理时间。为了能够把效率提高,所以现在我们就只选择我们需要的数据,减少数据 ......
数据类型
在 Microsoft SQL Server中,每个列、局部变量、表达式和参数都有一个相关的数据类型,这是指定对象可持有的数据类型(整型、字符、money 等等)的特性。SQL Server 提供系统数据类型集,定义了可与 SQL Server 一起使用的所有数据类型。下面列出系统提供的数据类型集。
可以定义用户定义的数据类型,其是系统提 ......
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace DAL
{
......