Auto process Cube with SQL Agent job
(1) Connect to the Analysis server, select the database which we want it to be automatically processed. Right click on this database, choose ‘Process’:
(2) In the opening ‘Process database’ form, click the ‘Script Action to New Query Window’ as below:
(3) A query form is opened as below, copy all these code.
(4) Connect to the Database Engine, choose the Jobs node under ‘SQL Server Agent’, right click on this ‘Jobs’ node and select ‘New Job’:
(5) In the opening ‘New Job’ form, enter a Name and description for this job
(6) Choose Steps in the left page in the ‘new Job’ form, then click the ‘New’ button to open ‘New Job Setup’ form
(7) In the ‘New Job Setup’ form, please enter a name for this Step, choose the Type ‘SQL Server Analysis Services Command’, enter the Server, then paste the command in our step(3) in to the Command, and you can select the ‘Advanced’ page in the left page to configure more for this step, like log file.
After you finish the setup of step, click OK return to ‘New Job’ form.
(8) Choose ‘schedules’ and then click ‘New’ buttons as below:
(9) In the ‘New Job Schedule’ form, enter a name for this schedule, set the frequency for this job, and set the daily frequency as below, finally, click OK.
(10) Click OK to finish the creation of the job, and it has been added to the agent, it will run the process every day.
相关文档:
alter procedure qry_page
@sqlstr nvarchar(4000), --查询字符串
@page int, --第N页
@pagesize int &n ......
ORACLE常用SQL优化hint语句
http://oracle.chinaitlab.com/induction/802186.html
在SQL语句优化过程中,我们经常会用到hint,现总结一下在SQL优化过程中常见Oracle HINT的用法:
1. /*+ALL_ROWS*/
表明对语句块选择基于开销的优化方法,并获得最佳吞吐量,使资源消耗最小化.
例如:
SELECT /*+ALL+_ROW ......
如何用SQL语言选择表中的第二条第三条第N条记录
--ID为唯一性就行了
select top 1 * from table
where ID not in(select top 1 ID from table)--第2条
select top 1 * from table
where ID not in(select top 2 ID from table)--第3条
......
一,
bcp命令详解
bcp命令是SQL Server提供的一个快捷的数据导入导出工具。使用它不需要启动任何图形管理工具就能以高效的方式导入导出数据。bcp是SQL Server中负责导入导出数据的一个命令行工具,它是基于DB-Library的,并且能以并行的方式高效地导入导出大批量的数据。bcp可以将数据库的表或视图直接导出 ......