SQL Server 2005, Load Excel File, UniqueIdentifier

Hi Everyone,

I am trying to load about 30,000 rows of data into a table in SQL Server that contains a UniqueIdentifier column. (Which is the primary key). The data is contained in an Excel file.

I am using the import tool from Toad to try to load the data, but it keeps getting rejected because of this particular column. (I heard that people using the import tool for SQL Server encounter the same problem).

Does anyone know a workaround for this? The Excel file has about 29 columns of data with this one column being the problem.

Thanks so much.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If you want SQL to create a unique id for this data:

- Remove the id column from inclusion in Excel, add NEWID() in its place

If you want to keep the unique id that Excel has:

- Check your data... UniqueIdentifier columns may not have IDENTITY constraints so this isn't a case of SQL rejecting data it believes it should be creating.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Alpesh PatelAssistant ConsultantCommented:
This great to exclude from source to insert. and create new id runtime. but it has references then it will create problem. let do as per the situation.
jonsuns7Author Commented:
I actually used the NEWID() as the default value for the uniqueidentifier column. This caused all imports to automatically allow the column to self generate values and did not block any rows from being imported.
>I actually used the NEWID() as the default value for the uniqueidentifier column

seems awfully similar to my suggestion...

>Remove the id column from inclusion in Excel, add NEWID() in its place
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.