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.
相关文档:
--行列互转
/******************************************************************************************************************************************************
以学生成绩为例子,比较形象易懂
整理人:中国风(Roy)
日期:2008.06.06
***************************************************************** ......
ORACLE PL/SQL与SQL SERVER T-SQL一些比较
字符串连接
Oracle用|| 符号作为连接符,而SQL Server的连接符是加号:+ 。
Oracle查询如下所示:Select ‘Name’ || ‘Last Name’ from tableName
SQL Server查询如下:Select ‘Name’ + ‘Last Name’
GUID
Oracle用SYS_GUID ......
alter procedure qry_page
@sqlstr nvarchar(4000), --查询字符串
@page int, --第N页
@pagesize int &n ......
经典SQL语句
1、说明:复制表(只复制结构,源表名:a 新表名:b) (Access可用)
法一:select * into b from a where 1<>1
//a必须是已经存在的表,但是b可以不存在,当b不存在时,系统会自己创建表b,该方法只会复制表的结构,而不会复制表的数据
法二:select top 0 * int ......
1.查找重复数据表的id以及重复数据的条数
select max(id) as nid,count(id) as 重复条数 from tableName
group by linkname Having Count(*) > 1
2.查找重复数据表的主键
select max(id) as nid from tableName
group by linkname Having Count(id) > 1
3.删除重复的数据
delete from table ......