×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

include sql files in project

include sql files in project

include sql files in project

(OP)
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

RE: include sql files in project

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

RE: include sql files in project

(OP)
"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

RE: include sql files in project

Do you mean :

1. You don't have write access to the PRODUCTION database?
    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?
     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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close