Click here to Skip to main content
16,004,587 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have a list of extended properties for all databases in an excel file. How can I import that into extended properties of each database in sql server.

What I have tried:

I enter Data Manually in extended properties of Database Properties window.
Posted
Updated 14-Jul-24 7:01am
v2
Comments
OriginalGriff 14-Jul-24 2:14am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with - we get no other context for your project.
Imagine this: you go for a drive in the country, but you have a problem with the car. You call the garage, say "it broke" and turn off your phone. How long will you be waiting before the garage arrives with the right bits and tools to fix the car given they don't know what make or model it is, who you are, what happened when it all went wrong, or even where you are?

That's what you've done here. So stop typing as little as possible and try explaining things to people who have no way to access your project!

Use the "Improve question" widget to edit your question and provide better information.
PIEBALDconsult 14-Jul-24 13:05pm    
Yeah, by using the provided procedure(s).
But why are they stored in XLS? That seems like a bad idea. When you script the database and its objects, you should script the extended properties as well -- that's what I do.

1 solution

Whichever way you choose to do this, ultimately you are going to use this[^] procedure to add the property.

There are a few ways you can read the data directly from inside SQL Server. You could add the spreadsheet as a linked server, use the SQL Server import/export wizard, SSIS doing ETL, or you could read the data as a rowset.
SQL
SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=C:\pathto\file.xlsx', [Sheet1$])
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900