473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

MS SQL Server 2000: automatically rows inter changed in database

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 2409
ck9663
2,878 Expert 2GB
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
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 Expert 2GB
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
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 Expert 2GB
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
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
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.microsoft.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
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...
5
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...
8
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...
30
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...
2
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...
1
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. ...
3
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...
6
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.