Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

include sql files in project

Status
Not open for further replies.

ralphtrent

Programmer
Jun 2, 2003
958
US
Hello
I have a dll that is my api to a database. To access the database, I have sql files as part of that project. I currently embedd each sql file into the dll. To read it, I need to create a stream of the file and read it. Each time I make a change to the sql files, I need to recompile the the dll.

The dll is access via multiple applications, (web/windows services). The dll gets executed from the windows directory so if I do not embed them I need a way to forcibly tell the dll where to get the sql files.

Does anyone have any suggestions? I could make a registry entry, but that is not ideal as that would need to be manually managed for each server and I may not have access to do that on all the servers.

Thanks,
RalphTrent
 
Um...um...

Well, that's definately one way to structure a project.
Normally the SQL code is in the database, as Stored Procedures.

Then you just need the name of the stored procedure.
Depending on the scope of the project, you may have a separate application which "lays down" or incrementally upgrades your project.

With large scale appsn with minor revisions (Most Businesses), the code may be source controlled in the same location, but it is normally not deployed along side.

Lodlaiden

PS: You didn't actually post a problem.

I haz all the letters: SME, BA, QA, PM, DEV, DBA, UAT, SE, HD
 
Um... Um..." That's funny, kinda made my actually.

I totally agree, but I don't have write access to the database so this what i have to deal with.

its not so much a problem more so a "suggestions please" post. What I am trying to avoid is having to rebuild the project and laying down the dll again just because I change a text file. I think my only option may be a regkey pointing to the directory with the sql in it some how.

RalphTrent
 
Do you mean :

1. You don't have write access to the PRODUCTION database?
[tab]This is normal at larger corporations
2. You working with a 3rd party database and they aren't supposed to know you're doing what your doing?
[tab] This happens from time to time. I've done it myself.

If you are doing straight selects, then look at using LINQ-to-SQL. This is a .dbml file.
This lets you connect to the database and automatically create structured data classes.

Lodlaiden

I haz all the letters: SME, BA, QA, PM, DEV, DBA, UAT, SE, HD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top