RDA.Pull And INNER JOINS...

May 24, 2006

When calling the method below, if I use the SQL in red, the Pull method populates my data correctly. But, If I use the sql in Green, I get an errror message. I have set breakpoints and un the SQL that is returned from the sql statement is green, and it returns records. What gives? Are Joins not allowed?

public void GetDiagnosisList()
{
// Connection string to SQL Server 2000
string rdaOleDbConnectString = "Provider=sqloledb; Data Source=WORKPC;Initial" +
" Catalog=database;User Id=username;Password=password";
// string SQLGet = "SELECT tblLUDiagnosis.strDiagnosisCode, tblLUDiagnosis.strDiagnosisDesc FROM tblLUDiagnosis" +// " INNER JOIN tblPatientEpisode ON tblLUDiagnosis.strDiagnosisCode = tblPatientEpisode.strPrimaryDiagnosis" +// " WHERE tblPatientEpisode.intHospitalID =" + intHospitalID;
string SQLGet = "SELECT TOP 15 tblLUDiagnosis.strDiagnosisCode, tblLUDiagnosis.strDiagnosisDesc FROM tblLUDiagnosis";

SqlCeRemoteDataAccess rda = new SqlCeRemoteDataAccess();
try
{
rda.InternetUrl = "http://WORKPC/SQLCE/sscesa20.dll";
rda.LocalConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;" + CONN_STRING;
rda.Pull("tblLUDiagnosis",SQLGet,rdaOleDbConnectString, RdaTrackOption.TrackingOnWithIndexes, "ErrorTable");
MessageBox.Show("Diagnosis Synchronized");
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}

View 1 Replies


ADVERTISEMENT

Transact SQL :: Pull Records From 3 Tables Using Joins Or Subquery?

Sep 14, 2015

I have 3 tables.

Table 1:
ID  Name  Description
1  ABc      xyz
2  ABC      XYZ

Table 2:
RoleID   Role
1         Admin
2         QA

Table 3:
ID   RoleID  Time
1     1         09:14
2     1         09:15
1     2         09:16

Now I want all the records which belongs to RoleID 1 but if same ID is belongs to RoleID 2 than i don't want that ID.From above tables ID 1 belongs to RoleID 1 and 2 so i don't want ID 1.

View 4 Replies View Related

RDA Pull Problem: Command=PULL Hr=80040E4D Login Failed For User 'test'

Apr 25, 2007

Hi all,

I have following problem:

I'm developing a Windows Mobile application, which is using RDA Pull for retrieving data from SQL Server 2005 database to PDA. Please, see the example:






Code Snippet

using (SqlCeEngine engine = new SqlCeEngine(connStr))

{

engine.CreateDatabase();

}

serverConnStr="Provider=SQLOLEDB;Data Source=.;User ID=sa;Initial Catalog=Demo;Password=xxx";

using (SqlCeRemoteDataAccess rda = new SqlCeRemoteDataAccess(

Configuration.Default.SyncServerAddress, "", "", connStr))

{

rda.Pull("MyTable", "SELECT * FROM mytable", serverConnStr, RdaTrackOption.TrackingOffWithIndexes, "ErrorTable");

}





Everythink works fine, when I use 'sa' user account in serverConnStr.

But, when I change conn string to:

"Provider=SQLOLEDB;Data Source=.;User ID=test;Initial Catalog=Demo;Password=test"

the sqlcesa30.dll cannot connect to SQL Server database.

In the sqlcesa30.log then I found following line:




Code Snippet

2007/04/17 10:43:31 Thread=1EE30 RSCB=16 Command=PULL Hr=80040E4D Login failed for user 'test'. 18456



The user 'test' is member of db_owner, db_datareader and public roles for the Demo database and in SQL Server Management Studio I'm able to login to the Demo database with using the 'test' users credentials and I'm able to run the select command on 'mytable'.



So, what's wrong? Why the sqlcesa30.dll process cannot login to the Demo database, and from another application with using the SAME connection string it works?



Please help.



Thank you.

Fipil.



View 10 Replies View Related

Joins On Views That Are Formed With Outer Joins

Nov 3, 2000

We find that a delete command on a table where the rows to be deleted involve an inner join between the table and a view formed with an outer join sometimes works, sometimes gives error 625.

If the delete is recoded to use the join key word instead of the = sign
then it alway gives error 4425.


625 21 0 Could not retrieve row from logical page %S_PGID by RID because the entry in the offset table (%d) for that RID (%d) is less than or equal to 0. 1033
4425 16 0 Cannot specify outer join operators in a query containing joined tables. View '%.*ls' contains outer join operators.
The delete with a correleted sub query instead of a join works.

Error 4425 text would imply that joins with view formed by outer joins should be avoided.

Any ideas on the principles involved here.

View 1 Replies View Related

JOINS To Sub-Queries -vs- JOINS To Tables

Aug 11, 2005

SQL Server 2000Howdy All.Is it going to be faster to join several tables together and thenselect what I need from the set or is it more efficient to select onlythose columns I need in each of the tables and then join them together?The joins are all Integer primary keys and the tables are all about thesame.I need the fastest most efficient method to extract the data as thisquery is one of the most used in the system.Thanks,Craig

View 3 Replies View Related

Ansi Joins Vs. SQL Joins

Oct 12, 1999

Hi,

Why is it that SQL joins (*=) run a little faster as opposed to ANSI joins(LEFT JOIN...)? Aren't they supposed to be almost identical?

The issue is this: we are promoting using ANSI syntax for the obvious reason (future versions of SQL Server may not support SQL Server syntax; portability, etc.)

However, the problem is the speed. What have others done about this? Do you use ANSI syntax or SQL syntax? HOw true is it that future SQL Server versions may discontinue support for the '*=" and "=*' join operators.

Angel

View 1 Replies View Related

UNION ALL, Joins And No Joins

Feb 29, 2008

I have four tables which I want to return results for an advanced search function, the tables contain different data, but can be quite easily joined,

Table A Contains a Main Image, this image is displayed in the results
Table B Contains an Icon, this image is displayed in the results
Table C doesn't have an image in it but has a child table with a number of images associated to the table, in the UNION ALL statement I would Like to do a Join to get say the top Image from this child and print it for the row associated with table C.

Select title, description, image from tableA
UNION ALL
Select title, description, icon as image from tableB
UNION ALL
title, description, ( inner Join SELECT top(1)
from imageTableC where imagetableC.FK = tableC.PK)
as image from tableC


Could someone show me the syntax to do this, I have all the information printing to the screen, bar this table C image.

View 14 Replies View Related

Multiple Left Joins (2 Left Joins 1 Big Headache)

Sep 1, 2005

Hi All,

Im having a problem with a statement i cannot seem to get 2 left joins working at the same time 1 works fine but when i try the second join i get this error:-

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'children_tutorial.school_id=schools.idx LEFT JOIN regions ON children_tutorial.region_id=region.idx'.


My SQL statment is as follows :-
SELECT children_tutorial.*,schools.schoolname,regions.rname FROM children_tutorial LEFT JOIN schools ON children_tutorial.school_id=schools.idx LEFT JOIN regions ON children_tutorial.region_id=region.idx

I am using an Access database i have tried all sorts to get it working and its driving me mad!! any help would be really appreciated.

View 2 Replies View Related

Pull Pdf Out Of Db

Aug 7, 2006

   All,I did it in ASP 1.0 with the datareader but in 2.0 the data reader appears to be gone, so how do i retrive a pdf out of the sql db and show it in a blank web page, tiajtr

View 4 Replies View Related

How Can I Pull This One With WHERE IN

Feb 16, 2007

Hello everyone,
For the sake of simplicity let's imagin we have two tables simple tables: Categories(Id, Name) and Products(Id, CategoryId, Name). My question is how can I make a product list, filtered by category, using a Stored Producedure (SP). My objective is to have the SP receiving the list of categories we want to display, as an input parameter, using it in the SQL Statement. Something like:
Procedure:ListProductsFilteredByCategory@Categories AS NVarCharSELECT   [C.Name] AS CategoryName  ,[P.Name] AS ProductNameFROM Products PJOIN Categories C ON C.Id = P.CategoryIdWHERE IN (@Categories);
How could I make this SP work in a way that @Categories can contain an undefined number of category IDs?
Best regards,DBA

View 4 Replies View Related

How To Pull A Last Row

Oct 20, 2004

Hi,
I am trying to write a stored proc which returns a value to me. with the parameters I'm supplying to the stored proc, it results in a set of rows and what I need is to get the a filed value of the last selected row of this query. Do I need to write two queries for this? It is something opposite to the TOP keyword functionality. I need the one of the field values in the last row. Cud anyone help me with this??

View 3 Replies View Related

Pull Or Push For Me?

Jul 22, 2001

I'm trying to replicate two very big databases with about 10 million
of 4000 characters each. The publisher is SQL 2000, subscriber
is SQL 7.0

The subscriber will also perform full text searches.

I'm trying to decide wheter I should use PULL or PUSH.
The publisher is operating on a very low quality/speed internet
connection, where the subscriber is enjoying a T1.

Help, anyone?

Thanks,

-Michael.

View 1 Replies View Related

Replication HELP With PULL

Jan 25, 2002

I seem to be missing something.
I'm trying to pull a subscription from SQL Server 2000.
(To a desktop SQL 2000 install <msde i guess>)
The general error I keep running into is
When creating the subscription...

"Error 15004: Name cannot be NULL"

I cannot figure out where this problem originates.
I'm running the SQL Service account and Executive under a domain account.
(same one on both machines)

Does anyone know where I'm missing the Permissions for the subscription?

Please impart any Replication suggestions you have. Don't hold back....

Thanks in Advance,
Dano

View 3 Replies View Related

Pull Subscription

Sep 27, 2006

My name is Tech guy,

I want to use window script program to execute a pull subscription installed on SQL 2005 express edition. Because it free for downloand.
is there a script that can call an existing pull subscription execution.

View 6 Replies View Related

Want To Pull Last Three Entries From DB

May 14, 2004

I am trying to pull the last three entries from a table in my database but I am having trouble writing the correct query. The database has multiple entries for each item in my database but I want to pull just the last three for each item. I have tried the TOP function with the items ordered in descending order but that only works when I define each item seperatley. I need to know how to pull the last three entries for every item I have in the table.

Thanks,

Tim

View 3 Replies View Related

Push /pull

Jun 21, 2008

Hi to all.

How can we identify that a transactional replication is configured in pull or push subscription..
where we have to check it out.

View 2 Replies View Related

Pull Datetime On Same Day?

Sep 4, 2014

How can i pull data by datetime on same day? can't manually put the datetime as i would like to schedule it

daily 2014-09-05 00:00:00.000 to 2014-09-05 03:59:59.999

select ... from ..
where goingOffdatetime >= GETDATE()
and goingOffdatetime <= ...

View 4 Replies View Related

Pull Subscription

Sep 14, 2006

Are there any procedural differences between Express and MSDE considering pull subscription?

Thanks

abdul

View 2 Replies View Related

Insert After Rda Pull

Oct 20, 2006

Hello, in my scenerio i am pulling a table from msde to my ppc and then i want to insert a new record to my local table but when i try to do that i faced with an index paradox forexample:
if i pulled a table with record index 1 then i am triying to insert a new record at local but at local it tries to insert index 1 again so i can't finish my operation. My primariy index is seed 1 also. How can i achieve my goal?

View 1 Replies View Related

RDA Pull Problem

Dec 21, 2005

Hi,

I am new to SQL Mobile programming. I am using SQL Server 2005 Mobile and SQL Express. I have a mobile windows application + .sdf file in the PDA. When i try to pull the table the first time, the table is successfully retrieved to PDA. When i try to pull the table again, i get the following error:

"An unexpected error has occured in TestDb.exe. Select quit and then restart this program, or sleect details for more information.

A duplicate value cannot be inserted into aunique index. [table Name=_sysRDASubscriptions, constraint name=c_LocalTableName] "

The above message indicates, that the table is existing in "_sysRDASubscriptions" table.

I tried dropping the table using SQL Explorer  in PDA, but it didn't work out.

I am not sure of how to drop the existing table from the database programatically, and if I drop the table from the database, will this be cleared.

Please help me in resolving this issue. I am in desperate need of an urgent solution for this.

 

Thanks

Prasanna

View 6 Replies View Related

RDA Pull Exception

Mar 12, 2006

Dear All,

I created a sample test application to implement RDA, after I made all required configuration, I got the following exception after call rda.pull() :

{
Error # 1 of 1
Error Code: -2147024809
Message : An error has occurred on the computer running IIS. Try restarting the IIS server.
Minor sqlError.: 28022
Source : Microsoft SQL Server 2005 Mobile Edition}



Note: rda.submitQuery is executed successfully ..

any ideas

Thanks and regards

View 1 Replies View Related

Rda.pull Exception

Mar 19, 2007

Hi,

I have followed the technical artical "Remote Data Access Synchronization with SQL Server 2005 Compact Edition and Visual Basic.NET" to create a sample application.

 

But when I run debug mode and get an exception unexpected as following as doing rad.pull :

Immediate Window:

A first chance exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in System.Data.SqlServerCe.dll

Message Box

[Contacts]

Code:

Private Sub RADPullButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RADPullButton.Click

        Try
            VerifyDatabaseExists()
            Dim rda As SqlCeRemoteDataAccess
            rda = GetRDAObject()
            rda.Pull("Contacts", _
            "SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax FROM Customers", _
            My.Settings.ServerOleDBNorthwindConnectionString, _
            RdaTrackOption.TrackingOnWithIndexes, _
            "Contacts_Errors")

        Catch ex As Exception
            MessageBox.Show(ex.ToString())
        Finally
            Windows.Forms.Cursor.Current = Cursors.Default
        End Try

    End Sub

 Thanks in advance,

JD

 

View 6 Replies View Related

Cannot Pull Table With RDA

Aug 27, 2007

Dears,
I'm trying to set up a rda connection through the pocket pc emulator (standalone version 1.0) and my laptop which runs Windows Vista Home Premium. To start up the rda I first need to connect from my emulated device to my laptop which runs IIS 7.0 (complete installation with compatibility toward IIE 6.0). Connection to http://localhost from my laptop is working fine.

I start the emulator (Pocket Pc with Windows Professional) and cradle the emulated device.
Connection starts and I'm able to browse from my pc the content of the emulated device or to synchronize it.
Then I run Internet Explorer on the emulator and try to connect to http://mycomputername (correct) but I receive a message which says that it cannot connect to the page I was looking for because connection was lost.
Any suggestion on how to solve this issue?
Kind regards and many thanks in advance
Cristian


It seems that now I can connect to http://mycomputername and I'm able to browse the net with my pocket pc emulator.
Anyway when I'm attempting to connect to htpp://mycomputername/subfolder/sqlcesa30.dll (the path is correct, I receive the following error message: "The page cannot be displayed or downloaded because the connection was lost. Check the connection and try later"..which is the same message I've been receiving before)

What shall I do?

View 16 Replies View Related

Pull Subscription

Aug 13, 2006

Hello,

i have one publisher with one pull subscription. when i make any change in publisher, that change is propegated to subscriber, but when i make any change in subscription, the change is not reflected. i have tried a lot of options but no one worked. please help me.

Regards,

View 9 Replies View Related

Cannot Get RDA.Pull To Work

Jul 28, 2006

[SQL Everywhere CTP],[VS2005]

RDA.Pull method is not doing anything for me from a VSTO 2005 Outlook addin project. I have IIS & SQL Server 2005 running on my develpoment pc. I am using Integrated Windows Auth for vdir. It just stops execution at the line of code that calls RDA.Pull & doesnt return any tables nor throws an error. I have no idea where I am going wrong. I have tried using table names that dont exist in the .sdf too.

SqlCeRemoteDataAccess rda = new SqlCeRemoteDataAccess();

rda.InternetUrl = @"http://localhost/WsRDA/sqlcesa30.dll";

rda.LocalConnectionString = @"Data Source=D:\_fullPahtHereDBEverywhere.sdf;Password=sdfPwdHere";

rda.InternetLogin = "myLocalUserName";
rda.InternetPassword = "myLocalPassword";

rda.Pull("Class2", "select * from dbo.Class", @"Data Source=MyDesktopSQL2K5;Initial Catalog=ServerDB;Integrated Security=SSPI");


Without an error msg, I dont know what the problem is. Any ideas?

View 1 Replies View Related

How To Pull From Two Date Ranges

Dec 17, 2006

Can someone please help me with this?
I need a query that will pull clients that made payments last year but not this year.
 I need the query to use date parameters so I can select any date range for the past year and the current year.
I have listed the tables and fields that might be needed: I'm hoping to do this without temp tables.
Date range is based on the tblPaymentReceipts.PaymentDate
tblClients, ClientID
tblPayment, PmtID, ClientID, Paystartdate, Paygroup
tblPaymentReceipts, PmtRcptID, PmtID,CleintID,PaymentDate,PaymentAmount

View 6 Replies View Related

Pull Data For Each Day Of A Given Month

May 6, 2008

Hi,
Writing a report that displays total hours, etc for each day in a given month and I'm having trouble comking up w/ an elegant solution. Tables are set up like this:
table1 (id, start_date,end_date,submitter)
table2( id,table1_id,start_time,end_time, etc)
Each record in table2 is a child to a parent record in table1 and there may be multiple children for each parent. The "start_time" and "end_time" fields are datatype "datetime" and are stored with actual times (not 12:00:00 AM"). I need the report to display the values for each day in a gridview, etc so I can act upon them from the "RowDataBound" sub (more math, etc). The problem that I am running into is that for records that have multiple children for a given day, I need to sum those results and display the summed data as a single row within the GV - can't seem to work that out - I keep getting every child record displaying as its own row in the GV.
Any thoughts? I'm sure it's probably fairly simple but I am still a beginner...thanks as always

View 8 Replies View Related

Pull From Two Tables, But Include Everyone

Mar 16, 2004

I want to pull ALL users from Table1 and include information that person may have in Table2. As of now, it is only including users that have something in Table2. How do I include everyone?
Thanks

View 1 Replies View Related

Pull Replication Urgent

Jul 23, 2001

hi,
I want to setup transactional replication(PULL) between 2 servers .
can anyone guide me with the steps involved while performaing a Pull replication from server1 to server2.
Any help appreciated.

View 2 Replies View Related

Pull Subscription Error

Sep 20, 2000

When doing a pull subscription where the schema is also replicated, the snapshot fails with the message " The process could not create the file
[machine name]D$MSSQL7ReplDataunc[Publisher Name]DateTable Name.sch

There is an OS Error Code of 5 saying Acces is denied.

The file mentioned above is created, so perhaps it fails trying to create a file for the next table.

Thanks for any light that you can shed!

Bill

View 2 Replies View Related

Pull In Partial String

Dec 13, 2007

Could someone please help me? I am trying to pull in a partial string (the last six characters of the field, to be exact).

This is an example of my code:

select *
into #temp_2
from #temp_1 a, Server2.DBa.dbo.table2 r
where r.field1r = a.field1a and
r.field3r = a.field3a (field3a is where I need just the last 6 characters)

To be more specific:
r.field3r looks like 000884
a.field3a looks like 17445000884
So- I just want to pull in the 000884 off of a.field3a

View 2 Replies View Related

Pull Subscription Initialisation

Sep 14, 2006

Hi there all

I have a problem creating a pull merge subscription on a server that's outside of our firewall. All standard ports are blocked so MS UNC connections are not possible which SQL 2000 uses by default when creating a subscription. Equally FTP is out = insecure.

I found a procedure to that said create the snapshot of the publication, create a backup of the published database, restore that backup to the remote server as a subscription db and then sync using merge. Didn't work, failed (several times).

Can anyone enlighten me as to what I'm doing wrong or indeed if I'm doing anything correctly!

I can create a remote desktop (Term Server) connection to the remote and another back to the publisher (from the subscriber's desktop) and both connections are using SSH tunnels. SQL Server uses a non standard port to communicate over the firewall. The remote server sits behind another firewall/router with port redirection to it's private address. Each server has the other registered and there are no comms problems and indeed there are other replicated dbs between them.

Both servers are win 2003 and the remote (subscriber) is R2 version, both with SQL 2000 Server Std patched up to SP3. (if this has any bearing on the solution which I presume there is)

Many thanks for listening and I hope a few of you can answer as well

Craig

View 4 Replies View Related

Pull Down From One Table And Push Up Into Another....

Jun 1, 2004

Hi All,

I have a problem,

I need to copy a large amount of data from one table and insert it into another table.

The design of the destination table is exactly the same as the source table except for the fact that it has one extra field.
Can I copy; in a single SQL statement; all rows in one table (that match given criteria) into another table allowing for the extra field?

View 4 Replies View Related







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