Scenario:
Some time we have requirement to send email with MonthName or dayName in the subject in SSIS Package or need to create folder with Month Name and then Archive files e.g. Archive_Dec_2011. How we can create folder or have subject in email with Month Name or Day Name by using SSIS Package?Solution:
We don't have Month-Name or Day-Name in SSIS Package.We can create two variables in our package and write expressions on them to use them wherever we need Month Name and Day Name.Step 1:
Let's create VarDayName and VarMonthName variables in our SSIS Package so we can write expressions on them and use in our Package where we need Month Name an Day Name.
How to get Month Name and Day Name in SSIS Package - SSIS Tutorial for Beginners
Step 2:
Go to the properties of VarDayName variable and then configure as shown below.
Write expression to get Day Name in SSIS Package - SSIS Tutorial
Expressions for Month Name:
DATEPART("dw",GETDATE())==1? "Sunday":
DATEPART("dw",GETDATE())==2?"Monday":
DATEPART("dw",GETDATE())==3?"Tuesday":
DATEPART("dw",GETDATE())==4?"Wednesday":
DATEPART("dw",GETDATE())==5?"Thursday":
DATEPART("dw",GETDATE())==6?"Friday":
DATEPART("dw",GETDATE())==7?"Saturday":""
Step 3:
Go to the properties of DayMonthName variable and write expressions as shown below.
Expressions for Month Name:
(MONTH(getdate()) == 1 ? "Jan" :
MONTH(getdate()) == 2 ? "Feb" :
MONTH(getdate()) == 3 ? "Mar" :
MONTH(getdate()) == 4 ? "Apr" :
MONTH(getdate()) == 5 ? "May" :
MONTH(getdate()) == 6 ? "Jun" :
MONTH(getdate()) == 7 ? "Jul" :
MONTH(getdate()) == 8 ? "Aug" :
MONTH(getdate()) == 9 ? "Sep" :
MONTH(getdate()) == 10 ? "Oct" :
MONTH(getdate()) == 11 ? "Nov" :
MONTH(getdate()) == 12? "Dec":"")
Now you have Month Name and DayName available through these two variables ,
Those can be used in expression with different transformations as required.
Related Posts
How To Use Expression Task To Get Day Name and Month Name In SSIS Package
Video Demo : How to use Expression Task to get Month Name in SSIS Package
Good one... but we just ignore these :(.
ReplyDeleteAivivu - đại lý chuyên vé máy bay trong nước và quốc tế
ReplyDeletevé máy bay đi Mỹ giá rẻ 2021
giá vé từ mỹ về việt nam
chuyến bay từ canada về việt nam
khi nào có máy bay từ nhật về việt nam
ve may bay tu han quoc ve viet nam
Vé máy bay từ Đài Loan về Việt Nam
khách sạn cách ly ở tây ninh
chuyen bay chuyen gia ve viet nam
I am astounded by the impact that liposomal glutathione has had on my general health since I began taking it regularly. Since I have a very hectic lifestyle, I am always on the lookout for methods to strengthen my immune system and facilitate cleansing. In this respect, liposomal glutathione has proven revolutionary. In addition to enhancing my energy levels and general well-being, it also helps my body's defences against oxidative stress. If you want to improve your health from the inside out, try it!
ReplyDeleteNadia's proficiency in Reflexology and Sports Massage highlights her versatility as a massage therapist. Reflexology involves applying gentle pressure on specific points of the feet, hands, or ears, which helps reduce stress and improve overall body function. Sports Massage, on the other hand, is tailored to athletes, focusing on preventing and healing injuries related to sports activities. Nadia's skillful application of these techniques ensures that clients receive targeted, effective treatments that address their unique needs, promoting overall well-being and performance. thai massage raleigh
ReplyDelete