sql

purchased software

I bought usage rights to a confederate soldiers database which is in sql, I bought it to intergrate with my wordpress genealogy blog, and I need to know if there is any way to do this, the place where I purchased will not give my money back, and are not very helpful as far as figuring this out. thanks, r. summers ...

Date time exception in coldfusion query in cfc and mySQL

I'm moving from an MS Access backend to mySQL. This used to work but now doesn't and I can't figure the problem. <cfargument required="false" name="expiry" type="any" default="" /> <cfquery datasource='#arguments.dsn#'> INSERT INTO users(expiry) VALUES (<cfqueryparam value="#arguments.expiry#" cf...

Restore DB from one server to another by sql-script

Are there any way to restore db from one server to another, if I know other server IP address? Can I do it by sql-script or some wizard? I use MS Sql Server Managment Studio 2008 ...

Avoiding branching in stored procedures that return search results?

I have an application that needs to return search results from a SQL Server 2008 database. I would like to use a single stored procedure to return the results but I am finding that as I build the stored procedure it is full of many Else .. Else If statements with the query repeated over and over with slight variations depending on the us...

Large MyISAM table slow even for non-concurrent inserts/updates

I have a MyISAM table with ~50'000'000 records (tasks for web crawler): CREATE TABLE `tasks2` ( `id` int(11) NOT NULL auto_increment, `url` varchar(760) character set latin1 NOT NULL, `state` varchar(10) collate utf8_bin default NULL, `links_depth` int(11) NOT NULL, `sites_depth` int(11) NOT NULL, `error_text` te...

How do I check the end of a particular string using SQL pattern matching?

I am trying to use sql pattern matching to check if a string value is in the correct format. The string code should have the correct format of: alphanumericvalue.alphanumericvalue Therefore, the following are valid codes: D0030.2190 C0052.1925 A0025.2013 And the following are invalid codes: D0030 .2190 C0052. A0025.2013. A0025.201...

How can I get all objects with a timestamp greater than X from an EF repo?

I have a timestamp (rowversion) column (called t_stamp) in my tables. I use EF4 as my ORM. I see that the timestamp fields become byte[] properties on my objects. I want to use LINQ something like this: byte[] last = 0x00782342 from o in _db.Objects where o.t_stamp > last select o But that doesn't work because I can't use > on a byt...

Create Trigger to log SQL that affected table??

I'm trying to find out what is updating the value of a column and i have very little knowledge of the application. At a quick glance I've noticed about 90% of the applications business logic is handled on the database. Needless to say the depth of SP's, functions, and triggers is crazy. I'd like to create a trigger on the table in quest...

Where clause in sql request should be resolved last

Hello, I've got a SQL request that takes very long time to execute. So I want to make it better but don't known how to do it. Here is an example: My request: SELECT * from T1 Inner join T2 on T1.a = T2.b Inner join T3 on T2.c = T3.d WHERE 1=1 AND T2.e = 'a certain value' --I call i the Clause1 and dbo.MyUDF(T1.id) = 1 --I call i...

What is the easiest method to compare large amounts of similar text?

Hi all, somewhat open ended question here as I am mostly looking for opinions. I am grabbing some data from craigslist for apt ads in my area since I am looking to move. My goal is to be able to compare items to see when something is a duplicate so that I don't spend all day looking at the same 3 ads. The problem is that they change t...

Best Logic for Processing Master-Detail Records

Let's say, we have these SQL tables: [Articles] bill int (pkey) arti int (pkey) name varchar(50) [Bills] bill int (pkey) fdate date uid int Let's suppose we have a list of items on a grid, representing a bill: -------------------------------------------------------------- Id[ 15] Date [01-...

programming add-ons, accessing backend of HRMS

HR manager asked me to pick a good HRMS system for them to use i have zero experience with HR systems. one of the factors that i would look at is how "open" it is and whether i can connect to it and run select statements on it, and whether i can program add-ons. can you recommend to me some HR systems that allow you to do these? the...

Multiple row insert in sql server from java

I need to insert multiple row's into sql server database (100 at a time) from my java code. How can i do this..? Currently i am inserting one by one and this does not look efficient... Kaddy ...

PHP/MySQL Pagination

Hey, I am new to php and sql, and i have one tiny question about how to realize sql query , that can: Take for example 5 entries from DB, insert them on 1st page (1-5) Than take next 5 entries from same DB and insert them on another page (5-10) and so on :) Thank you ) ...

Trouble with a datareader in visual basic and SQL

Hello, i am working on a search feature for a program i am working on and i found a tutorial online that provides some insight but the actual code, after being modified to fit my aplication, does not work. i get two different errors as of right now, one that tells me "the value of type 'System.data.sqlclient.sqldatareader' cannot be conv...

How to use SQL 'LIKE' with LINQ to Entities?

I have a textbox that allows a user to specify a search string, including wild cards, for example: Joh* *Johnson *mit* *ack*on Before using LINQ to Entities, I had a stored procedure which took that string as parameter and did: SELECT * FROM Table WHERE Name LIKE @searchTerm And then I would just do a String.Replace('*', '%') befor...

Most compact and fastest way to store my string in PostgreSQL

I have a large hexidecimal (16 byte, 32 hex digits) data item that always has the format: 00d980113901429fa6de7fb7e2da705a This is coming in as an ASCII string from my source (i.e., the zero above is character zero 0x30, not 0x00), and I would like to know peoples' opinions on the best way (irt storage and speed) to store this in Post...

Oracle: copy row while updating one field

Please note: I am asking the question I want answered. I know this question means the database is set up poorly. So I will vote down any questions that suggest changing the way the table is set up. I need to duplicate a bunch of rows, while changing one value. name col1 col2 dave a nil sue b nil sam c 5 needs t...

Left Join two columns with the same type of data, different values

In my table I have two columns, cars.station1_id and cars.station2_id. These columns contain an ID number referencing stations.id. I need to take the two ID's and retrieve stations.name for each of them. How do I do this? This is my code to join one column: SELECT station1_id, station2_id FROM cars LEFT JOIN stations ON stations.id ...

Which is faster: Working from memory or lots of queries?

You need to pull a large amount of data (thousands of entries) from a local SQL server to be used in generating a report. You have two options: 1) Use a single query to get the data from the server, load it into a .NET data table and use a series of loops to get the information you need 2) Perform an SQL query each time you need a rec...