Need Info From 2 Tables

Sep 18, 2007

Here's my string.  I know it's way wrong right now
 SELECT binbox_receipt.partner_code
    ,binbox_receipt.link_id
,binbox_receipt_archive.partner_code
,binbox_receipt_archive.link_id   
  FROM binbox_receipt, binbox_receipt_archive
where
binbox_receipt_archive.link_id = binbox_receipt.link_id
and binbox_receipt.partner_code = '1154' and binbox_receipt.link_id = '2684'

and (binbox_receipt_archive.partner_code  = '1154' and binbox_receipt_archive.link_id  = '2684')


I need to check 2 tables if in the first table the link_id and partner_code exist or the second table link_id and partner_code exist
any help would be greatly appreciated I'm a little new at this but having fun trying 

View 11 Replies


ADVERTISEMENT

Combining Info From Two Tables?

Oct 18, 2004

Hello, I'm having some problems trying to access two tables in a SQL database at the same time and making some results out of them. Let me explain further: the first table has some information in that I'm going to be doing a select query on and reading out, but one of the columns in this table is a set of codes, the second table contains the codes in one column and their meanings in the other.

So I want to bring back the information from the first table and then select the information for the codes shown from the second table and print their meanings alongside the information from the first table. Could anyone help me out in figuring out how my SQL in the ASP page for this would be written? Sorry if this is a little confusing but im having a hard time visualising how to do this.

View 8 Replies View Related

Retrieve Info From Two Tables

Aug 8, 2005

Hello;

I have two tables

Table 1 Rx
-------
RxNumber, RxId(no duplicates), RxDate, Name, Notes, Type, DOB

Table 2 Email
-------
EmailId, RxId(duplicates ok), Subject, Message, To, From, Type


I would like the result to be

Result Table
------------
Rx Id, RxDate, Name, Notes(or Subject), Type

Table 1 can be searched by date, or Name or DOB I want the result of this search to go through table 2 and return to me all emails that match thre previous results RxIds

For example Table 1
RxNumber, RxId, RxDate, Name, Notes, Type, DOB
1 99 1/1/2005 Person1 Note1 1 1/1/95
2 98 3/1/2005 Person2 Note2 1 1/1/96
3 97 5/1/2004 Person3 Note3 1 1/1/97
4 96 1/1/2004 Person4 Note4 1 1/1/98
5 95 6/1/2005 Person5 Note5 1 1/1/99

For Example Table 2
EmailId, RxId(dupl ok), Subject, Message, To, From, Type
1 100 S1 M1 T1 F1 2
2 98 S2 M2 T2 F2 2
3 101 S3 M3 T3 F3 2
4 95 S4 M4 T4 F4 2
5 98 S5 M5 T5 F5 2
6 95 S6 M6 T6 F6 2
7 96 S7 M7 T7 F7 2
8 98 S8 M8 T8 F8 2
9 100 S9 M9 T9 F9 2
10 100 S10 M10 T10 F10 2

If I do a search for Rxs that were prescribed from 1/1/2005 to 7/1/2005
I would like the resulting table to be
RxId RxDate Name Note/Subject Type
99 1/1/2005 Person1 Note1 1
98 3/1/2005 Person1 Note2 1
98 3/1/2005 Person2 S2 2
98 3/1/2005 Person2 S5 2
98 3/1/2005 Person2 S8 2
95 6/1/2005 Person5 Note5 1
95 6/1/2005 Person2 S4 2
95 6/1/2005 Person2 S6 2

I have tried a combination of inner joins and Union with no luck any suggestions

Thanks

Fernb200

View 2 Replies View Related

How To Move Info From 2 Tables To 1

Apr 7, 2008

Hello all,

Ive been tasked with writing a SQL query to move information from 2 tables(old1 and old2) into 1(new). table new already has all the information from old1, but also has some additional columns that are encompassed from old2. Also some of the columns in table new need to be assigned a 1 or a 0 if the information is present in old2. Here is what I came up with:

UPDATE new

SET new.IsRentalLocation = 1
new.IsMainCampus = 1
new.IsLearningCenter = 1
new.IsStudentResource = 1
new.AlternateStateDisp = 0
new.Directions = tbl_old2.Directions
new.Catering = tbl_old2.Catering
new.Lab = tbl_old2.Lab

FROM new, old1, old2

WHERE new.CampusID = old1.CampusID
AND old1.LearningCenterID = old2.LearningCenterID

Does this look right? or should I be using an insert command?

View 4 Replies View Related

How To Show All Tables Info In Task Pad?

Jun 17, 2004

In the table view in the Task Pad view, it lists the number of rows and size of each table, which is great, however it only lists the first 25 tables or so and there is no scroll function.

1. Does anyone know how I can see this info in Task Pad for all tables, without having to use the search function and look up 200+ tables one-by-one?

2. Does anyone know of another utility or statement to run against the DB which will return this info all at once for all the tables?

Thanks.

View 9 Replies View Related

Where To Find Info On The Concept Of SQL Tables

Feb 7, 2006

i would like to know where can i find information on the concept of SQL like Base Table , View Table and Search Table as now i am using VS.Net 2005 and SQL Server 2005 to write a addressbook program and i am just a newbie to Sql and c#... i wish to write my sql commands in c# side before passing it into sql and may i know how to do it?

View 20 Replies View Related

Merge Tables And Collect Origin Info

Apr 29, 2015

If you have 2 tables with the same columns and you would like to see all distinct records in a result of a select and also the information in the records which table the record comes from (for instance: from table A or from table B or bot tables contain it) what should you do?

View 5 Replies View Related

Database Size Info Without Cursors Or Temp Tables

Jan 22, 2004

I have seen a bunch of ways to get the size of all the tables within a database posted on this board. I decided to modify an older one I found here (http://www.sqlteam.com/item.asp?ItemID=282). I set it up so there is no cursors or temp tables. Pretty much just one select statement to return all the info you would need. It seems to be faster than anything I have seen so far. Take it for whats its worth. Thanks to the original creator.



/*
Original by: Bill Graziano (SQLTeam.com)
Modified by: Eric Stephani (www.mio.uwosh.edu/stephe40)
*/

declare @low int

select @low = low from
master.dbo.spt_values
where number = 1 and type = 'E'

select o.id, o.name, ro.rowcnt, (r.reserved * @low)/1024 as reserved,
(d.data * @low)/1024 as data, ((i.used-d.data) * @low)/1024 as indexp,
((r.reserved-d.data-(i.used-d.data)) * @low)/1024 as unused
from
sysobjects o

inner join
(select distinct id, rowcnt
from sysindexes
where keys is not null and first != 0) ro on o.id = ro.id

inner join
(select id, sum(reserved) reserved
from sysindexes
where indid in (0, 1, 255)
group by id) r on o.id = r.id

inner join
(select c.id, dpages+isnull(used, 0) data from
(select id, sum(dpages) dpages
from sysindexes
where indid < 2
group by id) c full outer join
(select id, isnull(sum(used), 0) used
from sysindexes
where indid = 255
group by id) t on c.id = t.id) d on r.id = d.id

inner join
(select id, sum(used) used
from sysindexes
where indid in (0, 1, 255)
group by id) i on d.id = i.id


where o.xtype = 'U'

order by reserved desc

View 3 Replies View Related

How To Make A Temp Table Using Info Fromtwo Tables

Mar 8, 2008

I have one database named StudInfo. It has two tables named StudentInfo, and GradeInfo.
StudentInfo conntains 4 columns. The 1st one is StudentID (PK) int, LastName varchar(10), FirstName varchar(10), and PhoneNumber int.

GradeInfo contains 4 columns also StudentID (FK) int, GradeID varchar(10), Grade int, Date Datetime.

What I would like to know is how using a T-sql query I could make a temp table with studentID, LastName, FirstName, and then the average of all the different types under GradeID. As of right now I have been limiting the names that are put into GradeID to Homework, Daily, Test, Quiz, and Bonus. When I say average I mean the average of all Homeworks under one studentID, and all Daily under one studentID... etc. I would like the info returned for each student in studentID. Allow Nulls has been turned off.

Never assume someone knows what you are talking about.

View 6 Replies View Related

How To Construct The Url Via Database Tables Info To Generate Report

Aug 17, 2007



Please help, i am really really struggling for a logic to handle 100's of reports we have via button click from asp.net webform.
in the button click i am constructing the url :
**************************************************************************************************************
http://localhost/reportserver?/MyReports/StatusReport&UserID=1&ContractID=1&subcode=null
*************************************************************************************************************

I have a table would like to maintain the parameters required for the chosen report:
when the user chooses from list box on the webform for StatusReport, immedeately it fetches the parameters related to Statusreport and gets everything which is stored with a space in between for each parameter, for this report i have 3 parameters:
UserID ContractID subcode

now how can i construct the string based on the above parameters , i am using vb.net as code behind for my webform(asp.net)

please any ideas will help me achieve the logic. please help thank you all very much.


View 4 Replies View Related

Is There A System Table With Timestamp Info Or DTS Job Info?

May 7, 2007

I want to be able to see when records have been added to a table. The issue is we have a DTS job scheduled to run every night. The developer who wrote it password protected it and doesn't work here anymore. I want to add a step to this series of DTS jobs and want to run it just prior to his job. Is there a way to see when the records are being added or when this job is being run? Thanks again, you guys are the best.

ddave

View 3 Replies View Related

Last Used DB Info

Apr 4, 2006

Hi all,

I've inherited the administration of two SQL Servers one 7.0 and the other 2000. We are looking into upgrading to 2005 so I'm gathering all the info I can on the DBs and applications using them.

Now, how can I check if a DB is currently in use? Is there a way to find out when a DB was last accessed?

By the way, I've never done DB administration so you can figure out how desperate I'm getting.

Thanks all for your help,

GS

View 1 Replies View Related

Info

Jan 18, 2007

pratap writes " Dear respected sir,

i need small information regarding how the picture image data can be stored in the database and how it can be made possible. is there for the need for any conversion.

thank you

awaiting for your reply"

View 2 Replies View Related

Between And More Info

Dec 18, 2007

Hi, I hope someone can help me with this.

I want to get a query from a database

from between '3' AND '5' (NO PROBLEM)

but I want to add that I want info from 7 and up

how would I write that ? (if I do it in seperate lines the query returns nothing) which is not true.

Thank you.

View 1 Replies View Related

Help With Db Info.

Oct 1, 2007

Well i need to document what tables i have in my stored procedures. Im really new to sql as well. And the problem is if i try code i have or sp_depends for instance it will only tell me the tables that are in that DB so if I have multiple tables from different DB's they are left out. I was told that sp_MSForEachDb for go through each DB and I could try it that way. Any help or example code dumbed down for me would be awesome. This was posted in a previous thread but i though this would be a better explanation

View 3 Replies View Related

Info Regarding MSDE

Nov 14, 2003

Hi

Iam not sure if the Question is approriate for this forum but here goes....

I have just started playing around with ASP .NET and since i do not have a lot of money i downloaded and installed MSDE as my database. So far i havent been able to find any free tools to access MSDE. Iam looking for GUI tools from where i can create Databases , tables etc... I have experience with MySQL database and am looking for something like MySQLAdmin for MSDE..


any help in this regard is appreciated

Thanks
Punit

View 1 Replies View Related

Need Help Parsing Out Info

Jul 22, 2004

Hi All,

I'm using a SQL selection to fill a DataGrid. One of the fields I have is called diagnosis. This field in the database can contain multiple diagnosis. But I use a set of characters to divide each diagnosis.
Example : Sick!@#$%Hurt!@#$%Ill!@#$%
My problem is this is how it looks in my Data Grid. Can someone tell me how to parse out each diagnosis.

Thanks

View 1 Replies View Related

Spid Info

May 12, 2000

Hi,
Here i have a question..
Whenever i see my spid in LOCK/PROCESS ID
one command DBCC BUFFERINPUT(MY SPID) always running
and it is showing ''''tempdb.dbo.##lockinfo'''
MODE---- X
Is it pretty normal or something wrong..
i am not running any thing, just simply opened EM..
Pls any suggestions...
thank u

kavira

View 2 Replies View Related

Triggers Info

Feb 28, 2000

Hello!
I'm new DBA.
I have triggers on my table in the database have been created one individual a long time ago. Sp_helptrigger stored procedure gave me just a little info about triggers. I would like to see the real code for each trigger, but I don't have idea where to look for it.
Please help me to find it.

Thank you
Anny.

View 2 Replies View Related

Processor Info

Jan 23, 2003

After Sql server has been installed. Is there a way to find out for the mode that it is installed in, ie per processor or per seat?

Thanks

View 1 Replies View Related

Info On SQLPERF

Apr 4, 2001

Can anyone point me in the direction of some online resource that explains, in detail, the statistics returned by DBCC SQLPERF?

Thanks
Phill

View 1 Replies View Related

Exception_Access_Violation Info

Sep 15, 1998

To all:
I have installed a new Compaq 7000 with NT4.0 sp3 and Sql Server 6.5 sp4 into production about two weeks ago.
Everything went fine until yesterday. Around noon I received 2 Exception_Access_Violation about a second apart
with two differend spids. About 20 mins later I got the Out of connections message and sql server stopped
reponding. I Could not stop sql server and had to reboot the server. I have configured the connections at 600
and generally we average a little over 400. Everything seems to be running fine now but I would like to get some
information from all the great minds out there!

What exectly is Exception_Access_Violation? Can I figure out what caused it or can I debug it? Do you think that the
EAV caused the out of connections error? Any help, insight would help greatly!

Thanks in advanced,
Glen Whitling

View 1 Replies View Related

I Need Some Info On MS SQl Server 6.5

May 7, 1999

Respected Sir,

I am from India. My office has 15 location all over India. I am in corporate office.We have Ms Sql server 6.5. Also all other centers have
have same Ms Sql Server 6.5. We develop a Intranet based application.
In which Ms Sql Server 6.5 is the back end and Netscape browser is the front end.

The centers have their independent database. all also have different data structurre.
But the Head Office needs data from them. How the replication technology help us. and How we we will conect through internet or we haveto have seprate dedicated
leased lines back to centers.

What will be data structure .

Himansu

View 1 Replies View Related

Best Way To Log Statistical Info

Apr 12, 2007

I want to keep track of some application statistics.

-How many applications per day, month, year
-How many apps for a specific type of widget
-etc.


Is this best accomplished by a script that review the data or by using counters that are updated with every app?

Can someone give me some info on how to get started with this? I did a search, but only found a thread that recommends an article that costs $100.

View 9 Replies View Related

Process Info

Jan 11, 2005

I want to check who access the database in the sql server. When i go to current activity then process info. I found not all the users who access the database are displayed. Even though i refresh it. It didn't show up. But i am sure some user was accessing the database. Anybody know why, how can i avoid it. Thanks.

View 2 Replies View Related

Sql Server Info

Mar 3, 2005

Hi All,

What is similar to "Schema" and "Table space" in SQL Server?

What is the physical organization/structure of SQL Server?

Thanks in advance,
Jai

View 7 Replies View Related

Trace Info

Feb 19, 2004

Folks, I've inherited a SQL 2K server that has a trace running. I can see the trace file being generated(.trc), I can also see the standard templates(.tdf). But BOL is not helpful in finding information about the
trace when you have no information. I just want to shut the damn thing off.

I can open the trc file in SQL Profiler but I am not proficient in the tool's use. I also don't see a trace table anywere in the database.

If anyone can be of any help it would be much appreciated. Thanks.

View 7 Replies View Related

Not Sure How To Get Info From Other Table

Aug 31, 2005

I am having problems with my store procedure displaying my last column name which is "DISPLAY_CATEGORY_DESC". I am trying to display the description from another table. But in order to get to the description I have to go through 2 tables. The tables look like something like this.

First TableTABLE_CATEGORY

PRIMARY_KEY = DIR_CATEGORY_ID = 5000

Column Name
DIR_CATEGORY_LVL_ID1 = 100
DIR_CATEGORY_LVL_ID2 = 200
DIR_CATEGORY_LVL_ID3 = 300

Second TableTABLE_CATEGORY_DESCRIPTION
PRIMARY KEY DIR_CATEGORY_LVL_ID1 = 100

Column Name
DESCRIPTION = "Car Model Company"

This is my DISPLAY_CATEGORY_DESC

Not sure how to get to this description. Thanks for your help.


select cwebs.SESSION_ID, webs.ENTERED_DATE, cwebs.DIR_CATEGORY_ID, DISPLAY_CATEGORY_DESC

FROM di_webclickstats cwebs
left join di_websessions webs on cwebs.session_id = webs.session_id
where cwebs.DIR_CATEGORY_ID <> 0 and webs.ENTERED_DATE between @startDate and @endDate+1

View 3 Replies View Related

Some Info On MS SQL Server

Mar 1, 2006

I have developed a great intrest in the MS SQL Server recently. I was just wondering if it was worth putting my time into learning this system. In the members opinion would SQL server be technically fit? Does it have a good campacity and flexibility? These areas are quite important to me. I would also like to know how web friendly the server is and its ability to handle complex data.

Any help would be much appriciated.

View 2 Replies View Related

Newbie Need Some Info

Mar 10, 2006

Hi there,

I have been asked buy my boss to try and solve a problem. We have a access database which has a hell of a lot of entries. We want to use sql server to store this database now.

We want to be able to print reports and analyze the data by running queries etc.

Apart from the obvious sql server software, what would be required to acheive this, would i need a dedicated front end built?

Im just testing water at the moment looking for any info that i might need.

Thanks

Trev

View 5 Replies View Related

Exceptions Info

Jan 11, 2007

Vikas writes "can any one help me in getting the list of exceptions and there types and how to tackle them."

View 1 Replies View Related

Yesterday's Info

May 25, 2007

how do i get yesterdays records only?

View 20 Replies View Related

Trouble With Info

Oct 23, 2007

I dont know if this is the right place to post this lets hope. I need to get the total of sales for say marketed.

im trying a script like this but its not doing it right

IIF( Fields!Type.Value = "Non Promotional" then Fields!TotalSales.Value = 0 else Fields!TotalSales.Value)

View 9 Replies View Related







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