database

How to detect a SQL Server database's read only status using tsql

I need to know how to interrogate my Microsoft SQL Server to know if a given database has been set to read only or not. Is that possible? ...

How can I use SQL to select duplicate records, along with counts of related items?

I know the title of this question is a bit confusing, so bear with me. :) I have a (MySQL) database with a Person record. A Person also has a slug field. Unfortunately, slug fields are not unique. There are a number of duplicate records, i.e., the records have different IDs but the same first name, last name, and slug. A Person may also...

Can Jetty be installed on ubuntu server?

I plan on using solr on my VPS. My server is Ubuntu. Does anybody know if Jetty can run without problems on Ubuntu, just as in the example Solr distribution? With Tomcat it is possible, but my Q is, is it possible with Jetty? Thanks ...

Which of these queries is more efficient?

Which of these queries are more efficient? select 1 as newAndClosed from sysibm.sysdummy1 where exists ( select 1 from items where new = 1 ) and not exists ( select 1 from status where open = 1 ) select 1 as newAndClosed ...

With modern social networking and scaling, can Cassandra replace the standard relational database such as MySQL?

Is it possible to build the entire social networking application on cassandra? Sure, it takes longer to set up, but it scales much better. Correct? Please list the situations when Cassandra should be used. ...

how to design a schema where the columns of a table are not fixed

I am trying to design a schema where the columns of a table are not fixed. Ex: I have an Employee table where the columns of the table are not fixed and vary (attributes of Employee are not fixed and vary). Frequent addition of a new attribute / column is requirement. Nullable columns in the Employee table itself i.e. no normalization ...

Import CSV to class structure as the user defines

I have a contact manager program and I would like to offer the feature to import csv files. The problem is that different data sources order the fields in different ways. I thought of programming an interface for the user to tell it the field order and how to handle exceptions. Here is an example line in one of many possible field order...

Filter objects within two seconds of one another using SQLAlchemy

Hello: I have two tables with a column 'date'. One holds (name, date) and the other holds (date, p1, p2). Given a name, I want to use the date in table 1 to query p1 and p2 from table two; the match should happen if date in table one is within two seconds of date in table two. How can you accomplish this using SQLAlchemy? I've tried (u...

Access one database from multiple ORMs :: Caching issue

I know this is not a good idea and the best would be to let the applications talk Web Services. But I have a situation where the legacy application is accessing a database with an ORM and I need to access the same database from the new .net application using Fluent nHibernate. So the question is what problems this will make and how to s...

How can I use PHPUnit to set up and tear down the database using a SQL file?

I have a MySQL file that represents my database in a specific state that would allow me to test a class I am working on. What I want to do is have PHPUnit clean and rebuild the database from this file for each test or set of tests. How can I go about that without having to resort to rewriting the data in the XML format that PHPUnit uses...

Where do filesystems like Reiser, NTFS, etc store the file tables?

Where do filesystems like Reiser, NTFS, etc store the file tables? We're looking at writing our own filesystem, and wondering if we should use a single file to hold it all using btree's or use something out there. Any advice? This is more a learning exercise than anything. Edit: removed NFS, and replaced with NTFS ...

What data type to use for variable length data (for performance)?

What data type should I use for data that can be very short, eg. html link (think twitter), or very long eg. html blog post (think wordpress). I am thinking if I use varchar(4000), it maybe too short for a html formated blog entry? but if I use text, it will take up more space and is less efficient? [update] i am still condering usin...

How UPDATE and SELECT at the same time

I need to update some rows of the tables and then display these rows. Is there a way to do this with one single query and avoid this 2 query ? : UPDATE table SET foo=1 WHERE boo=2 SELECT * from table WHERE ( foo=1 ) AND ( boo=2 ) ...

nodejs and database communication - how?

Hello. I've heard much good about nodejs and writting client-server application with it. But I can't get, for example, when developing IM client-server application, how nodejs server script is supposed to talk to database server to actually store it's data? Or may be I miss something and nodejs server scripts are not supposed to do that...

Database structure for versioning and multiple languages

How can I solve the issue of content existing in multiple versions and multiple languages? My current structure: Each content can only have one active version in each language, and that's how I'm curious on how to best solve. Right now I have a column of the contentversions table, which means for each change of active version I have ...

Solr; What does this mean?

At the end of the README.txt file which is located in the example directory under solr, I find this line: NOTE: This Solr example server references SolrCell jars outside of the server directory with statements in the solrconfig.xml. If you make a copy of this example server and wish to use the ExtractingRequestHandler (SolrCell...

Solr authentication possible? (or apache port authentication would also work)

Currently anybody can access the solr admin page by going to my_ip:8983/solr I can't have it like that, so how can I make it prompt for password or something? I have setup my servers apache2.conf file to prompt for password whenever my site is accessed by www.mydomain.com. But when using another port, the "require password" wont show ...

Best way to send information from one web db/app to multiple desktop/mobile apps?

I am planning to build multiple desktop addons ( for Chrome & Firefox ) and mobile apps ( for iPhone and Droid ). The application would have its own database, and it would be filled by downloading information from a web database (possibly MySQL in Drupal). My plan is to have specific information in the web database transferred to an SQ...

How can I get started with PHPUnit, where my class construct requires a preconfigured db connection?

I have a class that uses a lot of database internally, so I built the constructor with a $db handle that I am supposed to pass to it. I am just getting started with PHPUnit, and I am not sure how I should go ahead and pass the database handle through setup. // Test code public function setUp(/*do I pass a database handle through here,...

Solr; "rookie" question

I have a SolrPhpClient on my classifieds website, and whenever users wants to add/remove classified the index in Solr gets updated via Php code. So I wonder, does this mean that my Solr index is open for anybody to alter with? Same Q applies to the Solr Admin page. If I set a password for the admin page, does this mean that my classifi...