Can someone copyright a SQL query?

Viewed 15531

I work for a school district. Every year we have to export a list of students from our student management system and send it to a company that handles our online exams.

So to do this export, we had to hire someone who knew the inner workings of our student management system. He wrote an sql (Adaptive Sybase SQL Anywhere) query to export the students to a csv file like we needed. This was before I started working for the district, so for a while I assumed this was an actually application, until it came time for me to do the export myself.

And every year he charges us $500 to update this query to export the students for the current year. So when I discovered it was only a query (.bat file and .sql file), my thought was "I can update this myself". All I have to do is change the years in the query (eg. 2009 to 2010).

The query (.sql file) itself has this comment at the top:

// This code was writtend by [the guy]
// and is the property of [his company]...Copyright 2005,2006,2008,2009
// This code MAY NOT BE USED without the expressed written consent of 
// [his company].

(Yes, it really does says "writtend".)

So now my boss is worried that we're violating the copyright. And that the guy is gonna find out that I updated the query myself because we haven't asked him to update it this year and take legal action.

So back to the subject's question: Can he really copyright this query? And if so, is modifying it ourselves a copyright violation? In my mind, a single query isn't program code. It's more a command line command. But I don't know what it's considered legally.

72 Answers

I'm not a lawyer, yadda, yadda, yadda...

This is from www.copyright.gov:

"Copyright protection is not available for ideas, program logic, algorithms, systems, methods, concepts, or layouts."

If you extract the SQL code from his .bat file, it would most likely fall under the category of "program logic". He might be able to argue that his simple .bat file is a "program", but he'll most likely lose that argument if it comes down to it.

Also (and more importantly), you have to actually file with the government to obtain a copyright on a computer program. I highly doubt that he has done that every year (any change to the program would require a new application and non-refundable fee).

Finally, if this guy is hurting so much for his $500 a year then I doubt that he has the money to spend on a lawyer to litigate this. Do it yourself and if he actually finds out AND raises a stink (I doubt he will) then let him rant and rave. Don't explain yourself, don't get into an argument. Just say that you're not interested in what he has to say and "have a nice day". He'll most likely go away in a huff never to be heard from again.

Again, this is not legal advice, I'm not a lawyer, I've never played one on TV.

Have a developer turn on SQL Profiler while this guy runs his query (assuming you are using SQL Server). Capture the query and use it as your own.

Just because you throw up a comment on your query (which may not get passed to SQL) that claims a copyright doesn't mean it is. If you own the database and the data in it then you have the authority to review every query that goes to it. Remember, aside from everyone else not being a lawyer, we're assuming that you are also not a lawyer and you can easily play dumb on this one. I would let location be 9/10's of the law, capture the query and if this guy wants to sue, tell him to make your day.

The other key element here is that there is no intent to redistribute this guy's code. You are making a derivative work for your own internal use.

Related