473,804 Members | 2,194 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MS SQL Server 2000: automatically rows inter changed in database

7 New Member
Hi all,

I import MS Excel 2003 spread sheet in MS SQL Server 2000 through MS SQL Server 2000 Enterprise Manager. In excel two sheets (sheet1 and sheet2) of data is there. I imported first sheet data in first time in relevant table of database and done second sheet of data in next time. My excel file have 2000 rows and 100 columns of data. All the data are imported in relevant attributes cells in good manner. But the first 16 rows are sorted automatically. I am trying to say that first row data is match with my excel file. But second row data have gone to 7th row and 7th row have gone to 5th row like that. Except that 16 rows all other data are matched with my MS Excel 2003 file. I need the data sequence what I have in my excel file. What is the problem occurred? How can I solve this?
Actually the problem occurred in first some rows so I found the mistake. If it comes after 1000 rows how can I predict and rectify?
Please help me. I don't have more knowledge in MS SQL Server 2000.
Thanks,

With Regards,
bala.
Feb 6 '08 #1
7 2427
ck9663
2,878 Recognized Expert Specialist
Hi all,

I import MS Excel 2003 spread sheet in MS SQL Server 2000 through MS SQL Server 2000 Enterprise Manager. In excel two sheets (sheet1 and sheet2) of data is there. I imported first sheet data in first time in relevant table of database and done second sheet of data in next time. My excel file have 2000 rows and 100 columns of data. All the data are imported in relevant attributes cells in good manner. But the first 16 rows are sorted automatically. I am trying to say that first row data is match with my excel file. But second row data have gone to 7th row and 7th row have gone to 5th row like that. Except that 16 rows all other data are matched with my MS Excel 2003 file. I need the data sequence what I have in my excel file. What is the problem occurred? How can I solve this?
Actually the problem occurred in first some rows so I found the mistake. If it comes after 1000 rows how can I predict and rectify?
Please help me. I don't have more knowledge in MS SQL Server 2000.
Thanks,

With Regards,
bala.
to solvem try inserting a new column. fill it out with numeric row counter...this waty even if the sequence is mess up when you upload it, you can still sort it...

-- ck
Feb 6 '08 #2
InnoSol
7 New Member
to solvem try inserting a new column. fill it out with numeric row counter...this waty even if the sequence is mess up when you upload it, you can still sort it...

-- ck
Hi,

Sorry ck9663. I couldn't follow your answer. You said that numeric row counter, is it in excel?

Now I did the same function as I said in my actual question again. Import MS Excel 2003 file to MS SQL Server 2000. This time I changed the data. Only 20 rows of data.
I check the database after imported, the total rows are interchanged automatically. First gone to last 5th come to first like that.
Anything I should do in my MS Excel file?
Otherwise can I solve it in MS SQL Server 2000 itself?
thanks,
Feb 6 '08 #3
ck9663
2,878 Recognized Expert Specialist
yes. am suggesting you insert a column on your excel. maybe on the leftmost (A). populate it with number that could represent a row number. then import it to your sql server

-- ck
Feb 6 '08 #4
InnoSol
7 New Member
yes. am suggesting you insert a column on your excel. maybe on the leftmost (A). populate it with number that could represent a row number. then import it to your sql server

-- ck
thanks for the reply.

I did what you said. But that particular column not came in database file. I give row no. heading to that new column (A1) and give no from 1, 2, 3... But that data not comes in my SQL Server database file. Anything I should do for that newly inserted column come in my SQL server database file?
Feb 6 '08 #5
ck9663
2,878 Recognized Expert Specialist
it's probably because your table is already existing. either drop your table first or import it into a new/temp table...

-- ck
Feb 6 '08 #6
InnoSol
7 New Member
it's probably because your table is already existing. either drop your table first or import it into a new/temp table...

-- ck
Hi

Any possibility available to export data to SQL Server database from MS Excel file by query?

If yes please mention the query and where should I run that query?
Feb 6 '08 #7
PreethiParkavi
16 New Member
Hi,
You can import data from Excel through the query.for example
Expand|Select|Wrap|Line Numbers
  1. SELECT * INTO #tmp  FROM
  2.  OPENROWSET('Microsoft.Jet.OLEDB.4.0',
  3. 'Excel 8.0;Database=d:\mathi\sample.xls', 'SELECT ID,Name FROM [sheet1$] order by name')
  4. select * from #tmp
  5. INSERT INTO SAMPLE (ID,NAME) select ID,NAME from #tmp
  6. select * from sample
  7. drop table #tmp 
  8.  
  9.  
Here , 2 columns are imported from excel sheet while is having three columns.It is inserted into a temporary table and then it is transfered into original table..for more , refer link http://support.microso ft.com/kb/321686

The only condition is, The excel file should be in the system where we are going to export.

Thanks,
Preethi
Feb 13 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2313
by: Bon | last post by:
Hello all Would it be possible to migrate the MS Access 2000 to MS SQL Server 2000? My application is using MS Access 2000 as database and as user interface such as forms. Now, I want to migrate the backend database from MS Access 2000 to MS SQL Server 2000. However, I want to keep the MS Access 2000 interface. Would it be possible?
5
1899
by: Tara via AccessMonster.com | last post by:
Hi there - I'll do my best to explain my dilema. I'm using Access 2000. In this database, there is one table with about 150 columns of information, and 206 rows. There are numerous queries and reports. I've set up input forms for staff to enter data easily. There are 8 staff members. My boss wants to ensure that data entered into this database is correct right off the bat. She's asking for a program or code to do the following:
8
1965
by: Inigo Jimenez | last post by:
I have an ASP .net web application installed in a Windows 2003 server. This web application has a webform that has a Datagrid. This Datagrid is filled with the data of a SQL table. I have a button that inserts a new row in the SQL table and then refresh the datagrid.
30
3409
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and commits it. How does the other user get the updated view without polling for changes? Is there some sort of callback mechanism that can be set up on the dataset or connection? TIA
2
6971
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
1
7493
by: Myster Edd | last post by:
I have a strange problem that I think deals with security on SQL 2005. I have a scheduled task that runs on a Windows 2000 machine. It calls a vb script which creates a connection to SQL Server. We migrated a database from SQL 2000 to 2005 which is on a different box. I changed the connection in the vb script to use the new sql server. The original connection to SQL 2000 used the 'sa' account coded into the connection string , which...
3
2618
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
Last week I asked a question about connection to database from client machine (developer machine). I have changed the database security setup for "SQL Server and Windows" under (local)Windows NT node of Enterprise Manager. However, I could not setup a database connection to Server from Client using Server Explorer of Visual Studio 2005. The detail is in the following. Configuration of server and client: Server: Windows Server 2000, SQL...
6
2679
by: jsacrey | last post by:
Hello everybody, I've got a bit of a situation that I could use some guidance with if possible. I work for an auditing firm where my users audit electronic shipping data for customers to see if they've been overcharged for shipments by truck and rail carriers. 99.9% of the time, one of our auditors needs to see all data sent by a customer in datasheet view so that they can sort records in many different ways looking for duplication...
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10356
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10099
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3003
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.