I have the following Query in SQL Server 2005:
SELECT
PRODUCT_ID
FROM
PRODUCTS P
WHERE
SUPPLIER_ORGANIZATION_ID = 13225
AND ACTIVE_FLAG = 'Y'
AND CONTAINS(*, 'FORMSOF(Inflectional, "%clip%") ')
What's interesting is that using this generates a Hash Match whereas if I use a different SUPPLIER_ORGANIZATION_ID (older supplie...
I have been using this method to filter my queries:
Create PROCEDURE [dbo].[pGetTask]
@showCompletedTasks bit = 1
,@showInProgressTasks bit = 1
,@taskID int = null
,@projectID int = null
,@applicationID int = null
,@clientID int = null
... Snip ...
where
a.clientID = isnull(@clientID, a.clientID)
an...
I have several MS Access queries (in views and stored procedures) that I am converting to SQL Server 2000 (T-SQL). Due to Access's limitations regarding sub-queries, and or the limitations of the original developer, many views have been created that function only as sub-queries for other views.
I don't have a clear business requirement...
Hi,
I have a temporary table with three columns
pay_id,
id_client_grp,
id_user
Basically i want to ensure that this table should have all the rows having same client group and same id_user if not i want to know which pay_id is the culprit and throw error to user.
Can somebody help me with a query.
Thanks,
Rishi
...
I have a nice little Linq2SQL project however when deployed the database is on another server. I keep getting a named pipe error that the remote server doesn't exist - yet it does, it has Named Pipes enabled (protocol + surface) SQL 2005. TCP connections work fine.
I've tried setting the library in the connection string to a TCP one, I ...
I am reading a table A and inserting the date in Table B (both tables are of same structure except primary key data type). In Table B, Primary key is int whereas in Table A it is UniqueIdentifier.
INSERT INTO TableB
(ID, Names, Address)
(select ID, Names, Address from TableA)
Now how can i insert int type incremental value (1,2,3,so o...
I am using this SQL query to order a list of records by date in a php page.
SELECT ARTICLE_NO, USERNAME, ACCESSSTARTS, ARTICLE_NAME FROM table WHERE upper(ARTICLE_NAME) LIKE % x % ORDER BY str_to_date(ACCESSSTARTS, '%d/%m/%Y %k:%i:%s');
This works fine.
In a different php page, I want to be able to delete this record, and show the n...
So I have a few Queries already written and my goal is to have a user input certain fields that would change the way the Query is returned, basically having the user change 2 or 3 parameters of the original Query.
First, I'm having problems getting a Query to execute in VBA:
Private Sub QResultButton_Click()
DoCmd.OpenQuery (Readings200...
I have a Java object that I want to store in a local in-memory database. The Object has a One-Many FK relationship, otherwise it has 20 or so Integer/String/Enumerated fields.
I would like to avoid using a framework.
Even though the objects themselves are not very large, there will be a large amount of these objects being inserted/u...
In my table, I have a nullable bit column (legacy system...) and another developer recently made a change to a stored procedure to only show values where the bit column was not true (1). Because this is a nullable column, we noticed that if the column was NULL, the record was not being picked up. WHY is this?
Both the other develope...
Here's a bit of a different question for you computer history buffs. Help me settle a bet between myself and a buddy of mine:
Q: When were stored procedures introduced into the SQL Server product? I need the year and/or version.
Thanks.
EDIT:
Ok, going back beyond SQL Server to Sybase
...
I have a table with a foreign key and a boolean value (and a bunch of other columns that aren't relevant here), as such:
CREATE TABLE myTable
(
someKey integer,
someBool boolean
);
insert into myTable values (1, 't'),(1, 't'),(2, 'f'),(2, 't');
Each someKey could have 0 or more entries. For any given someKey, I need to know if a)...
How do you find the smallest unused number in a MS SQL column?
I am about to import a large number of manually recorded records from Excel into a MS SQL table. They all have a numeric ID (called document number), but they weren't assigned sequentially for reasons that no longer apply, meaning from now on when my web site records a new ...
In SQL Server 2005, how do you read an image from the Categories table in Northwind?
I can upload my image to my own database and display it from there, but I can't display an image from Categories table in Northwind.
Can someone please show me how to do this?
...
I'm not sure how to write this query in SQL. there are two tables
**GroupRecords**
Id (int, primary key)
Name (nvarchar)
SchoolYear (datetime)
RecordDate (datetime)
IsUpdate (bit)
**People**
Id (int, primary key)
GroupRecordsId (int, foreign key to GroupRecords.Id)
Name (nvarchar)
Bio (nvarchar)
Location (nvarchar)
return a distinct ...
Im building a school website and got stuck on this problem.
The SQL database is structured as follows ( i do not have permission to modify their database)
**GroupRecords**
Id (int, primary key)
Name (nvarchar)
SchoolYear (datetime)
RecordDate (datetime)
IsUpdate (bit)
**People**
Id (int, primary key)
GroupRecordsId (int, foreign key t...
i want t0 delete a row with minimum value of a particular field from a table if number of records less than 5;
...
Hi,
How do I delete a record from a table?
For example, the table has two columns: eno and ename. I want to delete one value in ename from the table:
Eno Ename
1 asha
2 bimal
I want to delete the value 'bimal'.
...
Hi
what is the SQL 2005 version that i can install on Win XP ?
I need DataBase and to create tables,query....
thank's in advance
...
I would like to compare two SQL Server databases including schema (table structure) and data in tables too. What is best tool to do this?
...