I have a single database field that contains a start date, end date, and exclusions in the form
available DD/MONTH/YYYY [to DD/MONTH/YYYY]?[, exclude WORD [, WORD]*]?
Meaning it always starts with "available DD/MONTH/YYYY", optionally has a single "to DD/MONTH/YYYY", and optionally has an exclude clause that is a comma separated list ...
How would you create an installation setup that runs against multiple schemas taking into consideration the latest version of the database updates? Ideally: update a single file with a new version number, then send the DBAs an archive containing everything needed to perform the database update.
Here is the directory structure:
| inst...
SQL 2000
The NED table has a foreign key to the SIGN table NED.RowID to SIGN.RowID
The SIGN table has a foreing key to the NED table SIGN.SignID to NED.SignID
The RowID and SignID are clustered primary keys that are guids (not my choice)
The WHERE clause is:
FROM
[SIGN] A
INNER JOIN NED N ON A.SIGNID = N.SIGNID
INNER JOIN Wi...
I want to join 2 tables together but i cant get it to work.
These are the tables:
threads: id, title
posts: thread_id, message
$sql = mysql_query("SELECT threads.id, threads.title
FROM threads
JOIN posts ON posts.thread_id = threads.id
WHERE threads.id = ".intval($_GET['id']))...
Doing some refactoring in some legacy code I've found in a project. This is for MSSQL. The thing is, i can't understand why we're using mixed left and right joins and collating some of the joining conditions together.
My question is this: doesn't this create implicit inner joins in some places and implicit full joins in others?
I'm of ...
I've been playing around with the new aggregation functionality in the Django ORM, and there's a class of problem I think should be possible, but I can't seem to get it to work. The type of query I'm trying to generate is described here.
So, let's say I have the following models -
class ContactGroup(models.Model):
.... whatever .....
I have the following table:
CREATE TABLE IF NOT EXISTS `notes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`uid` int(10) unsigned NOT NULL DEFAULT '0',
`note` text,
PRIMARY KEY (`id`)
)
INSERT INTO `notes` (`id`, `uid`, `note`) VALUES
(1, 1, 'noteteeext'),
(2, 1, 'notenotenotenote');
As you can see i have 2 rows with uid=1 but i...
Dear Good people
I have table of employees and column called managedby.
I want to roll actual and target figures up from employee to lead to manager to director and etc.
create table
(
empid int
,Name varchar(255)
,actual decimal(38,2)
,target decimal(38,2)
,managedby int
)
and below is what have done so far:
with emp(Period,La...
Here's a simplistic look at the table I have
Category
CategoryId
CategoryName
ParentCategoryId
As you can see, the catalog table is a self referencing table, so recursing it is possible by starting at 0, which is the fake "root" category (could just as well be null, but it's not).
Sample Data:
1, Apples, 0
5, Yummy, 1
10, Really Y...
Given any DbConnection from any Data Provider, is it possible to determine the character or characters used to quote a string literal as well as escape any special characters within the string? I'm also interested in the characters necessary for quoting schema/table/column name identifiers.
Using parameters to specify these things is no...
Is there a way I can get a scripting of all tables, procs, and other objects from a database? I know there's an option to script the database but it only gave me some sort of top level script, certainly not a script to create all tables, procs, udfs, .etc.
...
Can I run an update query and in one single field run multiple updates like:
"joe doe" updated to 334 & "barry davis" updated to 456, etc
basically I want to convert the name to number (in my case it would be the employee ID#), and I have about 500 employees so one at a time is a little out of the question. the table is import from exc...
I need to implement a tool that runs programs from SQL Server database when a DB record matches some condition. Is there a way to do it?
...
I would like to take two separate strings of value pairs delimited by commas and insert each pair into a row in the database.
For example:
X = "1,2,3" Y = "A,B,C" => X | Y
---------
1 | A
2 | ...
I want to create a table that stores values from two different tables;
From table 1: cust_id (varchar2), invoice_amt (float)
From table 2: cust_id (from table 1), payment_date
My table should have 3 fields:
cust_id, invoice_amt, payment_date
I tried the following, which is obviously wrong.
create table temp1 as (
selec...
I have a table say EmployeeAbsence that has three columns: EmployeeId, LeaveReason and Date. This table records attendance of employees on a daily basis. I want to know the list of employees who took leave in last 14 days.
For example,
1 XYZ 2009-07-20
2 XYZ 2009-07-19
--
---
--
1001 XYZ 2009-07-04
In this case, my query output shoul...
I have a stored procedure which will pick MQ files from receive location, process it and drop it in save location.
Currently, this stored procedure is not working when I execute it manually.
But files are picked up and saved in the save location automatically at a particular time of day daily. I don't know which stored procedure is cal...
I have just noticed that Sql Profiler 2008 is not hiding trace outputs that include sp params called password. In 2005 it used to give me a message saying "The text has been replaced with this comment for security reasons".
Has they removed this security feature?
...
if i have a field in my table that i want to verify exists, how do i use the contains method to determine if it exists.
i would have thought the contains method just takes in a string but it seems to take in my whole linq data object
...
Hi there,
I have an admin page to search for products to edit, but the page keeps returning the error;
Microsoft OLE DB Provider for SQL Server error '80040e14'
Ambiguous column name 'prod_id'.
/__admin/searchproducts.asp, line 89
I'm unsure why this error is cropping up, because the page and site is a direct copy of another website ...