Showing posts with label developing. Show all posts
Showing posts with label developing. Show all posts

Monday, March 12, 2012

help with query

Hi folks,

I'm fairly new to the SQL arena and need a hand wrapping my mind around
something. First allow me to paint you a picture:

I'm developing an ASP page (not .net) for inventory management.

At the moment I have 2 tables.

1) ProductTable has the following columns: ID, Part, Description, Price and
Manufacturer (INT value)

2) ManufacturerTable: ID, ManuName

I have a form in which a user enters information on a new product and on
this form I have a drop down list which is populated via the ManuName table
which displays all available manufacturers from the
manufacturertable.manufacturer column.

What I want is that when a user hits save, it saves the info to the
producttable and takes the corresponding integer (1 to 1 relation) from the
ManuName that the user selects and places it in the
ProductTable.Manufacturer value along with the rest of the info. Can anyone
lend me a hand on this?

Thanks,
DaveDave
When the users choose a manufatory from the combo just save its ID ( I
assume you fill the combo with ID's of manufatures)

Create a stored procedure that insert the new data into Production Table and
one of the parameters give a ID of the chosen manufactire.

"Dave" <overkil6@.cogeco.ca> wrote in message
news:M86Md.2640$Sx6.290632@.read2.cgocable.net...
> Hi folks,
> I'm fairly new to the SQL arena and need a hand wrapping my mind around
> something. First allow me to paint you a picture:
> I'm developing an ASP page (not .net) for inventory management.
> At the moment I have 2 tables.
> 1) ProductTable has the following columns: ID, Part, Description, Price
and
> Manufacturer (INT value)
> 2) ManufacturerTable: ID, ManuName
> I have a form in which a user enters information on a new product and on
> this form I have a drop down list which is populated via the ManuName
table
> which displays all available manufacturers from the
> manufacturertable.manufacturer column.
> What I want is that when a user hits save, it saves the info to the
> producttable and takes the corresponding integer (1 to 1 relation) from
the
> ManuName that the user selects and places it in the
> ProductTable.Manufacturer value along with the rest of the info. Can
anyone
> lend me a hand on this?
> Thanks,
> Dave

Friday, February 24, 2012

Help with Linked Servers

Hi Everyone,

I am developing a reporting database server that will use multiple data sources to construct its query (SQL Server 2005, Oracle 9i, and DB2). I successfully linked all 3 databases to my SQL Server 2005 and I am ready to create the report queries. I would like to know what is the best method to do this. Should I refer to the linked servers by four part naming or use a OPENQUERY query. When using a OPENQUERY, you cannot specify parameters to pass to the linked server which makes me question its performance. Can someone please suggest the best way to do this?

Thank you in advance

-Sam

The 'best' method is most likely the four part naming. It allows you to create more robust queries.

OPENQUERY is best used when the remote server is rarely used and for security (or other) reasons, having a 'linked server' is not appropriate. If the remote server is frequently used, then, by all means, add it as a linked server and use the four part names.