Creating A Matching Program

Jul 20, 2005

Hi,

I'm just looking for some general advice on how to approach something.

I have two tables A and B, containg common fields of product, sales
date and qtyo.
Some records contain the same data and I want to dump them in a new
table called C and leave Tables A and B containg only data that
doesn'r match.

How do i go about approaching this??

Regards,
Ciarán

View 2 Replies


ADVERTISEMENT

Creating A Program That Uses A Database.

Mar 19, 2008

I am currently writing a program that will use a SQL database. I am use to writing programs that are used to connect over some type of a network, but for this project I need to be able to load the Database and it's tables to the system locally. If anyone has a suggestion it will be greatly appreciated, or any sites for documentation on it. Thank you.

View 6 Replies View Related

Do Sqlexception Breaks The Functionality Of The Program? (program Flow)

May 23, 2007

why we use sql exceptions ...

what the program will do if we caught that exception .. i need some suggestions ... i got this exception(String or binary data would be truncated.
The statement has been terminated.).. will it affect the functionality of the program...

hiow can i avoid this exception..

View 1 Replies View Related

Returning Matching/Non Matching Records

Feb 4, 2007

Hi All

I have a strange request that might not be possible based on the laws of relational databases but I thought I'd give it a try.

I have three tables which for simplicity I will call A, B and C. Table A contains my master records, Table B contains user details and the final table contains some extra data

In my initial search when joining A and B, I return 100 records. I then need to search in table C for these 100 records based on a criteria. the expected result should return all 100 rows for the ones that match and also the ones that do not match. The problem is that in Table C, not all the 100 IDs exist, so there will not be a corresponding record. Unfortunately, our users still want to see all 100 records in the output. Is this possible

As always any help or direction would be appreciated.

View 5 Replies View Related

Can I Return A Value In A Variable From A SSIS Program Back To C# After The SSIS Program Is Run From C#?

May 21, 2007

Can I return a value in a variable from a SSIS program back to C# after the SSIS program is run from C#?

View 1 Replies View Related

Help In Program

Aug 29, 2001

i have a program which should give the out like this
XAPIALTMKT20010829105525.TXT

but its giving the output = 'X'
which is just the first initial...how
can i get this...

if i don't write the @filename=....
only then its giving the output..but i want to store it in the
varable..how can i do that
================================
declare
@v datetime ,
@filename varchar

select @v=getdate()
select @filename='XAPIALTMKT'
+CONVERT(varchar, @v, 112)
+SUBSTRING(CONVERT(varchar, @v, 108), 1, 2)
+SUBSTRING(CONVERT(varchar, @v, 108), 4, 2)
+SUBSTRING(CONVERT(varchar, @v, 108), 7, 2)
+'.TXT'

print @filename
================================================

thanks,
Harish

View 2 Replies View Related

Get With The Program

Jul 23, 2005

It is very interesting to me that most people in this group can't do simpleSQL. Are you viewing MySQL as a simple file system?As long as you do that,you willnot understand SQL in any dialect. So from now on:When you have a question about SQL. post the table structures. Uh, "WithCreate".Post some sample data in the form of INSERTS.Regards,Rich--The journey is the reward.

View 2 Replies View Related

SQL Program Question

May 22, 2006

Hello, i installed :

SQL Server 2005 Express Edition with Advanced Services
Install Microsoft SQL Server 2005 Express Edition with Advanced Services

but I do not see any program in my program menu to open it. Is this a stand alone program I can open? Thanks

View 2 Replies View Related

Mailsend Program

Oct 10, 2007

Hi All,

I am trying to send an email from a cmd prompt from SQL Server 2005 server using mailsend program. I am getting the message "Could not send mail". I am really stumped, don't know how to fix it. Any suggesstions?

Thanks.

View 3 Replies View Related

Mailsend Program

Oct 9, 2007

Hi All,

I have installed SQL Server 2005 and created a job. I made the job failed to test the mailsend program. The notification step that uses the mailsend succeeded but I did not get an email. I am using mailsend program on SQL Server 2000 and it works fine. I am really stomped and don't know what to do to fix it?

Thanks.

View 9 Replies View Related

Is It This Job Can Program In Trigger?

May 14, 2008

I've have following table,

tblHIT - this table will reveive record every minutes
Date | Time | Main_ID | Hit
------------------------------------
3/1/2006 | 100 | 200 | 8700
...
...
...
4/14/2008 | 100 | 200 | 4500
4/14/2008 | 100 | 201 | 8700
4/14/2008 | 200 | 200 | 3500
4/14/2008 | 300 | 201 | 7700
...
...

I've also 1 job in SQL Server Agent will execute STORED PROCEDURE and will filter 7 days record before from current date and insert it into tblHIT_7days. tblHIT_7days shown as follow
tblHIT_7days
Date | Time | Main_ID | Hit
------------------------------------
3/7/2008 | 100 | 200 | 8700
...
...
...
4/13/2008 | 100 | 200 | 4500
4/13/2008 | 100 | 201 | 8700
4/13/2008 | 200 | 200 | 3500
4/13/2008 | 300 | 201 | 7700

I've plan to create TRIGGER. This TRIGGER will insert the appropriate record from tblHIT into tblHIT_7days and also delete a appropriate record in tblHIT_7days. This INSERT and DELETE transaction depend on current date.

Is it possible, TRIGGER can do this?

View 6 Replies View Related

Triggers - C# Program

Oct 12, 2007

Hi,

In SQL Server is it possible to have a trigger that will throw an event which could be caught by C# program running in the back ground?

Is this even possible? If it is, have u any links to help/examples?

Regards!

View 4 Replies View Related

Using Sql Server In DB Program

Oct 26, 2006

I am about to build a program that will require the use of DB. In the pass I used Access as my back end, but this time I would like to use Sql Server. I just have a few questions before I begin.

1. After deploying and installing my program, do I need to have sql server installed on users system or can the DB file exist on its own and just use ADO.NET to access the file? (As I done in the pass to access my Access mdb file)

2. If I can deploy a sql file -- can it be done with Sql Server Express?

3. If it can't be done, what db program should I use?

View 3 Replies View Related

Program Locking Up While Using Rda

Apr 15, 2008

On some occasions when trying to send data back to the server, the program will lock up for up to 30 minutes. The code below is the rda data transfer process and the function IsConnected() determines whether there is a connection.

If Not MainFrm.IsConnected Then
rda.ConnectionManager = True
End If
If MainFrm.IsConnected Then
Dim sCon As String = "Provider=SQLOLEDB;Data Source=175.21.21.121;Initial
Catalog=OurDb;User ID=UserId;Password=pwd"
rda.InternetUrl = "http://Ourwebsite.co.uk/tfr/sqlcesa30.dll"
rda.LocalConnectionString = "Data Source=Program FilesSysdata.sdf"
For i As Integer = 0 To RecCount - 1
Try
rda.SubmitSql(UpdateRec(i, 0), sCon)
Catch Ex As SqlCeException
ErrTxt = Ex.ToString
End Try
Next


Public Shared Function IsConnected() As Boolean
Dim request As HttpWebRequest
Dim response As HttpWebResponse
Try
request = CType(WebRequest.Create("http://www.intel.com/"), HttpWebRequest)
response = CType(request.GetResponse(), HttpWebResponse)
If response.StatusCode = HttpStatusCode.OK Then
response.Close()
Return True
Else
response.Close()
Return False
End If
Catch Ex As WebException
Return False
End Try
End Function

There are rda properties which determine a timeout. How can I use these to stop my program from locking up if the signal is weak?

View 1 Replies View Related

SQL Query For Matching

Jul 26, 2007

Okay I've posted something like this in another area but it doesn't seem to be focused towards the right people.  I need ya'll SQL experts!
 I have a database table that has 5 columns:  Time  Status  Message  Source  IP
The Status column has only two choices "up" or "down"
 I'm looking for some kind of advanced query that will do the following:
 I need the query in my application to pull the table and then match up IP, Status, and Message columns.  It should only find One match and then once it has found a match it needs to recognize that one is an "up" status and one is a "down" status and then remove them from the database.
 Does that make sense?  Is it impossible?

View 1 Replies View Related

Most Matching Records

Oct 5, 2007

Hi,
This is a where clause I am using in a search.
 WHERE (ADDRESS_STREET LIKE '%' + @Search + '%' )
I am trying to do a search which returns the most matching record. For example if I have a record with Denver  as text . If I search for Denvr the spell error is intended , I will not get the result. How can I create a stored procedure to counter probable spelling errors and return  matching results in a ranked order.
Thanks

View 2 Replies View Related

Matching On From A List

Jan 15, 2004

HI,

say I have a list from an sql statement (results list)
this list contains 10 items

In another table, in one particular column - there is a match for one of these items from the initial list.

SO... this may be the list
_____________________
itemnumber
1
2
3
4
5
6
7
8
9
10
------------------------------

in the other table there is a match...
but just for one item on that list.
____________________
othertablefield
11
13
14
3 <------ match
99
78
----------------------------

How do I find that match with my sql statement?

View 1 Replies View Related

Csv Matching Problem

Aug 2, 2005

Dear all,
I have two table, both table have a col which stored the data in CSV format, ie "ab , bc, de", etc
I would like to select the item where "any one item" in first table is same as "any one item" on second table.
I have alread have the private CSV function which can convert the string and return as table. However, I find i cannot do it like this   select ..... where dbo.CSVfunction(tableA.colA)
Thx//CSV functiondeclare @separator char(1) set @separator = ','
 declare @separator_position int  declare @array_value varchar(1000)   set @array = @array + ','  while patindex('%,%' , @array) <> 0  begin    select @separator_position =  patindex('%,%' , @array)   select @array_value = left(@array, @separator_position - 1)   select @array_value = RTrim(@array_value)   select @array_value = LTrim(@array_value)   Insert @StringTable  Values (Cast(@array_value as varchar(50)))
   select @array = stuff(@array, 1, @separator_position, '') endre @separator char(1) set @separator = ','
 declare @separator_position int  declare @array_value varchar(1000)   set @array = @array + ','  while patindex('%,%' , @array) <> 0  begin    select @separator_position =  patindex('%,%' , @array)   select @array_value = left(@array, @separator_position - 1)   select @array_value = RTrim(@array_value)   select @array_value = LTrim(@array_value)   Insert @StringTable  Values (Cast(@array_value as varchar(50)))
   select @array = stuff(@array, 1, @separator_position, '') end

View 1 Replies View Related

Matching Names

Sep 3, 2003

My company is going to start a Cancel web site so customers can cancel their future orders by simply filling out a form. I was wondering what would be the best way to compare the cancel db to db that is used to store customer information and order information.

The cancel website will only hold the name, address, and Credit Card Number used. There will not be a customer/order number. The simple Credit Card to Credit Card search will be easy but I was more worried about comparing the rest of the information in case the Credit Card search fail. I was told the "standard" look up was to take the first 3 letters of the first name and the last 3 letters of the last name. If that comes up with more then one record, take that set and see if the zip code matches up and/or part of the street address matches up (counting we do not have very reliable people inputting the information into the system is not going to help this search).

Anyway, any suggestions on comparing the data would be great.

Thanks ahead of time

View 4 Replies View Related

Matching Columns

Sep 7, 2004

All

I have a table which contains 4 columns each of which are NULL or contain a 6 digit code.
Here is a sample of the table content:

COL1 COL2 COL3 COL4
----- ----- ----- -----
452359 NULL NULL 347406
NULL NULL 347406 347406
592319 NULL 347406 347406
592319 150009 347406 347406
592319 150010 347406 347406

Through out the table any number of the columns can be null.

I wish to remove rows from this table where the columns values are contained in another row i.e Row 2 above is contained within row 3. Similarly, row 3 is contained within row 4.
So, the only rows I want from the sample data above are rows 1, 4 and 5.

I hope I have explained my query adequately, and any help would be great appreciated. (Before I go mad...!)

Regards,
Katherine

View 6 Replies View Related

SQL Pattern Matching

Mar 20, 2008

Hi everyone. I'm developing a web search engine using asp and SQL Server 2000. I need to return records that matches with a string entered by users. In example, suppose my database to have this structure and it's filled like this:

ID NAME KEYWORDS
--- ------- -----------
AA025 NAME1 attached, atic, common, business, hotels
AA026 NAME2 headache, medicin, aspirins, heat, health
AA027 NAME3 at, services, music, electronics

suppose that user enters 'at'. By now, i'm using this pattern '%<input_text>%'. So in this example, pattern would be '%at%'. As i remarked in the fields above, the three fields matches, and that's not what i'm looking for. I want that the result of that query be just the last field, with 'AA027' ID.
Thanks in advance guys.
Cheers.

View 14 Replies View Related

Sys.sql_dependencies Does Not Have A Matching Row

May 22, 2007

I'm getting the following error when running dbcc checkdb and no clue as to what to do.

Msg 8992, Level 16, State 1, Line 1
Check Catalog Msg 3853, State 1: Attribute (referenced_major_id=1328111872,referenced_minor_id=5) of row (class=0,object_id=1795589535,column_id=0,referenced_major_id=1328111872,referenced_minor_id=5) in sys.sql_dependencies does not have a matching row (object_id=1328111872,column_id=5) in sys.columns.

View 6 Replies View Related

Record Matching

Feb 3, 2008

What can be done with Sql Server for this problem?

In this query:

select A, B, C
from
(select A, B, C from table1) as G1,
(select A, B, C from table2) as G2

where G1.A = G2.A
and G1.B = G2.B
and G1.C = G2.C

a record in table1 can be matched with more than one record in table2, and I don't have any other field in the tables that helps me link one G1 record to a specific G2 record.
What can I do to match each G1 record to only one (if any) G2 record (if there are two records in table2 which are identical, I want the query to choose one of them and leave the other one unmatched)?
Another question: is there a way to count records and attribute them a unique number? What is an index?

Thanks in advance

Anna - Verona (Italy)

View 5 Replies View Related

Substring Matching

Jul 19, 2007

hi allI want to write a sotred procedure which has a parameter,called@name.The SQL statement must return all rows where this parameter is asubatring of a special column called FirstName.This procdeure do thesame ,but return all rows where @name is the exact matching.whatshould I do?/*This procedure return the exact matching*/CREATE PROCEDURE substring@name varchar(50)ASSELECT *FROM table1WHERE (table1.firstName LIKE @name);

View 2 Replies View Related

LIKE Matching Question

Nov 12, 2007



I have a piece of code that uses LIKE matching to check for the existence of a set of characters in a string as follows

SELECT a.Name, a.Market
FROM Table a
Where a.Name LIKE 'DAVIEL%'

I have the following sample data in a look-up table

AddID Name_Full
100 DAVIEL
101 DAVIEL
102 DAVIELT
103 DAVIELT
104 DAVIELT
105 DAVIEL

When I write the above query, I want to exclude the AddIDs that have a Name_Full of DAVIELT. In the Name_Full column the only difference between the two strings is the "T" in DAVIELT.

Please note that it has to use a LIKE statement. The code is already written that way and I do not have control over it.

Any help will be much appreciated.


View 5 Replies View Related

Batch Name Matching

Feb 2, 2008

Hello friends,

We are in initial phase of designing an application whose primary purpose is to match a list of loan defaulters with bank's customer database.

Let me make the picture more clearer to you,

There is a list of defaulters which contains about 1500000 names (Primary names and Aliases e.t.c), related to a person.

On the other hand there is database which contains bank's customer's (about 20, 00000 records) data.

We will have to run batch a scan for name matching against defaulters list to the current customer base of bank to check if any of existing customer is in defaulter's list.

This whole exercise of name matching should be finished in 4 to 5 hours (as required by user/client).

How can I optimize my data base design or processing logic to achieve this goal,

Should I use full text query or I should load data related to names in memory than carry out some logic for name match. These are two my primary thoughts.


View 1 Replies View Related

String Matching

Nov 22, 2007

I'm on SQL Server 2005.

I have 2 tables called Customer & CustomerArchive. Both Tables have the same Column names and Datatypes etc.


CustomerID Address Postcode

1 10 Alcove Street 4000

50 21 Spring Street 4032

33 5 Terrace Place 4010

What I need to do is compare each column except for the CustomerID to see if it is the same!

In other words, I need to compare Address in the Customer Table with Address in the CustomerArchive Table.

I have to do this with all columns (12) of them between the 2 Tables.

Is there a efficient & smart way to do this aprt from the obvious way of joing the 2 Tables via the CustomerID and performing a Customer.Address <> CustomerArchive.Address
Customer.PostCode <> CustomerArchive.PostCode
etc etc etc!

View 2 Replies View Related

Types Are Not Matching

Feb 17, 2008

I'm working with Access 2,007, and I have an instruccion in SQL but when I execute it, it shows an error "" the instruccion and var in red


Dim Mes As String
Dim CostoKw As Double
Dim SQLUdate As String
Mes = InputBox("Mes a Actualizar Costo: ")
CostoKw = InputBox("Costo que se Aplicara: ")
Select Case Mes
Case 1
DoCmd.RunSQL "UPDATE Clientes SET Clientes.Costo01;" = CostoKw


The table's field Costo01 is the type Number and Double.

Thanks

View 1 Replies View Related

Getting Matching Records

Jun 14, 2006

Hi,

I have the following table:

***********************************************************************************************
Sheet --- Cycle

Init SC --- 89
Post NCOA --- 89
Post Supp --- 89
Revised Final State Counts --- 89
Revised Final State Counts --- 94
***********************************************************************************************


Since "Revised Final State Counts" appears in both cycles 89 & 94. How can I query the table so that I only get that 1 record?

Thanks

View 1 Replies View Related

ASP.NET,Gettting Error In The Program

Jan 4, 2007

Hi,
please have look into the code and let me know the solution plz. 
string ProID;
try
{
using(SqlConnection conn=new SqlConnection(source))
{
conn.Open();
DataSet ds=new DataSet();
DDLProject.Items.Clear();
SqlCommand cmd=new SqlCommand("SP_ProjectSelect",conn);
cmd.CommandType=CommandType.StoredProcedure;
cmd.Parameters.Add("Name",SqlDbType.NChar,30,"@Name");
cmd.UpdatedRowSource=UpdateRowSource.None;
cmd.Parameters["Name"].Value=DDLProductLine.SelectedItem;
 
SqlDataReader dr=cmd.ExecuteReader(); ------------->>>> Here iam getting Following Error.
 
while(dr.Read())
{ Response.Write(dr["ID"].ToString());
}
 
}
}
catch(System.Exception ex)
{
Response.Write(ex);
}
Error:
System.InvalidCastException: Object must implement IConvertible. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteReader() at MIS.UI.ResourceList.DDLProductLine_SelectedIndexChanged(Object sender, EventArgs e) in c:inetpubwwwrootdotnet pgmsmisui
esourcelist.aspx.cs:line 121 
Any suggestion plzz,where went wrong.
Thanks in advance
Regards
Mahesh Reddy 
 
 

View 2 Replies View Related

Use Sql 2005 To Program Against Sql 2000

May 15, 2007

I have sql server 2005 (full version) installed on my local machine, while the databases (on the server) I want to program against are in sql 2000. Could I program against sql 2000 databases using sql 2005? If yes, what do I need to know before I start doing that? Any suggestions are welcome.

View 1 Replies View Related

Problem With Update Program

May 29, 2008

 I have written this Program For Updating the profile Information .At the Page_Load Event I read the profile information from the database and write it in the respective Textboxes .At the Button_Click event I have written a program to Update the data from the respective Textboxes.The program executes but doesnot updates .public partial class CreateProfile : System.Web.UI.Page{    SqlConnection con;    SqlCommand com;    string un = HttpContext.Current.User.Identity.Name;    protected void Page_Load(object sender, EventArgs e)    {        con = new SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Profiledata.mdf;Integrated Security=True;User Instance=True");        com = new SqlCommand("select * from profiletable where username='" + un + "' ", con);        DataSet ds = new DataSet();        SqlDataAdapter da = new SqlDataAdapter(com);        SqlCommandBuilder cb = new SqlCommandBuilder(da);        DataTable dt = new DataTable();        da.Fill(ds);        dt = ds.Tables[0];        Textname.Text = dt.Rows[0][1].ToString();        com.Cancel();    }    protected void Button2_Click(object sender, EventArgs e)    {        con = new SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Profiledata.mdf;Integrated Security=True;User Instance=True");        con.Open();        com = new SqlCommand("update profiletable set name='" + Textname.Text + "'  where username='" + un + "' ", con);        com.ExecuteNonQuery();        com.Cancel();        con.Close();    }} Plz help me with this program........................   

View 4 Replies View Related

Running SQL In A Batch Program

Apr 6, 2001

I need to create a program that will run Client Access to download data from the AS400 to a flat file, then run SQL DTS to import the data into a table for use by another software package.

I've created a bat file that does that using the CA RTOPCB command and the SQL DTSRUN utility. Problem is that it appears that I need to first check to see if there is a table in SQL and if there is to delete it. Otherwise, rather than overlay the existing data in the table it adds to it.

Is there a way to issue a SQL drop table in DOS? Or am I missing something that could be done in SQL?

The DTSRUN is using a local package and CA is using a transaction request.

View 1 Replies View Related







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