Fast Help Needed On Simple Linked SQL Server Select

Jan 11, 2002

I have 2 SQL 2000 servers. One has been added as a linked server.
They both have a db called claims. If I am on server 1 and want to write a sql statement I am stuck with the write syntax

I tried select patient.* from testedi..claims.

The server is linked using the sa user. I know this is simple but in a hurry and stuck. THe servers are on same domain.
Thanks

View 1 Replies


ADVERTISEMENT

Remote Scan On Linked Server - Fast SELECT/Slow UPDATE

Aug 14, 2001

In an ASP, I have a dynamically created SQL statement that amounts to "SELECT * FROM Server1.myDB.dbo.myTable WHERE Col1 = 1" (Col1 is the table's primary key). It returns the data immediately when executed.

However, when the same record is updated with "UPDATE Server1.myDB.dbo.myTable SET Comments = 'blah blah blah' WHERE Col1 = 1", the page times out before the query can complete.

I watched the program in Profiler, and I saw on the update that sp_cursorfetch was being executed as an RPC once per each row in the table. In a table of 78000 records, the timeout occurs well before the last record is fetched, and the update bombs.

I can run the same statements in Query Analyzer from a linked server and have the same results. The execution plan shows that a Remote Query is occurring on the select that returns 1 row, and a Remote Scan is taking place on the update scanning 78000 rows (I guess this is where all the sp_cursorfetch calls are happening...?).

How can I prevent the Remote Scan? How can I prevent the execution of the RPC sp_cursorfetch for each row in the remote table?

Thank you!

View 2 Replies View Related

Simple SQL Help Needed

Jul 23, 2005

I'm looking for SQL code to do the following.TableAGrpID,IndID,Locked50001,10001,050001,10002,050002,10003,050002,10004,150002,10005,050003,10006,050003,10007,050003,10008,050004,10009,050004,10010,050004,10011,150004,10012,1I would like to return GrpID's where All IndID have Locked = 0RecordsetGrpID5000150003Email me at the following:Join Bytes!

View 2 Replies View Related

Simple Query Help Needed!

Aug 15, 2007

Hi I'm new to SQL and I'm stuggling with a simple query in MS-server 2005 and wondered if anyone can help me.

I'm trying to devide the ansewrs of two seperate queries, but both the queries use the same coloumn in the where clause to get the answer. Please can some one help!


eg.

select Sum(column1)

where column1 = 'x'

devided by

select Sum(column1)

where column1 = 'y'

View 2 Replies View Related

Simple (i Hope) SQL Help Needed

Sep 20, 2004

I was looking for a way to "globally" set my FROM database value. Is this possible?, or does the "FROM" syntax always require the database name? I would like to just state my table names in the FROM statement

BEFORE Example:
select T1.id, FROM PT.ptuser.tblRequest T1, where etc....

Can the "PT.ptuser" be declared somehow 1 time so my SQL code could look like...

AFTER Example:
select T1.id, FROM tblRequest T1, where etc....

hope this makes sense.... I'm trying to run SQL via Microsoft Query

View 4 Replies View Related

Simple SUM Function Needed

Jul 19, 2006

Hello all. I have an Access table with EmpName, JobTask, and Hours. Multiple lines can contain the same Employee with the same JobTask. What I need to do is to list the Employee, JobTasks (grouped), and summed hours for each JobTask.

DB Ex:

John Doe Welding 8
John Doe Cleaning 4
Bubba Smith Fork Lift 3
John Doe Welding 7
Steve Johnson Welding 5
Bubba Smith Fork Lift 6


Page output:

John Doe
Welding 15 hrs.
Cleaning 4 hrs.

Bubba Smith
Fork Lift 9 hrs.

Steve Johnson
Welding 5 hrs.

This is how I figured it should be, but it's not working for me:

SELECT EmpName, SUM (Hours), JobTask
FROM tblEmpTime
Group By JobTask

Any suggestions would be greatly appreciated.

Thanks,

Parallon

View 4 Replies View Related

Help Needed With Simple Case Statement In SQL

Mar 1, 2007

Hello,
 
I am looking to modify this Case Statement.  Where it says ELSE '' I need it to display the actual contents of the cell.  1 = Yes , 0 = No, (any other integer) = actual value. 
Right now if the value is anything other than 1 or 0,  it will leave the cell blank.
CASE dbo.Training.TrainingStatus WHEN 1 THEN 'Yes' WHEN 0 THEN 'No' ELSE '' END AS TrainingStatus
Thank You.

View 1 Replies View Related

Help Needed With Simple Stored Procedure

Mar 31, 2007

Hey all,
Can anyone tell me why this stored procedure doesn't work?
 
ALTER PROCEDURE [dbo].[RemoveLocation]
@Id int,
@Name varchar
AS
DELETE FROM Classifieds_Terminals
WHERE [Id] = @Id and [Name] = @Name
 
 
I try exeuting it like this:
USE [CLASSIFIEDSDB2.MDF]
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[RemoveLocation]
@Id = 18,
@Name = N'Terminal A'
SELECT 'Return Value' = @return_value
GO
 
 
It returns 0 and nothing happens....???
 
Here is the table:
id | Name 
18 Terminal A18 Terminal B18 Terminal C

View 2 Replies View Related

Linked Server (Oracle) - No Select Possible

Mar 7, 2008

Hello,

I created a linked server to Oracle on SQL-Server 2005. I have stored the remote login username and password in the security settings (option "...Be made using this security context" in the Security tab of the Linked Server Properties.

The "Test connection" function works fine, but a select doesn't for every table the user owns. What we found out is: if the table consists only of columns defined as varchar2, the select works. As soon as the table contains only one column defined as number (without scale and precision), it doesn't work. The error displayed is:

The OLE DB provider "MSDAORA" for linked server "NEXUS_FVADM" supplied inconsistent metadata for a column. The column "WEBVORZUGSTYP" (compile-time ordinal 2) of object ""FVADM"."AKZ"" was reported to have a "DBTYPE" of 130 at compile time and 5 at run time.

The Column WEBVORZUGSTYP is defined as number.

Any ideas?

Regards,
Ralf

View 1 Replies View Related

Help Needed With Msg 7307 When Using Linked Servers

Jan 9, 2008

Greetings
I'm converting a client from Visual FoxPro 7.0 to SQL Server 2005. While I can certainly punch a flat file in VFP and read it into SQL Server it would really make life grand if I could simply access the FoxPro tables directly from SQL Server.

After all, they are both Microsoft products...

The import wizard talks to Fox Pro like a champ and it's screamin fast. However I'd like to be able to write T/SQL that access the data using linked tables.

I setup a linked server. In Management Studio, Object Explorer I click Test Connection on the Server Objects / Linked Servers / Providers and it says "The test connection to the linked server succeeded". The provider is named VFP_ALBUM.

However when I write a simple query "SELECT * FROM VFP_ALBUM...Table" ir SELECT * FROM OPENQUERY(VFP_ALBUM, 'SELECT * FROM Album') this is what I get:



Msg 7399, Level 16, State 1, Line 2

The OLE DB provider "VFPOLEDB" for linked server "VFP_ALBUM" reported an error. Provider caused a server fault in an external process.

Msg 7307, Level 16, State 1, Line 2

Cannot obtain the data source of a session from OLE DB provider "VFPOLEDB" for linked server "VFP_ALBUM". This action must be supported by the provider.

I think that the problem is that the Linked Server expects a foxpro "database" whereas the client is using "free tables" (e.g. there is a dbf file for each table) and that this is the problem. Not being a FoxPro expert... I scoured the internet and Microsoft sites for any information on error 7307, or using FoxPro tables as linked data sources to no avail. Anyone out there done this?

Thanks in Advance


View 1 Replies View Related

SQL Server 2014 :: Select On Linked Databases

Sep 18, 2014

I am trying to find out what records on in one DB and not the other. This SQL statement works find if the DBs are on the same Server. If I replace on the DBs with a linked DB (on another server) I get the following error.

SELECT *
FROM [LinkedServer].[DBonLinkedServer].[dbo].[Sales Price]
WHERE NOT EXISTS
(SELECT [LocalDB].[dbo].[Sales Price].*
FROM [LocalDB].[dbo].[Sales Price]
WHERE ([LocalDB].[dbo].[Sales Price].[Item No_] collate Latin1_General_CS_AS = [LinkedServer].[DBonLinkedServer].[dbo].[Sales Price].[Item No_]) AND
([LocalDB].[dbo].[Sales Price].[Unit of Measure Code] collate Latin1_General_CS_AS = [LinkedServer].[DBonLinkedServer].[dbo].[Sales Price].[Unit of Measure Code]) )

Msg 4104, Level 16, State 1, Line 3
The multi-part identifier "LinkedServer.DBonLinkedServer.dbo.Sales Price.Item No_" could not be bound.

Msg 4104, Level 16, State 1, Line 4
The multi-part identifier "LinkedServer.DBonLinkedServer.dbo.Sales Price.Unit of Measure Code" could not be bound.

View 2 Replies View Related

SQL Server 2008 :: How To Write A SELECT Statement To Get Data From A Linked Server

Feb 23, 2015

I have the linked server connection created and works perfectly well. I mean I am able to see the tables while I am on my database.

how do I write a SQL statement to reference the linked server ?

I tried the following:

Select top 100 * from casmpogdbspr1.MPOG_Collations.dbo.AsaClass_Cleaned

Then I get the error message....

Msg 7314, Level 16, State 1, Line 1

The OLE DB provider "SQLNCLI10" for linked server "casmpogdbspr1" does not contain the table ""MPOG_Collations"."dbo"."AsaClass_Cleaned"". The table either does not exist or the current user does not have permissions on that table.

View 2 Replies View Related

Historical Table - INSERT And SELECT With Linked Server

Aug 13, 2012

I have a historical table on a dedicated SQL Server (let's call it the reporting db) that is populated every morning with production data that does not already exist. The data in the prod table is purged after 7 days and nothing is ever deleted from the historical table. I have set up the linked server between the two 2008 SQL Servers, but when I try to run this simple query from the reporting DB, it takes more than 5 minutes and still "executing". I eventually have to cancel it:

-- INSERT INTO Temp_Import_historical
SELECT TOP 1 *
FROM [192.168.1.100].ProdDB.dbo.Temp_Import_historical a
WHERE NOT EXISTS (select [Temp_Import_ID] from Temp_Import_historical where a.[Temp_Import_ID] = Temp_Import_historical.[Temp_Import_ID])

I have omitted the INSERT statement on purpose, since I can't even get to output 1 row. Why this is such a resource intensive query?

View 9 Replies View Related

Select Into / Linked Server / Missing IDENTITY Attribute

Nov 28, 2005

Greetings,If I use a "select into" to clone a table, all attributes are createdcorrectly, however, if I use the same statement across a linked server,my identity column loses its IDENTITY specification.Is this a known issue or basic functionality of using "select into"with linked servers?Kurt

View 2 Replies View Related

Select From Linked Server Using Join, The Multi-part Identifier Could Not Be Bound.

Nov 6, 2006

Hello,

i am facing a bizarre problem, accessing data from a remote server which has been linked to my sql.
My SQL server is 2005 and the remote server is SQL 2000.
i have linked the remote server (called LinkedServer) so that when i run this query:
SELECT * FROM LinkedServer.SomeDB.dbo.SomeTable
executes successfully! However, when i run a similar query like this:
SELECT Column1 AS Col1,
LinkedServer.SomeDB.dbo.SomeTable.Column2 as Col2,
Alias.Column3 as Col3
FROM LinkedServer.SomeDB.dbo.SomeTable
INNER JOIN LinkedServer.SomeDB.dbo.SomeOtherTable1 ON LinkedServer.SomeDB.dbo.SomeTable.Column3 = LinkedServer.SomeDB.dbo.SomeOtherTable1.Column3

INNER JOIN LinkedServer.SomeDB.dbo.SomeOtherTable2 AS Alias
ON LinkedServer.SomeDB.dbo.SomeTable.Column3 = Alias.Column3

It gives me this error:
The multi-part identifier "LinkedServer.SomeDB.dbo.SomeTable.Column2" could not be bound.
The multi-part identifier "LinkedServer.SomeDB.dbo.SomeTable.Column3" could not be bound.
I have noticed that this error is generated only for the selected columns whose path has either been repeated (e.g. "LinkedServer.SomeDB.dbo.SomeTable.Column2" as opposed to "Column2") or for columns which are from aliased tables.

What is going on?!?!?!??!?!?!

Any Help would be tremendously appreciated!!!! 8..)

View 8 Replies View Related

Created Linked Server, Cant Do A Select On That Server

Mar 1, 2008

I created a linked server on server A to server B as follows...


USE master;

GO

EXEC sp_addlinkedserver

'B',

N'SQL Server'

GO

...in mgt studio (in a connection to A) from my local where as a person with sys admin rights on both A and B I'm having no problems connecting to either and running queries. When I run a query from a connection on A as select * from .[a db on B] .[an owner on B].[a table on B], I get an error that says Login failed for user 'NT AUTHORITYANONYMOUS LOGON'.

I believe both A and B are in the same domain

the default behavior that I saw checked in the linked server's security properties was "connection will be made using the logins current security context".

when change the default and clicked and entered "this security context" as domainuserid and password, rerun the query, I get error Login failed for user 'domain nameuserid'.

is there a simple way to get this to work, at least for test purposes? I even tried playing with the login mappings but nothing seemed to work.

View 7 Replies View Related

Select Help Needed

Feb 19, 2008

i m getting results like

metrics mdate items total
------------------------------------------------
001awer 2007-1-14 1 100.00
net100 2007-1-14 1 10.00
214sdf 2007-1-14 1 25.00
net16wrew 2007-2-14 2 80.00

so in short i want values of same items - total
but different metrics

like

metrics mdate items total
--------------------------------------------------------
001awer 2007-1-14 1 135.00
net100
net100
net16wrew 2007-2-14 2 80.00

how should i get this?

View 4 Replies View Related

Select Statement Help Needed

Aug 8, 2007

Hi,
Table A
member_no   - character 5course1         - character 1course2         - character 1
Table Bcourse_no      - character 1course_name - character 20I'd like a resultant view that contains A.member_no, A.course1, B.coursename as COURSE1NAME, A.course2, B.course_name as COURSE2NAMEI know how to make the join and pick up the name for course1 but I DON'T know how to pick up both names of course 1 and course 2 at the same time.I'm thinking I have to make a join on one column and then join the result of that a second time to pick up the other column's value?
Thanks in advance for any assistance,Stewart
 
 

View 2 Replies View Related

Complicated SQL Select Help Needed

Nov 13, 2007

Hi,
My users table contains a field called researchInterestId which looks like this: 1, 5, 10
This is because users where allows to select multiple options when choosing their research interests.
I have another table which contains the names of those research interests, which looks like this:
researchInterestId     researchInterestName
1                             Biology
2                             Cancer
 
My question is, when selecting my list of users, i wish to also display the names of their research interests. I know how to inner join but im not sure in this case as there are multiple values (1, 5, 10)
Hope that makes sense and that someone can point me in the right direction or let me know what this type of query is called?
Thanks
Sam

View 2 Replies View Related

Help Needed In Select Statement

Mar 4, 2008

Hi,
      I am trying to do a simple select statement which returns data from the table. The criteria is only if the count of the records is more than 10. Say, if a vendor called test exists 10 times in the table, I would like to display that vendor only, if less than 10, then that vendor won't be displayed at all.
Here is what I have started.
 
Select vendor_id, vendor_name, Invoice_Date, Invoice_Number from Vendors where Invoice_Date Between '01/01/2007' And '03/03/2008' Group By vendor_id, vendor_name, Invoice_Date, Invoice_Number Having Count(Invoice_Number) > 10
This doesn't seem to work. What am I doing wrong here?

View 7 Replies View Related

Help Needed With The Select Query

Mar 26, 2008

Hi,
  I have 2 tables. Plan and User. In my User table I have the following columns
UserId  ClientId Login Password PlatformId
 1              1     abc        XXX           1
 4             1     jcn          XXX           2
20           1       djfd        XXX            1
and the Plan table
PlanId  PlanName
 1       abc plan
2          Plan etc..
and ihave a sproc that will return the all the plans based on the clientId but i want to also get all the plans that have PlatformID 1 for the same client. This is my Sproc..
 SELECT
NULL PlanId,
'< All Plans >' PlanName

UNION

SELECT Distinct
PlanId,
PlanName
FROM
Plan cp
Join User u on cp.ClientId = u.ClientId
WHERE
u.PlatformId = 1
AND
cp.ClientId = @ClientId
OR
(
cp.ClientId = cp.ClientId
AND
@ClientId IS NULL
)


ORDER BY
PlanName ASC
 
 
But they dont filter it by PlatformId
any help will be appreciated.
Regards,
Karen

View 3 Replies View Related

Help Needed With Select Query

May 27, 2008

Hi all,
I need some help please with an select query. here's so scenario:3x Tables linked: Vehicles, Requests & ResultsTable Vehicles - vId, make, model, priceTable Requests - rId, name lastname, requestedmake, requestedmodelTable Results - vId, rId
I am trying to do a select on the Vehicles table where vId is not already also in the Results table for an given rId
What happens on the app: 1. dealers add cars on website - populate Vehicles tbl. 2. clients do a request for a vehicle - Populates Requests tbl. 3. dealers go page where they can asossiate their vehicles with requests - which populates the results tbl with both id's.All help is very much appreciated.
RegardsJacques

View 6 Replies View Related

SQL Select Help Needed - Dates

Mar 15, 2004

Hi everyone,

I've got a problem that I've been unable to work out.

I'm wanting to count the number of people that fall into a specific age group. For simplicity, lets say I'm JUST after people that are 10 years old.

This is what I'm trying to do:


SELECT 'Aged 10 years old', count(*)
FROM [People]
WHERE ([DOB] + [Date Entered]) = ?5 years?


Does anyone have a solution to this?

Thanks
Andrew

View 2 Replies View Related

Sql Select Statement Help Needed.

May 7, 2004

I have worked on developing a project that I am pleased to say is comming along nicely considering I have only been doing programming for a few weeks but I am now stuck and may be going down the wrong path.

I have two tables one that is used for logging via username and password, it also holds a third coloumn realting to the suers account that they do not enter. Once they have logged in I am recalling the users identity and running a query to establish what account the user belongs to. Later on in the script I am trying to run a query on a table called orders that list all orders belonging to that account that was established in the earlier query labelled as 'accountrequesting'.
The script I have below returns all orders for all accounts even though I have tried a wide variety of endings on the Sql search on the orders table.

The code may look a little untidy and to advanced programmers may look rough but I am still learning.....please can anyone help.

sub Page_Load(sender as Object, e as EventArgs)

'collecting the user identity
Dim user as string
user=request("User.Identity.Name")

'running a query to establish what account they have access to all from users table
Dim accountrequesting as string
accountrequesting = "select account_id from users where username = " & user & "'"

'opening the data source and connection
Dim ConnectionString As String = "Data Source=xxxx;Database=xxxx;User ID=xxxxxxx;Password=xxxxxxx"
Dim Myconn as New SQLConnection(connectionstring)

'this is the line I am stuck on, the account id in this orders table needs to match against the value gained in accountrequesting above tried a lot of different endings

Dim MySQL as string ="select prodshipped, account_id from orders"

'produces output
Dim ds as Dataset=New Dataset()

Dim Cmd as new SQLDataAdapter (MySQL, Myconn)


Cmd.Fill (ds,"orders")

MyDataGrid.datasource=ds.tables("orders").defaultview

MyDataGrid.Databind()

End Sub

View 9 Replies View Related

Select Cast Help Needed

Jan 26, 2006

What is the correct syntax for querying the first 20 characters of amemo field?I'm trying toSELECT CAST (varchar(20) fieldname) as newfieldnameand i get a bunch of errorsCan someone please help me?MS Access DB used with ColdFusionThanks

View 4 Replies View Related

SQL Select Statement Needed

Aug 16, 2006

I have a table consisting of two fields, OStype and OSversion, withentries like:OStypeOSversionsolaris 2.5solaris 2.6redhat 6.2redhat 6.2solaris 8redhat AS4solaris 10solaris 10redhat AS2.1redhat AS3redhat AS4I want to create a select statement that returns for each OS type, thetotal number of entries and for each version the total number ofentries.In the example the result would be:OStype OStype Count OSversion OSversion Countsolaris 52.5 12.6 18 110 2redhat 66.2 2AS2.1 1AS3 1AS4 2Thanks in advance for your help.Ian

View 3 Replies View Related

Sub-Select Query Needed

Jul 31, 2007

Hey guys, Hoping someone can help me ot here.. I am developing an SQL statement that can be run on DB2 and have got something already setup, but i need to modify it so that it only returns the highest record for a certain field.

let me explain/Show you what i have got, and what i want to acheive: The highlighted rows, is what i want to work with, as i only want to return the row with the highest value in ICPNLX (first Column)

Im hoping someone can help me out please, one person told me to use a sub-select query, but i am having trouble doing it.

SQL CODE:

Select icpnlx , IBPUSL, IBPUST, IBSUNO, XBXSMT, ICPUNO, IBITNO,ICPNLI, ICPNLS, ICREPN, IBRVQA-IBSDQA as REMAIN, MBWHSL
FROM mvxbdtaCF3.MPLIND INNER Join
mvxbdtaCF3.MPLINE On ICCONO = IBCONO And ICFACI = IBFACI And
ICWHLO = IBWHLO And ICPUNO = IBPUNO And ICPNLI = IBPNLI And
ICPNLS = IBPNLS INNER Join
mvxbdtaCF3.XANLIN On ICPUNO = XBPUNO And ICPNLI = XBPNLI And
ICPNLS = XBPNLS And IBCONO = XBCONO And IBFACI = XBFACI INNER JOIN MVXBDTACF3.MITBAL ON ibitno = mbitno and ibcono = mbcono and ibwhlo = mbwhlo
WHERE (IBCONO = 200) And (IBFACI = '010') And (IBWHLO = '010') And (XBXSMT = '91730') AND
IBITNO = '8552-6654' AND (ICREPN > 0) And (IBPUSL >= '50' And IBPUSL < '75')



RESULTS:







ICPNLX
IBPUSL
IBPUST
IBSUNO
XBXSMT
ICPUNO
IBITNO
ICPNLI
ICPNLS
ICREPN
REMAIN
MBWHSL

2
50
70
GRCUSA
91730
T05091
8552-6654
10
1
16978004
4
G-25-1

3
50
70
GRCUSA
91730
T05091
8552-6654
10
1
16978004
4
G-25-1

4
50
70
GRCUSA
91730
T05091
8552-6654
10
1
16978004
4
G-25-1

2
50
50
GRCUSA
91730
T50296
8552-6654
30
0
16978008
9
G-25-1

2
50
50
GRCUSA
91730
T50296
8552-6654
50
1
16978009
23
G-25-1



many many thanks guys.

Scotty

View 5 Replies View Related

Help Needed Creating Select Statement

Mar 20, 2007

Hi,I have a need to create a table detailing the ID of all contacts and thelast time they were contacted. This information is stored in 2 tables,'contact' and 'activity' (ID in the 'contact' table links to 'main_contact'in the 'activity' table).I guess I need some sort if iteration to go through each contact and findfind the last activity that took place against each of them (there many bemore than 1 activity against each contact) and then place the output valuesinto the new table.Can anyone show me how to go about this?Thanks!

View 2 Replies View Related

Help Needed With Select Statement Using Calculation

May 2, 2008

Hi,

Any help with this would be great. I have SQL tables all in the following format:

ID_PRODUCT,
ID_MARKET,
ID_BUCKET,
ID_COLLECTION,
ID_MEASURE,
MEASURE_VALUE

Now each table holds different measures e.g. 326, 229 & 278. I would like to subtract the measure_value of 229 from 278 and then add the measure_value from 278 from this. e.g

(326-229) + 278 = new measure_value.

This is for each id-product where the following 3 conditions meet:

the ID_PRODUCT, ID_MARKET AND ID_BUCKET match. Im lost, any help would be great.

thanks

Jay

p.s this what i have started with at the moment as a test however it dont work.

SELECT ID_PRODUCT,
ID_MARKET,
ID_BUCKET,
ID_COLLECTION,
ID_MEASURE,
MEASURE_VALUE
FROM (SELECT TOP 100 PERCENT dbo.DPOUT_EXCEPTIONS_326.ID_PRODUCT,
dbo.DPOUT_EXCEPTIONS_326.ID_MARKET,
dbo.DPOUT_EXCEPTIONS_326.ID_BUCKET,
dbo.DPOUT_EXCEPTIONS_326.ID_COLLECTION,
dbo.DPOUT_EXCEPTIONS_326.ID_MEASURE,
dbo.DPOUT_EXCEPTIONS_326.MEASURE_VALUE + DBO.DPOUT_LSBP_229.MEASURE_VALUE as 'MEASURE_VALUE'
FROM dbo.DPOUT_EXCEPTIONS_326 INNER JOIN dbo.dpout_lsbp_229 on
dbo.dpout_exceptions_326.id_product = dbo.dpout_lsbp_229.id_product
where dbo.DPOUT_EXCEPTIONS_326.ID_PRODUCT = dbo.dpout_lsbp_229.id_product
and dbo.DPOUT_EXCEPTIONS_326.ID_MARKET = DBO.DPOUT_LSBP_229.ID_MARKET
and dbo.DPOUT_EXCEPTIONS_326.ID_BUCKET = DBO.DPOUT_LSBP_229.ID_BUCKET)

View 3 Replies View Related

Simple Select

Oct 12, 2005

I am trying to select a particular record from a table and for some reason it only returns 1 record when I know there are at least 6. I've tried Rtrim and left to make sure that I'm getting the exact string. The "MyID" field is varchar(32) and the "ExpireDate field is datetime and I have tried the below. Any ideas what could be wrong?

Select DISTINCT K.MyID, KP.[EXPIREDATE] --, K.ACTIVATIONKEY
From [KEY] K INNER JOIN KEY_PRODUCT KP
ON K.MyKey = KP.MyKey
Where K.MyID = '013BEB73C2CF11D39F3600105A05264C'

View 2 Replies View Related

Simple Select From Csv

Jan 28, 2008

I have a simple select statement that I am having a complex with. I am a C# developer trying to expand and gain a little more knowledge of SQL. I want to send a string to a SQLCommand catagory = 'news,alerts,events' and return a result set if it matches any term.

This is for a blog I am creating for a church and the catagory is like the tags you normally see. I could use something like:

SELECT GUID,CATAGORY,DESCRIPTION,TITLE,ETC
FROM RSS_FEEDS
WHERE CATAGORY LIKE 'news,alerts,events'

I can seperate the keywords with any character if needed.

WHERE (ITEM_CATEGORY LIKE '%news,events%')

This only returns ones that have all like what is there not the ones having news only

Is there a way or trick to this.

Thanks

View 2 Replies View Related

Simple Select

Dec 7, 2006

Hi all,

for some reason (stupidity maybe) I can't solve this problem...

I have a table with this information:

ID SerialNumber Result

1 123 Pass

2 125 Fail

3 234 Pass

I just want a select that shows how many pass and fail...

Like this:

Pass | Fail

2 | 1



Thank you

View 4 Replies View Related

DB Slow On Server But Fast On Desktop

Apr 2, 2008

I'm trying to figure out how to determine why the same database is fast on my desktop but slow on a robust multiprocessor win2003 server.

I have a complex proc that takes about 27 seconds on my desktop sql server but takes almost 5 minutes on the server. The server processors are running at about 1% utilization while the proc is running.

Any ideas on how to troubleshoot this extremely poor performance?

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved