वोकेशनल विभाग ,ए . एस .महाविद्यालय ,देवघर में 31 अक्टुबर से क्लासेज शुरू !
Accredited by NAAC with B+ Grade . A Constituent College Of SIDO-KANHU-MURMU University, Dumka. Serving Students of the Economically Backward Districts of Santal Pargana Division,( Jharkhand) through Self Finance Undergraduate Vocational Courses in Computer Application, Business Administration and Library & Information Science Since 2008.
Monday, October 15, 2012
Saturday, October 13, 2012
How to import data from Excel to SQL Server
This step-by-step article demonstrates how to import data from Microsoft
Excel worksheets into Microsoft SQL Server databases by using a variety
of methods.
Description of the Technique
The samples in this article import Excel data by using:- SQL Server Data Transformation Services (DTS)
- Microsoft SQL Server 2005 Integration Services (SSIS)
- SQL Server linked servers
- SQL Server distributed queries
- ActiveX Data Objects (ADO) and the Microsoft OLE DB Provider for SQL Server
- ADO and the Microsoft OLE DB Provider for Jet 4.0
Requirements
The following list outlines the recommended hardware, software, network infrastructure, and service packs that are required:- Available instance of Microsoft SQL Server 7.0 or Microsoft SQL Server 2000 or Microsoft SQL Server 2005
- Microsoft Visual Basic 6.0 for the ADO samples that use Visual Basic
- Data Transformation Services
- Linked servers and distributed queries
- ADO development in Visual Basic
Samples
Import vs. Append
The sample SQL statements that are used in this article demonstrate Create Table queries that import Excel data into a new SQL Server table by using the SELECT...INTO...FROM syntax. You can convert these statements to Append queries by using the INSERT INTO...SELECT...FROM syntax while you continue to reference the source and destination objects as shown in these code samples.Use DTS or SSIS
You can use the SQL Server Data Transformation Services (DTS) Import Wizard or the SQL Server Import and Export Wizard to import Excel data into SQL Server tables. When you are stepping through the wizard and selecting the Excel source tables, remember that Excel object names that are appended with a dollar sign ($) represent worksheets (for example, Sheet1$), and that plain object names without the dollar sign represent Excel named ranges.Use a Linked Server
To simplify queries, you can configure an Excel workbook as a linked server in SQL Server. For additional information, The following code imports the data from the Customers worksheet on the Excel linked server "EXCELLINK" into a new SQL Server table named XLImport1:SELECT * INTO XLImport1 FROM EXCELLINK...[Customers$]
SELECT * INTO XLImport2 FROM OPENQUERY(EXCELLINK,
'SELECT * FROM [Customers$]')
Use Distributed Queries
If you do not want to configure a persistent connection to the Excel workbook as a linked server, you can import data for a specific purpose by using the OPENDATASOURCE or the OPENROWSET function. The following code samples also import the data from the Excel Customers worksheet into new SQL Server tables:SELECT * INTO XLImport3 FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=C:\test\xltest.xls;Extended Properties=Excel 8.0')...[Customers$]
SELECT * INTO XLImport4 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test\xltest.xls', [Customers$])
SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [Customers$]')
Use ADO and SQLOLEDB
When you are connected to SQL Server in an ADO application by using Microsoft OLE DB for SQL Server (SQLOLEDB), you can use the same "distributed query" syntax from the Using Distributed Queries section to import Excel data into SQL Server.The following Visual Basic 6.0 code sample requires that you add a project reference to ActiveX Data Objects (ADO). This code sample also demonstrates how to use OPENDATASOURCE and OPENROWSET over an SQLOLEDB connection.
Dim cn As ADODB.Connection
Dim strSQL As String
Dim lngRecsAff As Long
Set cn = New ADODB.Connection
cn.Open "Provider=SQLOLEDB;Data Source=<server>;" & _
"Initial Catalog=<database>;User ID=<user>;Password=<password>"
'Import by using OPENDATASOURCE.
strSQL = "SELECT * INTO XLImport6 FROM " & _
"OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', " & _
"'Data Source=C:\test\xltest.xls;" & _
"Extended Properties=Excel 8.0')...[Customers$]"
Debug.Print strSQL
cn.Execute strSQL, lngRecsAff, adExecuteNoRecords
Debug.Print "Records affected: " & lngRecsAff
'Import by using OPENROWSET and object name.
strSQL = "SELECT * INTO XLImport7 FROM " & _
"OPENROWSET('Microsoft.Jet.OLEDB.4.0', " & _
"'Excel 8.0;Database=C:\test\xltest.xls', " & _
"[Customers$])"
Debug.Print strSQL
cn.Execute strSQL, lngRecsAff, adExecuteNoRecords
Debug.Print "Records affected: " & lngRecsAff
'Import by using OPENROWSET and SELECT query.
strSQL = "SELECT * INTO XLImport8 FROM " & _
"OPENROWSET('Microsoft.Jet.OLEDB.4.0', " & _
"'Excel 8.0;Database=C:\test\xltest.xls', " & _
"'SELECT * FROM [Customers$]')"
Debug.Print strSQL
cn.Execute strSQL, lngRecsAff, adExecuteNoRecords
Debug.Print "Records affected: " & lngRecsAff
cn.Close
Set cn = Nothing
Use ADO and the Jet Provider
The sample in the preceding section uses ADO with the SQLOLEDB Provider to connect to the destination of your Excel-to-SQL import. You can also use the OLE DB Provider for Jet 4.0 to connect to the Excel source.The Jet database engine can reference external databases in SQL statements by using a special syntax that has three different formats:
- [Full path to Microsoft Access database].[Table Name]
- [ISAM Name;ISAM Connection String].[Table Name]
- [ODBC;ODBC Connection String].[Table Name]
DSN:
[odbc;DSN=<DSN name>;UID=<user>;PWD=<password>]
DSN-less:
[odbc;Driver={SQL Server};Server=<server>;Database=<database>;
UID=<user>;PWD=<password>]
Dim cn As ADODB.Connection
Dim strSQL As String
Dim lngRecsAff As Long
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\test\xltestt.xls;" & _
"Extended Properties=Excel 8.0"
'Import by using Jet Provider.
strSQL = "SELECT * INTO [odbc;Driver={SQL Server};" & _
"Server=<server>;Database=<database>;" & _
"UID=<user>;PWD=<password>].XLImport9 " & _
"FROM [Customers$]"
Debug.Print strSQL
cn.Execute strSQL, lngRecsAff, adExecuteNoRecords
Debug.Print "Records affected: " & lngRecsAff
cn.Close
Set cn = Nothing
Troubleshooting
- Remember that Excel object names that are appended with a dollar sign ($) represent worksheets (for example, Sheet1$) and that plain object names represent Excel named ranges.
- In some circumstances, especially
when you designate the Excel source data by using the table name instead
of a SELECT query, the columns in the destination SQL Server table are
rearranged in alphabetical order.For additional information about this
problem with the Jet Provider, click the article number below
to view the article in the Microsoft Knowledge Base:
PRB: Columns Are Sorted Alphabetically When You Use ADOX to Retrieve Columns of Access Table
- When the Jet Provider determines that an Excel column
contains mixed text and numeric data, the Jet Provider selects the
"majority" data type and returns non-matching values as NULLs.For
additional information about how to work around this problem, click the
article number below
to view the article in the Microsoft Knowledge Base:
PRB: Excel Values Returned as NULL Using DAO OpenRecordset
How to use Excel with SQL Server linked servers and distributed queries
Microsoft SQL Server supports connections to other OLE DB data
sources on a persistent or an ad hoc basis. The persistent connection is known
as a linked server; an ad hoc connection that is made for the sake of a single
query is known as a distributed query.
Microsoft Excel workbooks are one type of OLE DB data source that you can query through SQL Server in this manner. This article describes the syntax that is necessary to configure an Excel data source as a linked server, as well as the syntax that is necessary to use a distributed query that queries an Excel data source.
Microsoft Excel workbooks are one type of OLE DB data source that you can query through SQL Server in this manner. This article describes the syntax that is necessary to configure an Excel data source as a linked server, as well as the syntax that is necessary to use a distributed query that queries an Excel data source.
Querying an Excel data source on a linked server
You can use SQL Server Management Studio or Enterprise Manager, a system stored procedure, SQL-DMO (Distributed Management Objects), or SMO (SQL Server Management Objects) to configure an Excel data source as a SQL Server linked server. (SMO are only available for Microsoft SQL Server 2005.) In all of these cases, you must always set the following four properties:- The name that you want to use for the linked server.
- The OLE DB Provider that is to be used for the connection.
- The data source or complete path and file name for the Excel workbook.
- The provider string, which identifies the target as an Excel workbook. By default, the Jet Provider expects an Access database.
Note If you are using SQL Server 2005, you must specify a value that is not empty for the Product name property in SQL Server Management Studio or for the @srvproduct property in the stored procedure for an Excel data source.
Using SQL Server Management Studio or Enterprise Manager to configure an Excel data source as a linked server
SQL Server Management Studio (SQL Server 2005)
- In SQL Server Management Studio, expand Server Objects in Object Explorer.
- Right-click Linked Servers, and then click New linked server.
- In the left pane, select the General page, and then follow these steps:
- In the first text box, type any name for the linked server.
- Select the Other data source option.
- In the Provider list, click Microsoft Jet 4.0 OLE DB Provider.
- In the Product name box, type Excel for the name of the OLE DB data source.
- In the Data source box, type the full path and file name of the Excel file.
- In the Provider string box, type Excel 8.0 for an Excel 2002, Excel 2000, or Excel 97 workbook.
- Click OK to create the new linked server.
Enterprise Manager (SQL Server 2000)
- In Enterprise Manager, click to expand the Security folder.
- Right-click Linked Servers, and then click New linked server.
- On the General tab, follow these steps:
- In the first text box, type any name for the linked server.
- In the Server type box, click Other data source.
- In the Provider name list, click Microsoft Jet 4.0 OLE DB Provider.
- In the Data source box, type the full path and file name of the Excel file.
- In the Provider string box, type Excel 8.0 for an Excel 2002, Excel 2000, or Excel 97 workbook.
- Click OK to create the new linked server.
- Click to expand the new linked server name to expand the list of objects that it contains.
- Under the new linked server name, click Tables. Notice that your worksheets and named ranges appear in the right pane.
Using a stored procedure to configure an Excel data source as a linked server
You can also use the system stored procedure sp_addlinkedserver to configure an Excel data source as a linked server:DECLARE @RC int
DECLARE @server nvarchar(128)
DECLARE @srvproduct nvarchar(128)
DECLARE @provider nvarchar(128)
DECLARE @datasrc nvarchar(4000)
DECLARE @location nvarchar(4000)
DECLARE @provstr nvarchar(4000)
DECLARE @catalog nvarchar(128)
-- Set parameter values
SET @server = 'XLTEST_SP'
SET @srvproduct = 'Excel'
SET @provider = 'Microsoft.Jet.OLEDB.4.0'
SET @datasrc = 'c:\book1.xls'
SET @provstr = 'Excel 8.0'
EXEC @RC = [master].[dbo].[sp_addlinkedserver] @server, @srvproduct, @provider,
@datasrc, @location, @provstr, @catalog
Using SQL-DMO to configure an Excel data source as a linked server
You can use SQL Distributed Management Objects to configure an Excel data source as a linked server programmatically from Microsoft Visual Basic or another programming language. You must supply the same four arguments that are required in the Enterprise Manager and SQL Server Management Studio configuration.Private Sub Command1_Click()
Dim s As SQLDMO.SQLServer
Dim ls As SQLDMO.LinkedServer
Set s = New SQLDMO.SQLServer
s.Connect "(local)", "sa", "password"
Set ls = New SQLDMO.LinkedServer
With ls
.Name = "XLTEST_DMO"
.ProviderName = "Microsoft.Jet.OLEDB.4.0"
.DataSource = "c:\book1.xls"
.ProviderString = "Excel 8.0"
End With
s.LinkedServers.Add ls
s.Close
End Sub
Using SMO to configure an Excel data source as a linked server
In SQL Server 2005, you can use SQL Server Management Objects (SMO) to configure an Excel data source as a linked server programmatically. To do this, you can use Microsoft Visual Basic .NET or another programming language. You must supply the arguments that are required in the SQL Server Management Studio configuration. The SMO object model extends and supersedes the Distributed Management Objects (SQL-DMO) object model. Because SMO is compatible with SQL Server version 7.0, SQL Server 2000, and SQL Server 2005, you can also use SMO for configuration of SQL Server 2000.Imports Microsoft.SqlServer.Management.Smo
Imports Microsoft.SqlServer.Management.Common
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim s As Server
Dim conn As ServerConnection
Dim ls As LinkedServer
conn = New ServerConnection("ServerName\InstanceName", "YourUesrName", "YourPassword")
s = New Server(conn)
Try
ls = New LinkedServer(s, "XLTEST_DMO")
With ls
.ProviderName = "Microsoft.Jet.OLEDB.4.0"
.ProductName = "Excel"
.DataSource = "c:\book1.xls"
.ProviderString = "Excel 8.0"
End With
ls.Create()
MessageBox.Show("New linked Server has been created.")
Catch ex As SmoException
MessageBox.Show(ex.Message)
Finally
ls = Nothing
If s.ConnectionContext.IsOpen = True Then
s.ConnectionContext.Disconnect()
End If
End Try
End Sub
End Class
Querying an Excel data source on a linked server
After you configure an Excel data source as a linked server, you can easily query its data from Query Analyzer or another client application. For example, to retrieve the rows of data that are stored in Sheet1 of your Excel file, the following code uses the linked server that you configured by using SQL-DMO:SELECT * FROM XLTEST_DMO...Sheet1$
SELECT * FROM OPENQUERY(XLTEST_DMO, 'SELECT * FROM [Sheet1$]')
You can also obtain a list of all the tables that are available on the Excel linked server by using the following query:
EXECUTE SP_TABLES_EX 'XLTEST_DMO'
Querying an Excel data source by using distributed queries
You can use SQL Server distributed queries and the OPENDATASOURCE or OPENROWSET function to query infrequently accessed Excel data sources on an ad hoc basis.Note If you are using SQL Server 2005, make sure that you have enabled the Ad Hoc Distributed Queries option by using SQL Server Surface Area Configuration, as in the following example:
SELECT * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=c:\book1.xls;Extended Properties=Excel 8.0')...Sheet1$
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=c:\book1.xls', Sheet1$)
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Data Source=c:\book1.xls;Extended Properties=Excel 8.0', Sheet1$)
Could not find installable ISAM.
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'DataSource=c:\book1.xls;Extended Properties=Excel 8
Wednesday, October 10, 2012
Admit Cards for BBA D-II & BCA D-II Examination
a)Admit Cards for BBA D-II & BCA D-II Examination '2012 will be distributed from 10a.m. to 11a.m. on 12-10-2012..
b)Admit cards of a few students ,who have yet not deposited total course fee ,are pending.
c) .They are directed to deposit remaining amount of course fee and obtain no dues certificate from the account's section to receive admit card.
b)Admit cards of a few students ,who have yet not deposited total course fee ,are pending.
c) .They are directed to deposit remaining amount of course fee and obtain no dues certificate from the account's section to receive admit card.
Tuesday, October 9, 2012
FDI In Retail
Globally, there has been a significant change in the retail sector over the past two decades. More than 70% of retailing in developed countries is organized. The organized retail sector in China is 10 times that of India's. India is next only to China in market size and is the fourth largest economy in the world after the US, China and Japan. (The US accounts for 21.1% of the world's GDP, China 12.6%, Japan 7% and India 5.7%.) The World Trade Organization (WTO) and international agencies have been pushing the Indian government to allow FDI in the retail sector. The WTO has also been planning to withdraw tariff and trade privileges provided to India under the new General Agreement on Tariffs and Trade if FDI is not allowed.
The average Indian deserves consumption of good quality products at prices he can afford. In a developing country like India, a major chunk of a consumer's expenditure is on retail products. This expenditure is only likely to increase in the near future. Retailing in India, in spite of industry majors entering, is still at its nascent stage. According to India's Ministry of Commerce and Industry, only 2% of the retail sector is organized, leaving a huge margin for other players to enter the market. Moreover, the volume of retail turnover in the country is estimated at Rs. 4 lakh crore, which is about 10% of our Gross Domestic Product (GDP). The retail industry is the second largest sector after agriculture in terms of turnover and employment. The growth rate of the retail sector is estimated at about 5% per annum. It is also interesting to note that retailing in India by 2010 will be a $300 bn industry, provided our economy continues to register a growth of 6% of the GDP annually.
The Indian retail market, which was largely unorganized till the 1980s, has undergone an immense transformation in the post-liberalization era. Due to the wide range of products available, the increasing purchasing power of consumers, superior supply chain management leading to economies of scale and a world-class customer service, the Indian retail market has been witnessing tremendous growth. Alongside, there has been an increasing pressure from international agencies on the government, to allow Foreign Direct Investment (FDI) in the retail sector. Many industrial giants like Tatas (Westside), Eureka Forbes, RPG (Food World, Giant, Music World, Health & Glow), Pantaloons, Big Bazaar, Shoppers' Stop, and Lifestyle have entered the Indian retail market. These big corporate houses have managed to attract a large number of customers over a period of time and have significantly improved this sector. Moreover, these companies invested huge resources, in terms of capital, personnel and technology, which allowed them to garner a significant market share in this industry. The increase in the double income households (as a result of multinational companies entering the country and creating potential employment opportunities), has given a tremendous boost to the spending power of consumers, thereby opening a plethora of opportunities for retailers.
Unlike earlier, consumers now are spending a major chunk of their income on buying goods and services. A growing number of families with both the spouses working gave impetus to instant and ready-made products (ITC's ready-to-eat foods) and services, which help save time. Retailers are now offering an entire range of convenience products, which a typical household requires.
There are several reasons that have led to the retail sector being more organized. Increased urbanization, growth in the demand for newer and varied products by consumers, and branded goods penetrating the market on a large scale are some of the reasons. Segments in retailing like consumer durables, furniture, healthcare, garments, food and services, personal care products, apparel, music, and books are increasingly getting organized.
Such overwhelming statistics is forcing the government to take firm and positive steps towards allowing FDI in the retail sector. The government is gradually preparing the base for allowing FDI in this sector. It recently allowed 100% FDI in the real estate sector. The opening up of the real estate sector for FDI will greatly help the organized retailing industry in developing world-class infrastructure. Providing concessions on import of capital goods for certain retailers and implementation of Value Added Tax (VAT) are certain other steps towards this direction.
However, certain political parties like the Left are strongly opposing any such moves. One of their main contentions is that it will destroy employment opportunities in this sector. But the fact is, allowing FDI in this sector offers a host of benefits. Primarily, it enhances the standard of living of the people by providing high quality products at cheaper rates. It will also increase employment opportunities in the entire value chain of organized retailing, right from procuring materials to packing and selling them. On the other hand, the application of information technology in the retail sector has been on the rise over the past few years, across the world.
It has significantly improved the effectiveness of various activities like operating the stores, merchandise management, inventory management, sales forecasting, etc. Technological advancements have also prompted retailers to focus on television shopping and online shopping. All these developments create a host of employment opportunities. The unorganized sector in retailing does not provide advanced and technological facilities as provided by the organized sector. The change in customer preferences helps organized retailers provide a wide variety of products with state-of-the-art display and stocking capabilities. The retailers in the organized sector set up stores on a large scale with different kinds of products. This allows them to bargain with their suppliers, thus, giving them the advantage of lower costs and supply chain efficiencies. These advantages combined with a highly trained staff increase productivity and lead to competitive pricing of the products.
The McKinsey report that India is poised to witness an explosive growth in the organized retail sector has inspired many national and international companies to enter this sector in a big way. Apart from the existing industry giants such as the TATA, RPG, ITC, etc., new players like Reliance Industries are planning to enter this segment in a big way by establishing shopping malls, in India's major cities and pumping insignificant investment. Many of the international retailers are waiting at the country's doorstep to enter the market. Recently, global retail giant Wal-Mart International's CEO and President, John B Menzer, met the Prime Minister, Manmohan Singh, to discuss the opening up of the retail sector. Wal-Mart is planning to invest substantially once this sector opens up.
Concerns about the future of the existing retailers in the country, especially those in the unorganized sector are largely unwarranted. The small-time retailers will still have their business as their target market is completely different from the targeted consumers (probable) of global retail giants like Wal-Mart (if it enters India). The small-time retailers act as next door stores that help in purchasing items of daily usage. However, this is not the case with large organized retailers and, therefore, the local Kirana stores will anyway have their business. A case in point is, China, which has allowed 49% FDI straight away in the retail sector and improved its stand in international trade. As regards the future of unorganized retailing in China, according to a study, allowing FDI did not displace the conventional local retailers but on the contrary, these traditional outlets in China have increased significantly from around 19 lakhs in 1996 to almost 26 lakhs in 2001.
The government should, therefore, go ahead and allow FDI in the retail sector. In fact, it should take a cue from China in this regard. Planning to withhold the decision until the December WTO meeting in Hong Kong, so that the government can use this as a bargaining tool for service sector negotiations, is a good move. Whatever the outcome, the government should allow FDI in retailing, if not today at least tomorrow.
Saturday, October 6, 2012
Programme for BBA D-II & BCA D-II EXAMINATION ‘2012
NOTIFICATION
NO. 49/2012, Dated 03-10-2012
IInd Sitting (02.00 P.M. to 05.00 P.M.)
|
||||||
Date
& Days
|
BCA D-II
|
BBA D-II
|
||||
SUBJECT
|
Paper
|
Marks & Hours
|
SUBJECT
|
Paper
|
Marks & Hours
|
|
31.10.2012 (Wednesday)
|
C++
|
5 A
(H)
|
50 Marks
3Hrs.
|
Introduction to Marketing Management
|
1st
(Hons.)
|
100 Marks/3Hrs
|
03.11.2012
(Saturday)
|
Data Base Management
|
6A
(H)
|
50 Marks
3Hrs.
|
|||
06.11.2012
(Tuesday)
|
Networking & Data Communication
|
7A
(H)
|
50 Marks
3Hrs.
|
Introduction to Financial Management
|
2nd (Hons.)
|
100 Marks/3Hrs
|
09.11.2012 (Friday)
|
E-Commerce & Application
|
8A
(H)
|
50 Marks
3Hrs.
|
|||
23.11.2012
(Friday)
|
PHYSICS
|
Sub.-1
|
75 Marks
3Hrs.
|
Auditing
|
100 Marks/3Hrs
|
|
26.11.2012
(Monday)
|
Money & Financial System
|
100 Marks/3Hrs
|
Money & Financial System
|
100 Marks/3Hrs
|
||
29.11.2012
(Thursday)
|
MATHEMATICS
(All BCA students)
|
Sub.-2
|
100 Marks
3Hrs.
|
|||
01.12.2012
(Saturday)
|
R.B. HINDI OR MB(ENGLISH & NON-
HINDI)
|
100 Marks/3Hrs or 50 Marks/Each of
1&1/2 Hrs.
|
R.B. HINDI OR MB(ENGLISH & NON-
HINDI)
|
100 Marks/3Hrs or 50 Marks/Each of
1&1/2 Hrs.
|
Subscribe to:
Posts (Atom)