Skip to main content

Posts

Showing posts from May, 2014

Web Parsing using Beautiful Soup -Python

I am trying to scrap a website and extracting the data from it. For Demo purpose, I am using  http://www.w3schools.com/sql/sql_select.asp  website as it is one for simple and popular website for learning basic of programming languages. I am now concentrating on the values which are on left pane on this site. Let’s go to extract these keywords. For the web parsing, we should install beautiful soup. If we go to “Inspect element”, the HTML tag for the website looks like this: We now came to know that, the names or text, we need to extract is lying under “<a>” tag. To get all the data from “<a>” tag, use the following code. from bs4 import BeautifulSoup import urllib2 html="http://www.w3schools.com/sql/sql_select.asp" WebParse = urllib2.urlopen (html).read() soup = BeautifulSoup (WebParse) for ul in soup.findAll ('a'):     print ul And if we investigate, we can see there are lot of records/data

IF ELSE Statement using SSIS

Hi All, We all faced many time the scenario of using IF ELSE statement in SQL and SSIS.  IF ELSE is straightforward in SQL. This can be achieved by using CASE statement. Example for CASE Statement will be found in this link Through SSIS, we can use Derived Column transformation to achieve this. Using Derived column, we can write condition like : Column_Name== <This value> ? <Then this value> : <Else this value>

Identity Column: Explanation and reset identity value!!!

Identity property in SQL Server will helps in creating a Identity Column on a table. This property can be used to uniquely identify the records. We can able to create identity column using keyword: IDENTITY when creating the table or altering the table. Lets walk with a example to understand how to create the IDENTITY column which generate incremental value as when the records are getting inserted. Create   table  Customer   ( ID  INT   Identity ,  Username  Varchar ( 5 ),  Pwd  Varchar ( 10 ))   Appending the keyword Identity while creating the table will enable Identity values incremented automatically as when the records gets inserted inside ID column. Lets insert 2 values and check how it is working.  Insert into Customer (Username,Pwd)  Values ( 'dhina' , 'dhina' ) Insert into Customer    (Username,Pwd)   Values ( 'dhinakaran' , 'dhinakaran' ) The problem when we execute this statement is, the second Insert will