Tuesday, October 30, 2012

Database Mail to send alerts when SQL Server Agent jobs fail

right-click SQL Server Agent (The MSX suffix in the screenshot is due to the Agent on this particular server acting as the Master in a multi-sevrer job administration) and select "Properties":
In the SQL Server Agent properties, head to the "Alert System" page, and there, in the Mail Session part of the page, check the box next to "Enable mail profile" to enable mail, and under "Mail System", set it to "Dabatase Mail". Under "Mail Profile", set it to "SQL Server Mail":

 Click "OK", right-click the "Operators" folder under SQL Server Agent, and select "New operator":

Define a name for the profile, and enter the mail account you want the mail to be sent to:
To ensure things will work correctly, it is usually a good idea to restart SQL Server Agent at this stage. This can be done either from SQL Server Configuration Manager, or directly from SQL Server Management Studio (SSMS) by right-clicking SQL Server Agent, and then selecting "Restart":

In the agent job general section, the only thing I filled out was the name: "Failing Job". In the "Steps" section, I created a new job step that selects data from a non-existing table in a non-existing database:
Then, on the "Notifications" page, I selected to have a mail sent to the profile created earlier if the job fails:
If all went well, you should receive a mail notifying you of the the job failure:

Wednesday, October 24, 2012

Resolve a “Couldn’t modify partition map because file system verification failed.” Error in Mac OS X

Partition Failed error

If you have attempted to partition a drive from Mac OS X and received a “Partition failed” message with the error “Couldn’t modify partition map because file system verification failed.” you can fix the problem with the file system check command line utility. To do this properly, you’ll need to boot into Single User Mode as well:
  1. Reboot the Mac into Single User Mode by holding Command+S during boot
  2. At the command prompt, type:
  3. /sbin/fsck -fy
  4. When fsck is complete, type “exit” or “reboot” to reboot
  5. Boot the Mac as usual, verify the disk again in Disk Utility, and partition as usual
Boot the Mac as usual and relaunch Disk Utility to verify the disk. Go ahead and partition the drive as usual, this time without any such error message.

Monday, October 15, 2012

华人&移民

华人对生命的理解就是比周围和认识的人更有钱,社会地位更高,老婆更漂亮,子女更优秀,仅此而已。而不是努力拓展自己的生命边界或者说去寻找自己的边界,不辜负上天给予的资源,比如外表,健康,智商,情商等。所谓压力纯属自找。移民,就仿佛重生一次,不是所有人都敢要这个经历。在新环境中能生存就很不错。若能发展,就是生命边界又拓宽一步!

Andriod 4.1.2升级窍门(for nexus 7 and more)

没收到系统升级通知,检测不到有版本需要升级,按如下办法

1、到settings,  apps, all, 里面找到Google service framework,
2、然后点force stop ,确定
3、再点clear data,  confirm
4、回到about,  system upgrade ,这个时候你看到的时间是1969
5、点check now


多试个3,5次一定可以监测到有升级的

Friday, October 12, 2012

Smooth SSIS Upgrade to SQL Server 2012

TIP #1: Edit Package Configuration and Data Source after upgrading

clip_image005
The first step to upgrade an SSIS solution is to run the SSIS Package Upgrade Wizard. The SSIS Package Upgrade Wizard makes appropriate changes to package properties and upgrades the package format.
The wizard launches when you open a pre-SQL Server 2012 package in the SQL Server Data Tools for the first time. SQL Server Data Tools replaces (BIDs). The wizard can also be launched manually by running SSISUpgrade.exe, which is located under %ProgramFiles%\Microsoft SQL Server\110\DTS\Binn.
It is critical to note that the SSIS Package Upgrade Wizard does not upgrade settings such as connection strings that are defined in the package configurations. After a package upgrade, you may need to make some manual changes to the package configuration to run the upgraded package successfully.
For example, you have an SSIS 2005 package. The package uses an OLE DB connection manager to connect to the AdventureWorks database in a local SQL Server 2005 instance. The package also uses an XML package configuration file to dynamically configure the ConnectionString property of the OLE DB connection manager. The following shows the contents of the XML package configuration file.
clip_image001
You have set up a machine with a standalone SQL Server 2012 installation. You move the SSIS 2005 package to the machine and run the SSIS Package Upgrade Wizard to upgrade the package to SQL Server 2012. When the wizard finishes, you need to manually change the provider name from SQLNCLI.1 to SQLNCLI11.1 in the XML package configuration file to run the upgraded package successfully. The wizard does not update package configuration files.
If you don’t update the provider name in the configuration file, the file configures the OLE DB connection manager to use the SQLNCLI.1 provider that is the SQL Server 2005 Native Client Library. SQLNCLI11.1 is the SQL Server 2012 Native Client Library. Because the SQL Server 2005 Native Client Library is not included in SQL Server 2012, the following error message will appear when you open or execute the upgraded package on the machine where SQL Server 2012 is installed:
The requested OLE DB provider SQLNCLI.1 is not registered. If the 32-bit driver is not installed, run the package in 64-bit mode. Error code: 0×00000000. An OLE DB record is available. Source: “Microsoft OLE DB Service Components” Hresult: 0×80040154 Description: “Class not registered”.
So, if your pre-SQL Server 2012 package uses any kind of package configurations, it is important to remember that you may need to manually update the content of the package configurations after you upgrade the package to SQL Server 2012. This applies to the different types of configurations, such as XML configuration files.
Connection strings that require updates and are stored in data source files or set by expressions, need to be updated manually.

TIP #2: Convert to project deployment model using Project Conversion Wizard

SQL Server 2012 SSIS supports two deployment models: the package deployment model and the project deployment model. The package deployment model was available in previous releases of SSIS and is the default deployment model for upgraded packages. In this model, the unit of deployment is the package. The project deployment model is new in SQL Server 2012 and provides additional package deployment and management features such as parameters and the Integration Services catalog. The unit of deployment is the project.
Please read Project Deployment Overview in SQL Server “Denali” CTP1 – SSIS (http://social.technet.microsoft.com/wiki/contents/articles/project-deployment-overview-in-sql-server-quot-denali-quot-ctp1-ssis.aspx ) for a detailed walk through as well as comparison between these two deployment models.
Read Projects in SQL Server “Denali” CTP1 – SSIS (http://social.technet.microsoft.com/wiki/contents/articles/projects-in-sql-server-denali-ctp1-ssis.aspx) for a thorough explanation of the new project concept.
To convert a package to the project deployment, right click the project in Solution Explorer and then click Convert to Project Deployment Model. The Project Conversion Wizard launches and walks you through the conversion process.
clip_image008

TIP #3: Update Execute Package Task to use project reference and use parameter to pass data from parent package to child package

If an SSIS package contains an Execute Package Task, the Project Conversion Wizard prompts you to update the task to use the project reference.
For example, your SSIS project contains several packages. Inside the project, one package (typically called the parent package) runs another package (typically called the child package) by using an Execute Package Task. In Pre-SQL Server 2012 releases of SSIS, the parent package references the child package by using a File connection manager. At deployment, you need to remember to update the File connection manager to ensure that it points to the new location of the child package.
In SQL Server 2012 Integration Services you can configure the parent package to reference the child package by name when the child package is included in the same project as the parent package. Using this project reference makes the deployment experience much smoother. You don’t need to remember to update the reference between the parent package and the child package at deployment. For a thorough explanation of the project reference in the Execute Package Task, please see Changes to the Execute Package Task (http://blogs.msdn.com/b/mattm/archive/2011/07/18/changes-to-the-execute-package-task.aspx).
In previous releases of SSIS, you pass data from the parent package to the child package by creating a package configuration that uses the parent variable configuration type. This enables a child package that is run from a parent package to access a variable in the parent.
It is recommended that you configure the Execute Package Task to use parameter binding to pass data from the parent package to the child package. Parameters make this task easier. For example, you want a parent package to dynamically determine the number of days in a current month and have the child package perform a task for that number of times. You can create a variable in the parent package that represents the number of days and create a parameter in the child package. Then in the Execute Package Task, you bind the parameter in the child package to the variable in the parent package.
clip_image010
Please read Parameters in SQL Server “Denali” CTP1 – SSIS (http://social.technet.microsoft.com/wiki/contents/articles/parameters-in-sql-server-denali-ctp1-ssis.aspx) for a description of parameters and the numerous benefits they offer.

TIP #4: Parameterize PackageName property of Execute Package Task to dynamically configure which child package to run at execution time

Suppose your SSIS 2008 package has an Execute Package Task, and the package uses a File connection manager to connect to a child package. You dynamically assign which child package the Execute Package Task runs by configuring the connection string property of the File connection manager.
The following is the content of the XML package configuration file used by your SSIS 2008 package.
clip_image011
When the Project Conversion Wizard converts the package to the project deployment model and updates the Execute Package Task to use the project reference, the File connection manager that was used to connect to the child package is no longer used by the Execute Package Task. To continue to dynamically determine which child package the task runs, you create a parameter and map that parameter to the PackageName property of the Execute Package Task as shown in the following image.
clip_image013

TIP #5: Convert package configuration to parameter when possible

Parameters are new to SQL Server 2012 Integration Services and are the replacement for package configurations. You use parameters to assign values to package properties, whether at design time or run time. The values are pushed to a package when it is executed rather than having the package pull values from the package configurations.
The Project Conversion Wizard prompts you to optionally convert package configurations to parameters. It is possible that you might choose to keep a package configuration as an intermediate step of upgrading to SQL Server 2012. When your package has both configuration values and parameter values, it is important to understand the order in which these values are applied. Package configuration values will be applied first. If there are also parameter values for the same properties, these values will be applied next and will overwrite the package configuration values.

Monday, October 8, 2012

Windows eBook Download

http://blogs.msdn.com/b/mssmallbiz/archive/2012/07/27/large-collection-of-free-microsoft-ebooks-for-you-including-sharepoint-visual-studio-windows-phone-windows-8-office-365-office-2010-sql-server-2012-azure-and-more.aspx

http://blogs.msdn.com/b/mssmallbiz/archive/2012/07/30/another-large-collection-of-free-microsoft-ebooks-and-resource-kits-for-you-including-sharepoint-2013-office-2013-office-365-duet-2-0-azure-cloud-windows-phone-lync-dynamics-crm-and-more.aspx?wa=wsigni

Microsoft Dynamics GP 2010 Guides: Financials

http://www.microsoft.com/en-us/download/details.aspx?id=17123

SQL Server 2012 Developer Training Kit

http://www.microsoft.com/en-us/download/details.aspx?id=27721

Saturday, October 6, 2012

Windows 8 - How to install Langurage pack

1. Find language pack file. Say lp.cab for simplified Chinese language pack
2. Rname .cab file to .mlc. Say lp.mlc
3. Duble click to install. that's it!

or
run lpksetup.exe --> install display language --> select one or multiple .cab files
(only language with installed LPs will change the display language )

Thursday, October 4, 2012

远离十种人


1、常常抱怨的人
2、过分依赖的人
3、极度敏感的人
4、咄咄逼人的人
5、肆无忌惮的人
6、不会感恩的人
7、没有诚信的人
8、自私自利的人
9、不会珍惜的人
10、惹是生非的人