Hi all,
Recently we had an encoding problem in our system :
If we had the string "æ" in our db ,it became "æ" on our web pages.
Now this problem is solved, but the problem is that now we have a lot of "æ" in our database : users didn't see and validate pre-filled form with these characters.
I found that If you read in utf 8 C3A6 yo...
I have a issue about creating databases in SQL 2005.
I want to be able to change the default logical filename for the mdf file. At the moment the log logical filename ends in _log by default. I want the data logical filename to automatically end with _data for consistency.
Is there a way i can set this?
Andrew
...
Bit of an odd one for you:
I've got two connections to a database, on one I've opened a _RecordsetPtr with a pessimistic lock. I can no longer send an UPDATE command on the other connection. I can send a SELECT command on the second connection and data is returned. If I use a read only lock then there are no problems however when I use ...
I have a table with 3 columns: user, value, and date. The main query returns the values for a specific user based on a date range:
SELECT date, value FROM values
WHERE user = '$user' AND
date BETWEEN $start AND $end
What I would like is for the results to also have a column indicating the week number relative to the date range. So if ...
is there a single select statement that will do all three of those: primary key, unique, and auto_increment?
...
I am using an alphabetical sorting feature and need a SQL statement to return records beginning with a variable length string. However, records also need to be returned if there are periods, spaces, or dashes between any of the characters in the string.
For example, the value passed in could be "M" (easy). Or "MA" (in which case it ne...
This query was working fine when the database was small, but now that there are millions of rows in the database, I am realizing I should have looked at optimizing this earlier. It is looking at over 600,000 rows and is Using where; Using temporary; Using filesort (which leads to an execution time of 5-10 seconds). It is using an index...
I'm new to NHibernate, so this is probably my mistake, but when I use:
schema.Create(true, true);
I get:
SchemaExport [(null)]- There is already an object named 'XXX' in the database.
System.Data.SqlClient.SqlException: There is already an object
named 'XXX' in the database.
I grabbed the SQL code nHibernate was using, ran it dire...
Hey, I am trying to put a little logic into my C# app that will create a table called Import, IF it doesn't already exist.. here is my code, it doesn't seem to work tho.
con.Open();
using (SqlCommand cmd = con.CreateCommand())
{
cmd.CommandText =
...
I have to create a view from more than one table in MS Sql Server database, but i am not able to get the correct syntax for the same. need help.
thanks.
...
I just started working on upgrading a small component in a distributed java application. The main application is a rather complicated applet/servlet combo running on JBoss and it extensively uses Hibernate for its DataAccess. The component i am working on however is very a very straightforward data importing service.
Basically the wor...
This question is about what happens with the reorganizing of data in a clustered index when an insert is done. I assume that it should be more expensive to do inserts on a table which has a clustered index than one that does not because reorganizing the data in a clustered index involves changing the physical layout of the data on the di...
Query:
INSERT INTO `job_listing_has_employer_details` (`job_listing_id`, `employer_details_id`)
VALUES (6, '5')
Error:
Cannot add or update a child row: a foreign key constraint fails (mydb.job_listing_has_employer_details, CONSTRAINT job_listing_has_employer_details_ibfk_2 FOREIGN KEY (employer_details_id) REFERENCES employer_det...
I have three tables related to this particular query:
Lawson_Employees: LawsonID (pk), LastName, FirstName, AccCode (numeric)
Lawson_DeptInfo: AccCode (pk), AccCode2 (don't ask, HR set up), DisplayName
tblExpirationDates: EmpID (pk), ACLS (date), EP (date), CPR (date), CPR_Imported (date), PALS (date), Note
The goal is to get the dat...
I have a column which is integer and I want to search all numbers starting with 1500.
I know I could use something like left(accountid, 4)= 1500.
But is that an optimum solution or is there a better approach?
I am using SQL Server 2005.
...
OK, so this is the strangest issue in .net programming I have ever seen. It seems that object fields are serialized in .net web services in order of field initialization.
It all started with Flex not accepting SOAP response from .net web service. I have found out that it was due to the order of serialized fields was statisfying the orde...
whats the point of specifying a table if now() is going to be the same for any table.??
...
Based on following AreaState table
Area State
-------------------
A1 Active
A1 Active
A1 Active
A1 Proposed
A1 Proposed
A2 Active
A2 Proposed
I want to write a stored proc that returns count of state for each of the areas. Input to the stored proc is any valid State (in this case @state is the input parameter). I was hoping ...
I am storing images in a SQL database , right now I have images being stored in separate tables depending on the object the images belong to, is there any reason ( performance etc..) why I should keep it this way and not store all images in the same table?
...
Hey there. I have a c# application that parses txt files and imports the data from them into a sql db. I was using sqlite and am now working on porting it to sql server. It was working fine with sqlite but now with sql i am getting an error when it is processing the files. It added the first row of data to the db and then says "parameter...