Showing posts with label input. Show all posts
Showing posts with label input. Show all posts

Monday, March 19, 2012

Connecting to multiple database

Hi, i'm a novice in all this database transactions stuff so please bear with me if my input is incorrect or out dated. I'm running into the problem of needing to compare or manipulate data that is in 2 tables in 2 separate database. Is there any way i can set up the connection string such that i can access data/tables from both database at the same time in 1 sql command (similar to accessing 2 tables of the same database in 1 sql command)?

Is this currently possible? If not, is it because the execution of sql command must be tied to only one connection string at each instance? Would be great if the wonderful folks at MICROSOFT can look into this and provide us with an upgrade to cater for such a need...

Regards

Oceandude

If the database are within the same server you can several methods, all not doing it in one command (as this not possible) but within transactions:

In a SQL Batch

BEGIN TRANSACTION

UPDATE SomeOwner.SOMETable SET SomeCol = 1

UPDATE SomeDatabase.SomeOwner.SOMETable SET SomeCol = 1


COMMIT

You can use a transaction scope to elevate the transaction to a distributed (crossdatabase transaction), but that depends on the coding language you are using the Transaction scope would be a sample for .NET.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||You can also create a synonym (if your server is SQL 2005) in one database for a table in the other.
See CREATE SYNONYM.|||

What Is your goal? You could open multiple SQL Commands or you could do any of the above suggestions, or your could define a stored process on the server that does the bulk of the work. There are many options depending on what you really want to do here.

Connecting to multiple database

Hi, i'm a novice in all this database transactions stuff so please bear with me if my input is incorrect or out dated. I'm running into the problem of needing to compare or manipulate data that is in 2 tables in 2 separate database. Is there any way i can set up the connection string such that i can access data/tables from both database at the same time in 1 sql command (similar to accessing 2 tables of the same database in 1 sql command)?

Is this currently possible? If not, is it because the execution of sql command must be tied to only one connection string at each instance? Would be great if the wonderful folks at MICROSOFT can look into this and provide us with an upgrade to cater for such a need...

Regards

Oceandude

If the database are within the same server you can several methods, all not doing it in one command (as this not possible) but within transactions:

In a SQL Batch

BEGIN TRANSACTION

UPDATE SomeOwner.SOMETable SET SomeCol = 1

UPDATE SomeDatabase.SomeOwner.SOMETable SET SomeCol = 1


COMMIT

You can use a transaction scope to elevate the transaction to a distributed (crossdatabase transaction), but that depends on the coding language you are using the Transaction scope would be a sample for .NET.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||You can also create a synonym (if your server is SQL 2005) in one database for a table in the other.
See CREATE SYNONYM.|||

What Is your goal? You could open multiple SQL Commands or you could do any of the above suggestions, or your could define a stored process on the server that does the bulk of the work. There are many options depending on what you really want to do here.

Connecting to multiple database

Hi, i'm a novice in all this database transactions stuff so please bear with me if my input is incorrect or out dated. I'm running into the problem of needing to compare or manipulate data that is in 2 tables in 2 separate database. Is there any way i can set up the connection string such that i can access data/tables from both database at the same time in 1 sql command (similar to accessing 2 tables of the same database in 1 sql command)?

Is this currently possible? If not, is it because the execution of sql command must be tied to only one connection string at each instance? Would be great if the wonderful folks at MICROSOFT can look into this and provide us with an upgrade to cater for such a need...

Regards

Oceandude

If the database are within the same server you can several methods, all not doing it in one command (as this not possible) but within transactions:

In a SQL Batch

BEGIN TRANSACTION

UPDATE SomeOwner.SOMETable SET SomeCol = 1

UPDATE SomeDatabase.SomeOwner.SOMETable SET SomeCol = 1


COMMIT

You can use a transaction scope to elevate the transaction to a distributed (crossdatabase transaction), but that depends on the coding language you are using the Transaction scope would be a sample for .NET.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||You can also create a synonym (if your server is SQL 2005) in one database for a table in the other.
See CREATE SYNONYM.|||

What Is your goal? You could open multiple SQL Commands or you could do any of the above suggestions, or your could define a stored process on the server that does the bulk of the work. There are many options depending on what you really want to do here.

Saturday, February 25, 2012

Connecting sql db to an html website

Does anyone know a good site that has a tutorial? I want to be able to input data from the website straight to the db i.e. place orders, check status of order.There are hundreds of web sites like this, each catering to a specific web site configuration. The methods for accessing the datsbase are different for ASP, COLDFUSION, PHP, etc.

-PatP|||I was looking through the forum posts and the closest thing I could find was a link between asp and sql. I do not know asp, but was wondering if there was one for just a regular html website.|||straight from the html to the database? not possible

has to be done using some type of server side program, generally called "cgi" (common gateway interface or something like that)

asp is a type of cgi program, so is perl, coldfusion, jsp, php, et cetera|||Do you know of a beginners guide to using this? Php I'm a little familiar with and thought of a solution to take a mssql db and importing it into a mysql sb; only problem with that is having a php script that will run it

Tuesday, February 14, 2012

connect user developed interface using WVD to DB SQLEE 2005

Dear Friends

I am a bigginer. I need to save input from textBox (User interface that I have made using VWD) to a database in SQLSEE 2005 using C#. please help me. I now how to connect to DB using Visual Items like gride view and form view. but i want to conect to DB using my developed UI lke in below. any help greatly appreciated

Name input area

address input area

Thanks

Amila

This article might help:

http://www.c-sharpcorner.com/Database/PlayingWithDataGridTA.asp

Buck Woody

connect user developed interface using WVD to DB SQLEE 2005

Dear Friends

I am a bigginer. I need to save input from textBox (User interface that I have made using VWD) to a database in SQLSEE 2005 using C#. please help me. I now how to connect to DB using Visual Items like gride view and form view. but i want to conect to DB using my developed UI lke in below. any help greatly appreciated

Name input area

address input area

Thanks

Amila

This article might help:

http://www.c-sharpcorner.com/Database/PlayingWithDataGridTA.asp

Buck Woody