SSIS Data Type SSIS Expression SQL Server single-byte signed integer (DT_I1) two-byte signed integer (DT_I2) smallint four-byte signed integer (DT_I4) int eight-byte signed integer (DT_I8) bigint single-byte unsigned integer (DT_UI1) tinyint two-byte unsigned integer (DT_UI2) four-byte unsigned integer (DT_UI4) eight-byte unsigned integer (DT_UI8) float (DT_R4) real double-precision float (DT_R8) float string (DT_STR, «length», «code_page») char, varchar Unicode text stream (DT_WSTR, «length») nchar, nvarchar, sql_variant, xml date (DT_DATE) date Boolean (DT_BOOL) bit numeric (DT_NUMERIC, «precision», «scale») decimal, numeric decimal (DT_DECIMAL, «scale») decimal currency (DT_CY) smallmoney, money unique identifier (DT_GUID) uniqueidentifier byte stream (DT_BYTES, «length») binary, varbinary, timestamp… Read more
SSIS Data Flow Tasks with Descriptions
S No Transformation Description 1 Aggregate Summing / Averaging a total of the products purchased by a customer online to produce the final amount. 2 Audit When you want to load audit information like (Created Date, UserName , server Name..etc) to your Destination table. 3 Character Map String Manipulation, like Lowercase, Uppercase etc.. 4 Conditional Split When you want to split your data to many destinations based on conditions. 5 Copy Column To have same column data with alias name 6 Data Conversion To convert the data type, (Unicode String àString…) 7 Data Mining Query Evaluating the input data against… Read more
Log Shipping Complete Tutorial Part 2 Step by Step Log shipping
Permissions To setup a log-shipping you must have sysadmin rights on the server. Minimum Requirements SQL Server 2005 or later Standard, Workgroup or Enterprise editions must be installed on all server instances involved in log shipping. The servers involved in log shipping should have the same case sensitivity settings. The database must use the full recovery or bulk-logged recovery model A shared folder for copying T-Log backup files SQL Server Agent Service must be configured properly In addition, you should use the same version of SQL Server on both ends. It is possible to Log Ship from SQL 2005 to… Read more
Log Shipping Complete Tutorial Part 1
What is SQL Server log shipping? SQL Server log shipping is a technique which involves two or more SQL Server instances and copying of a transaction log file from one SQL Server instance to another. The process of transferring the transaction log files and restoring is automated across the SQL Servers. As the process result there are two copies of the data on two separate locations A log shipping session involves the following steps: Backing up the transaction log file on the primary SQL Server instance Copying the transaction log backup file across the network to one or more secondary… Read more
SQL Server 2008 Editions
The editions of SQL Server 2008 are as follows: Enterprise: this is the high-end edition with the full feature set. It supports systems up to 8 CPU and 2 TB RAM. The maximum size of the database is 524 PB. Standard it has a bit less features than Enterprise, but it is a good choice when advanced functions (such as data compression, compressed backups, indexed views, etc.) are not required for the business. It supports systems up to 4 CPU and 64 GB RAM. Workgroup: it is suitable for remote offices of a larger company. It supports systems up to 2 CPU and… Read more
SSAS STORAGE MODES
In SQL Server Analysis Services 2008, we have three storage mode options available to us: Relational Online Analytical Processing (ROLAP), Multidimensional Online Analytical Processing (MOLAP) and Hybrid Online Analytical Processing (HOLAP). There are advantages and disadvantages to each, so I figured I’d take a few minutes to give a quick overview describing the storage modes and laying out some of the pros and cons of each. Relational Online Analytical Processing (ROLAP) The ROLAP storage mode allows the detail data and aggregations to be stored in the relational database. If you plan on using ROLAP, you need to make sure that… Read more
Best Practices while creating Stored Procedures
1. SET NOCOUNT ON: Always use ‘SET NOCOUNT ON’ statement at the begening of your code inside the SP to reduce unnecessary network round trips. 2. PARAMETER SNIFFING: Do not use SP parameters directly within the WHERE clause of SQL statements. This may cause the case of Prameter Sniffing. To avod this assign the parameter values to local variables and then use them with SQL queries. 3. Use table variables: Try to use table variables instead of temporary tables inside the SP to cache small record sets whenever possible. 4. Use of Temp Tables: If you think that the temporary… Read more
SQL SERVER – Get Database Backup History
Setting Up Alerts for All SQL Server Agent Jobs
Some times clients ask to enable alerts for the sql agent jobs, it will be difficult when we have more jobs, because we need to goto each and every job and enable the notifications. Here is the script for enabling for the jobs, Steps : 1. Create Mail Profile 2. Enable the mail profile for agent (SQL Server Agent Properties –> Alert System –>select Enable Mail profile & Select profile) 3. Create Operator with Mail ID. (Ex : DBA) 4. Run below script for enabling the alerts for all the jobs. We need to decide when we want email to… Read more
Windows Disk Space Alert From SQL SERVER JOB
In SQL server when the auto growth option is set to true and when we have defined the autogorwth in MB, some times we may face the issue like windows disk space is full, during that time SQL Server cannot increase the auto growth size of the mdf or ldf files. As Best practice to have the alert for the drives free space. We can create a job for the below script. schedule it for every 15 or 30 minutes based on your application usage / load.