Accessing Multiple Databases From Stored Procedure In SQL 2000

May 16, 2006

Hi ,

I have around 5 databases with same structure used to store data for different locations and services.

I have created an intermediate database which will have all the stored procedures to access data from above 5 databases.

My queries are common to all the databases. so,I would like to pass database name as an argument to my stored proc and execure query on specified database.

I tried this doing using "USE Databasename " Command. but it says ...We can not use "USE command " in stored proc or triggers. so ..what i did is ..

--------------------------------------------------------------------------------------------------------------

CREATE PROCEDURE TestDB_access(@dbname varchar(100))
AS

BEGIN

DECLARE @localDB varchar(100)

Set @LocalDB=@dbname

if @LocalDB='XYZ'

EXEC ('USE XYZ ')
elseif @LocalDB='ABC'

EXEC ('USE ABC')


Select * from Mytable

END

---------------------------------------------------------------------------------------------------------------

When I run this from my database , it gives me an error "unable to find table "mytable".

What is the best way to make my queries work with all the databases.

Thanks in advance

Venu Yankarla

View 4 Replies


ADVERTISEMENT

Stored Procedure Using Multiple Databases

Sep 14, 2006

Ok, this is kind of an odd problem.  Back in June we were having problems with our call manager software, and they decided to have it just start usinga new database.  Now I'm trying to generate some reports which need to cover both the old call stats and the new, so that means the stored procedure builds a temp table and populates it from both databases.This works perfectly fine in Management Studio, and when being called from Excel.However when I try to call it from an ASP.NET web app using SqlCommand.ExecuteReader(), I only get results from the new database!What on earth could cause that?

View 2 Replies View Related

Transact SQL :: Looping Through Multiple Servers And Databases In Stored Procedure

Aug 27, 2015

I am doing some administrative tasks and need to collect some principals information from multiple instances and user databases.

I have table "dbo.instances" with list of instances. 
I have databases from "sys.databases". 

How can I execute the query to get principals information from "sys.database_principals" on each remote instance and database. I know that can use cursor, but not sure how to do this with multiple servers and databases.

View 3 Replies View Related

Issues About One Application Remotely Accessing Multiple Databases

Nov 22, 2007



Hello,

My next project(in VB.NET 2005) would involve accessing different DBs and tables in remote SQL servers

What are the steps that need to consider first? Are there any settings that needs to be done in the servers?
k

View 1 Replies View Related

How Do I Write SQL Query Accessing Multiple Databases (DBFs)?

Aug 8, 2006

I have several database files, all in the same directory. I want to write SQL statements that access two databases at once. For example, if only one database would be involved, I would write:


SELECT     Test_Source_ID_column, Data_column
INTO            Test_Destination_table
FROM         Test_Sources_table
The above query copies two columns (Test_Source_ID_column and Data_column) from Test_Sources_table into a brand new table called Test_Destination_table.
Now the above query is fine for both the old and new tables being in the same database. But what if Test_Sources_table is in file Old.dbf and I want the new table Test_Destination_table to be in New.dbf?
Both Old.dbf and New.dbf are in the same directory. Therefore, there is no security issue about using ......etcpasswords. I should therefore be able to use relative paths. So, I also want to know how I can do that select on two databases in the same directory without typing long, long paths.
Is there a way to do queries that access multiple database files (all database files being in the exact same directory) AND use relative paths or no paths (and certainly not type a full path)?
NOTE 1: I'm using SQLEXPRESS, therefore do not have the SQL Server 2005 tools. I have Visual Studio 2005 Developer Edition with its tools.
 NOTE 2: One table is accessed through ODBC. The other table is accessed through SQLEXPRESS.
 

View 5 Replies View Related

Integration Services :: Schema Separation - Accessing Multiple Databases

Nov 8, 2015

We have a system that uses 3 databases, one for Membership db standard MS membership only the application has access to that data, one with User Data which we would like to make multi-tenant using Schema-Separation, and a third read-only reference db which is Common Market data for all users.we anticipate Tenant numbers in the thousands.Current we have multiple queries which create joins between the Main db and the Reference database using something like

Selec S.*, M.ScheduleDate, M.substation from Sites S left outer join Market.dbo.MarketUnit M where S.MarketUnitID = M.MarketUnitID

i'm planning to have a new schema for each Tenant on the Main Database, so I would create a Schema T1 for the first customer, a user T1User with access to T1 schema.  and grant T1User access to Market.dbo. My First question is are there any concerns about the above T1User setup? My second question is, are there any tools which would automate the setup of the multi-tenant with schema separation, or should I just script the whole Main Database schema creation and replace schema name globally and then execute the script?

My Third question, how about upgrade and updates... currently using VS to compare dev/qa/prod database to identify changed which need to be promoted, and pushing updates...  this could be a big pain to promote code to thousands of Schemas.  grantedwe will likely keep the overall number of schemas spread over different SQL servers.

View 2 Replies View Related

How To Prevent Domain Admin Users From Accessing SQL 2000 Databases?

Mar 6, 2008

Based on our database infrastructure, we need to secure our SQL databases. The security issue concerns on allowing a limited number of Domain Admin users to access the SQL databases.
We tried certain ways, based on the documents in the Microsoft web site, but we couldn€™t reach to the point of preventing the Domain Admin users accessing the SQL databases.

Thanks in advance.

View 5 Replies View Related

Accessing Stored Procedure In ASP.Net - What Is Wrong?

Jul 25, 2006

I have the following stored proceduredrop procedure ce_selectCity;set ANSI_NULLS ONset QUOTED_IDENTIFIER ONGO-- =============================================-- Author:        <Author,,Name>-- Create date: <Create Date,,>-- Description:    <Description,,>-- =============================================create PROCEDURE ce_selectCity    @recordCount int output    -- Add the parameters for the stored procedure here        --<@Param2, sysname, @p2> <Datatype_For_Param2, , int> = <Default_Value_For_Param2,, 0>AS        declare @errNo         int                -- SET NOCOUNT ON added to prevent extra result sets from        -- interfering with SELECT statements.        SET NOCOUNT ON;                    -- Insert statements for procedure here        select ciId,name from ce_city order by name                select @recordCount = @@ROWCOUNT        select @errNo = @@ERROR        if @errNo <> 0 GOTO HANDLE_ERROR        return @errNoHANDLE_ERROR:    Rollback transaction    return @errNoGoand i was just testing it likeProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load        db.connect()                Dim reader As SqlDataReader        Dim sqlCommand As New SqlCommand("ce_selectCity", db.getConnection)        Dim recordCountParam As New SqlParameter("@recordCount", SqlDbType.Int)        Dim errNoParam As New SqlParameter("@errNo", SqlDbType.Int)        recordCountParam.Direction = ParameterDirection.Output        errNoParam.Direction = ParameterDirection.ReturnValue        sqlCommand.Parameters.Add(recordCountParam)        sqlCommand.Parameters.Add(errNoParam)        reader = db.runStoredProcedureGetReader(sqlCommand)        If (db.isError = False And reader.HasRows) Then            Response.Write("Total::" & Convert.ToInt32(recordCountParam.Value) & "<br />")            While (reader.Read())                Response.Write(reader("ciId") & "::" & reader("name") & "<br />")            End While        End If        db.close()    End SubIt returns ALL ROWS (5 in the table right now). So, recordCount should be 5. (When i run it inside SQL Server (directly) it does return 5, so i know its working there).BUT, its returning 0.What am i doing wrong??EDIT:Oh, and this is the function i use to execute stored procedure and get the readerPublic Function runStoredProcedureGetReader(ByRef sqlCommand As SqlCommand) As SqlDataReader            sqlCommand.CommandType = CommandType.StoredProcedure            Return sqlCommand.ExecuteReader        End Function

View 5 Replies View Related

Accessing Stored Procedure Parameters Through XSD

Dec 9, 2006

Hi All,
 I have created a stored procedure (in SQL Server 2005 - Developer) with input and output parameters. Please somebody let me know how I can call this store procedure from code behind using TableAdapter i.e. through XSD.
Thanks,
 
Long Live Microsoft ;)
 

View 4 Replies View Related

Accessing Web.config From Stored Procedure

Feb 27, 2007

I want to access a key from appSettings  section of web.config. 
I have the number of days allowed for a user to activate his/her account  as a key in appSettings.
I have a maintenance procedure to delete all accounts that are not activated before that many days.
In this context, i have to access web.config from stored procedure.  The procedure will be scheduled as a JOB in sql server.
Thanks.
 

View 3 Replies View Related

Accessing A 'View' From Within A Stored Procedure

Jun 7, 2004

Hiya folks,
I'n need to access a view from within a SProc, to see if the view returns a recordset and if it does assign one the of the fields that the view returns into a variable.

The syntax I'm using is as follows :

SELECT TOP 1 @MyJobN = IJobN FROM MyView

I keep getting an object unknown error (MyView). I've also tried calling it with the 'owner' tags.

SELECT TOP 1 @MyJobN = IJobN FROM LimsLive.dbo.MyView

But alas to no avail!


Any offers kind people??

View 12 Replies View Related

Error In Accessing Stored Procedure

Oct 10, 2006

i'm trying to insert into db sql 2000 through a stored procedure .. i got this error " Procedure or function newuser has too many arguments specified "

this is the procedure :



ALTER PROCEDURE newuser

(@username_1 [nvarchar](80),

@email_2 [nvarchar](50),

@password_3 [nvarchar](256),

@Country_ID_4 [int],

@city_id_5 [nvarchar](10),

@gender_6 [nvarchar](50),

@age_7 [int],

@fname_8 [nvarchar](50),

@lname_9 [nvarchar](50),

@birthdate_10 [datetime])

AS INSERT INTO [Brazers].[dbo].[users]

( [username],

[email],

[password],

[Country.ID],

[city.id],

[gender],

[age],

[fname],

[lname],

[birthdate])


VALUES

( @username_1,

@email_2,

@password_3,

@Country_ID_4,

@city_id_5,

@gender_6,

@age_7,

@fname_8,

@lname_9,

@birthdate_10)







& that 's the code in asp page :



Dim param As New SqlClient.SqlParameter

SqlConnection1.Open()

param.ParameterName = "@username_1"

param.Value = TextBox1.Text

param.Direction = ParameterDirection.Input

SqlCommand1.Parameters.Add(param)

SqlCommand1.ExecuteNonQuery()







plz .. waiting any solve for this problem immediately

View 2 Replies View Related

Accessing Another Database In A Stored Procedure

Aug 10, 2006

hi

i have stored procedure and i need to access another database in my stored procedure

I'm going to query a table which is located in another database



as you know it is impossible to use the USE database keyword in stored procedures

so what should I do?

thanks.

View 2 Replies View Related

Sql 2000 Data From Multiple Databases

Jun 20, 2004

Hi
I need to retrive data from multiple tables which are in two databases. How do i connect to both of them at a time and query the tables with some criteria.
Thank you

View 3 Replies View Related

Accessing SELECT Results Within A Stored Procedure

May 18, 2004

Hi,
Can anyone tell me how to access the results from a select statement within the stored procedure?

This is to implement auditting functionality, before updating a record i want select the original record and compare the contents of each field with the varibles that are passed in, if the fields contents has changed i want to write an audit entry.

So i'd like to store the results of the select statement in a variable and access it like a dataset. e.g

declare selectResult

set selectResult = Select field1,field2,field3 from table1

if selectResult.field1 <> @field1
begin
exec writeAudit @var1,@var2,var3
end


Many thanks.

View 4 Replies View Related

Error While Accessing COM Component From .NET Stored Procedure..

May 7, 2006

I have a COM object that is written using Visual Basic 6. This is referenced in a .NET Stored Procedure. But when I execute the stored procedure I get an error:

Msg 6522, Level 16, State 1, Procedure prCalculator_ExecCalc, Line 0

A .NET Framework error occurred during execution of user defined routine or aggregate 'prCalculator_ExecCalc':

System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {844E8165-ABC1-432B-9490-51B1A6D91E71} failed due to the following error: 80040154.

System.Runtime.InteropServices.COMException:



Here is what I do:

1. Compile the VB DLL.

2. Convert into a .NET assembly by importing to a Visual Studio 2005 project. Sign the interop assembly.

3. Register it as an assembly in SQL 2005 server.

4. Create a .NET stored procedure and reference the above assembly. Compile this assembly again in SQL 2005 and create a stored procedure using the assembly. This assembly is also signed.

Please Note:

1. All the assemblies are registered with UNSAFE permissions.

2. They are compiled with COM Visible flag in Visual Studio 2005.

3. This works perfectly on my local SQL Express where I have Visual Basic/VisualStudio 2005 installed.

4. I get this error, when trying on Test Server. I tried to install the VB Runtime on this machine and still does not work.

So, what am I missing? Thanks for your help.





















.

View 4 Replies View Related

Problem With Accessing Stored Procedure In The Report

Mar 14, 2007

Hi,

I am new to Sql Server 2005 Reporitng Services. I created a report in BI and used stored procedure as a dataset. When I run the report in preview mode it works fine and when I run it in report server/report manager, I am getting the following error:

An error has occurred during report processing. (rsProcessingAborted)

Query execution failed for data set 'dsetBranch'. (rsErrorExecutingCommand)

Could not find stored procedure 'stpBranch'.

But I have this procedure in the db and it runs fine in the query analyzer and the query builder window in report project. When I refresh the page in Report manager, I am getting this error.
Input string was not in a correct format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:





An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:





[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2753715
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +102
Microsoft.Reporting.WebForms.ReportAreaPageOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response) +149
Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +75
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


I have changed the dataset from procedure to a sql string and the report is working fine everywhere. But I have a business requirement that I need to use a stored procedure.

I am not sure why I am getting this error and I greatly appreciate any help.

Thanks



View 2 Replies View Related

Trouble Accessing SQL Server 2005 Stored Procedure Parameters

Jun 14, 2007

I created a stored procedure (see snippet below) and the owner is "dbo".
I created a data connection (slcbathena.SLCPrint.AdamsK) using Windows authentication.
I added a new datasource to my application in VS 2005 which created a dataset (slcprintDataSet.xsd).
I opened up the dataset in Designer so I could get to the table adapter.
I selected the table adapter and went to the properties panel.
I changed the DeleteCommand as follows: CommandType = StoredProcedure; CommandText = usp_OpConDeleteDirectory. When I clicked on the Parameters Collection to pull up the Parameters Collection Editor, there was no parameters listed to edit even though there is one defined in the stored procedure. Why?

If I create the stored procedure as "AdamsK.usp_OpConDeleteDirectory", the parameters show up correctly in the Parameters Collection Editor. Is there a relationship between the owner name of the stored procedure and the data connection name? If so, how can I create a data connection that uses "dbo" instead of "AdamsK" so I can use the stored procedure under owner "dbo"?



Any help will be greatly appreciated!



Code SnippetCREATE PROCEDURE dbo.usp_OpConDeleteDirectory
(
@DirectoryID int
)
AS
SET NOCOUNT ON
DELETE FROM OpConDirectories WHERE (DirectoryID = @DirectoryID)

View 1 Replies View Related

Accessing A Stored Procedure From ADO.NET 2.0-VB 2005 Express:How To Define/add 1 Output &&amp; 2 Input Parameters In Param. Coll.?

Feb 23, 2008

Hi all,

In a Database "AP" of my SQL Server Management Studio Express (SSMSE), I have a stored procedure "spInvTotal3":

CREATE PROC [dbo].[spInvTotal3]

@InvTotal money OUTPUT,

@DateVar smalldatetime = NULL,

@VendorVar varchar(40) = '%'



This stored procedure "spInvTotal3" worked nicely and I got the Results: My Invoice Total = $2,211.01 in
my SSMSE by using either of 2 sets of the following EXEC code:
(1)
USE AP
GO
--Code that passes the parameters by position
DECLARE @MyInvTotal money
EXEC spInvTotal3 @MyInvTotal OUTPUT, '2006-06-01', 'P%'
PRINT 'My Invoice Total = $' + CONVERT(varchar,@MyInvTotal,1)
GO
(2)
USE AP
GO
DECLARE @InvTotal as money
EXEC spInvTotal3
@InvTotal = @InvTotal OUTPUT,
@DateVar = '2006-06-01',
@VendorVar = '%'
SELECT @InvTotal
GO
////////////////////////////////////////////////////////////////////////////////////////////
Now, I want to print out the result of @InvTotal OUTPUT in the Windows Application of my ADO.NET 2.0-VB 2005 Express programming. I have created a project "spInvTotal.vb" in my VB 2005 Express with the following code:


Imports System.Data

Imports System.Data.SqlClient

Imports System.Data.SqlTypes

Public Class Form1

Public Sub printMyInvTotal()

Dim connectionString As String = "Data Source=.SQLEXPRESS; Initial Catalog=AP; Integrated Security=SSPI;"

Dim conn As SqlConnection = New SqlConnection(connectionString)

Try

conn.Open()

Dim cmd As New SqlCommand

cmd.Connection = conn

cmd.CommandType = CommandType.StoredProcedure

cmd.CommandText = "[dbo].[spInvTotal3]"

Dim param As New SqlParameter("@InvTotal", SqlDbType.Money)

param.Direction = ParameterDirection.Output

cmd.Parameters.Add(param)

cmd.ExecuteNonQuery()

'Print out the InvTotal in TextBox1

TextBox1.Text = param.Value

Catch ex As Exception

MessageBox.Show(ex.Message)

Throw

Finally

conn.Close()

End Try

End Sub

End Class
/////////////////////////////////////////////////////////////////////
I executed the above code and I got no errors, no warnings and no output in the TextBox1 for the result of "InvTotal"!!??
I have 4 questions to ask for solving the problems in this project:
#1 Question: I do not know how to do the "DataBinding" for "Name" in the "Text.Box1".
How can I do it?
#2 Question: Did I set the CommandType property of the command object to
CommandType.StoredProcedure correctly?
#3 Question: How can I define the 1 output parameter (@InvTotal) and
2 input parameters (@DateVar and @VendorVar), add them to
the Parameters Collection of the command object, and set their values
before I execute the command?
#4 Question: If I miss anything in print out the result for this project, what do I miss?

Please help and advise.

Thanks in advance,
Scott Chang



View 7 Replies View Related

Multiple Insert Into Multiple Tables With A Stored Procedure

Mar 1, 2007

Hello
I am building a survey application.
 I have 8 questions. 
 Textbox -  Call reference
 Dropdownmenu  - choose Support method
 Radio button lists - Customer satisfaction questions 1-5
Multiline textbox - other comments.
I want to insert textbox, dropdown menu into a db table, then insert each question score into a score column with each question having an ID.
I envisage to do this I will need an insert query for the textbox and dropdownlist and then an insert for each question based on ID and score.
Please help me!
Thanks
Andrew
 

View 9 Replies View Related

Calling Other Databases From Stored Procedure

Jan 8, 2007

Hi,
 I am working with multiple databases on the same server and in a stored procedure I need to be able to call on one of them.
Here is an example of what I am trying to do in this stored procedure:create procedure sp_procedure(@variable int)select anitem from atable where selection = @variable
declare @anothervariable Char(3)
select @anothervariable = item_that_determines_database from atable where selection = @variable
use dbo.@anothervariableselect count(id) from Some_table where selection = @variable
The database is not found using this method and I do need to use it in a stored procedure.  All of the databases being used are (3) letter names in lower case (aaa, bbb, ccc, etc...), the info that @anothervariable pulls from the table is the name of that database but in all caps.  Does this part make a difference?
Also, what method could I use to get the database variable to read from that selected database?
 
Thank-you for your help.
 
Eric

View 3 Replies View Related

Changing Databases In An Stored Procedure

Aug 24, 1999

Hello all,

I have discovered that you cannot use the "USE" command in a stored procedure to change to another database.

Is there any way I can change to another database within a stored procedure besides calling another stored procedure on the database I want?

Thanks,

Nev.

View 1 Replies View Related

Stored Procedure To Loop Through Databases

Mar 16, 2015

We're running SQL Server 2008 and have run into a bit of a situation. We have 5 databases all with the same tables and we are trying to create a query that will loop through the different databases and output the results per company database. I originally did a cursor, but my boss wants the query to be in a more readable format:

His ideal wish would be the query in a stored procedure and the cursor to create the input parameter for the stored procedure for the different databases.I've tried looking through some forums and googling some possibilities but can't seem to make any sense of them.

declare @dbname varchar(100)
,@sql varchar(max)
createtable #TempDBs (
dbname nvarchar(100)
, Orig_Jnl int
, BaseRef int
, Posting_Date date

[code]....

View 7 Replies View Related

Distincts Databases On The Same Stored Procedure

Jun 28, 2006

Hi!

    I need to use two distincts databases on the same stored procedure. One, database1, is where I want to place the procedure, and where the table the procedure populates is (table1). The other, database2, hosts the table (table2) from where I select some data to put into table1 in database1.
    Database1 name is fixed, while database2 name may change. So, I would like to pass database2 name as a parameter to the procedure. In this simple example, it works fine:

use database1
go
create procedure teste @db_name varchar(10) as
exec ('select * from ' + @db_name + '.dbo.table2')

    But the problem is that in my procedure, database2 is used in a cursor, something like this:

create procedure myProcedure @year int, @pDatabase2 varchar(30) AS

declare ...

WHILE ...
BEGIN
  ... 
  declare cursor1 cursor for 
 select column1, column2 from @pDatabase2.dbo.table2
 where ...

  open cursor1
 fetch next from cursor1 into ...

  close cursor1
  deallocate cursor1
   
 -- insert data into table
 INSERT INTO table1
     VALUES...

....

    And I get an error if I try to use the exec! How can I do it? Can anyone help me please?

         Thank you!

View 4 Replies View Related

SQL 2012 :: Compare Two Similar Databases (A And B) Stored Procedure?

Dec 3, 2014

Is there any way to compare two similar databases (A & B) stored procedure. I have to find stored procedure in second database B with respect to the difference.

View 7 Replies View Related

Transact SQL :: Stored Procedure To Determine Which Databases To Restore?

Sep 27, 2015

I have 5 databases that the user will chose which ones to restore. I was thinking the variable with the 5 database names separated by commas. I was thinking about using the CONTAIN function but two of the databases have the same name except for a few letters at the end.

View 3 Replies View Related

Multiple Stored Procedure...or 1 Dynamic Procedure?

Jul 3, 2007

Ok, so i have this program, and at the moment, it generates an sql statement based on an array of db fields, and an array of values...

my question is this, is there any way to create a stored procedure that has multiple dynamic colums, where the amount of colums could change based on how many are in the array, and therefore passed by parameters...

if this is possible, is it then better the pass both columns and values as parameters, (some have over 50 columns)...or just create a seperate stored procedure for each scenario?? i have no worked out how many this could be, but there is 6 different arrays of colums, 3 possible methods (update, insert and select), and 2 options for each of those 24...so possibly upto 48 stored procs...

this post has just realised how deep in im getting. i might just leave it as it is, and have it done in my application...

but my original question stands, is there any way to add a dynamic colums to a stored proc, but there could be a different number of colums to update or insert into, depending on an array??

Cheers,
Justin

View 2 Replies View Related

Accessing Two Databases

Sep 16, 2006

Hi, I am developing a small asp.net  application where I read from a readonly omnis database via odbc then dependant on user input write records to a second database.My first idea was to use an odbc connection to Omnis database and write to ms sql database.  There is quite a few queries that need to be made to the Omnis database and I am binding a datagrid to the MS Sql server database.  I was hoping to use stored procedures to update the mssql tables.  So there will be much opening and closing of connections. Should I go down that road or should i think of using an Access database, with linked table to the Omnis database, then only one connection needs to be made.  And I can store my information in the Access database tables. Thanks.

View 3 Replies View Related

Accessing Two Databases At Once

Apr 12, 2006

I'm new to databases as you probably can tell. A friend sent me three data bases, which in my mind should have been one database with all the tables included, but he didn't. So my question is, can you pull info from two databases in the same query?

I write the query acessing one database and the result chart must depend on a where predicate based on accessing tables in another database. If this isn't possible, how do I get the tables I need together, that presently reside in differing databases?

Thanks for the help in advance.

Milfredo

View 8 Replies View Related

Execute Stored Procedure Y Asynchronously From Stored Proc X Using SQL Server 2000

Oct 14, 2007

I am calling a stored procedure (say X) and from that stored procedure (i mean X) i want to call another stored procedure (say Y)asynchoronoulsy. Once stored procedure X is completed then i want to return execution to main program. In background, Stored procedure Y will contiue his work. Please let me know how to do that using SQL Server 2000 and ASP.NET 2.

View 3 Replies View Related

Accessing 2 Databases On The SQL Server Through ASP.net

Nov 30, 2006

Hi everyone,
First of all I'd like to say I'm new to the forums, and in fact new to ASP.net.
I've had a couple of applications running in VB.net for the last year or so that I now am looking to move on and into ASP.net (main reason is to do with implementation to remote sites in foreign countries).
I'm currently following through the "Working with data and ASP.net 2.0" walkthrough on this site, which I must say has been a great help.
 I'll start with the background stuff first
I have my main database on an SQL server.  I also have 2 other databases on there - Customer and Employee.   The reason for these are that they are shared amongst my VB applications and I kept them as seperate databases so that one database is all that needs to be administered and maintained, and these changes are then seen on both apps (takes away redundant data as well).
In my main database, main table, is a field called CustomerID.  This value relates to the CustomerID in the Customer table.  In my VB app all I do is have the user select a customer name, and then the customer ID value is copied to the CustomerID field of my main table when inserting / updating a row.  This is simply accomplished with 2 SQL connections and 2 dataAdapters.  I also use 2 dataSets - one for Customer, one for WorkRequests (the main database)...
I use ComponentOne stuff so that my grid will show the CustomerName instead of the CustomerID etc, and the same applies when I use my Employee database - I run many dataAdapters to this for things such as Account Manager, Technologist, Creator, UpdatedBy etc etc.
Now, I'm new to VS 2005 - my apps were created in VS 2003 and .net 1.1.    Can I easily re-create my apps in ASP.net?  My primary goal at the moment is to make sure I can load a row, and display the "lookup" values instead of the "integer" value.  As my tables are in seperate databases, I would like to know the best way of accomplishing this, if it is of course possible.
Help and advice much appriciated.
Kind Regards,
Luke
 

View 2 Replies View Related

Accessing 6.5 Databases From 7.0 Admin?

Apr 10, 2002

hello,

i have a simple question and i am not familiar with sql7.

is it possible to access a sql server 6.5 from the admintools installed with sql 7.0

thanks
klaus

View 2 Replies View Related

Accessing SQL Server Databases From Networked PC

Jul 23, 2005

Hello all. I have just built another PC (New PC)and have it connected to myOriginal PC via a LAN. I have my SQL Server 2000 installed on the OriginalPC. Both PCs use WinXP Pro OS. I believe I now have to install the ClientTools on the New PC but after that, how do I access the SQL Server that ison the Original PC. The SQL Server is setup with mixed (both WindowsAuthentication and SQL Server Authentication). Just how do I use the SQLQuery Analyzer that I just installed on the New PC to connect to andretreive data from the SQL Databases which are on the Original PC? Thanksin advance for any help, Jim.

View 1 Replies View Related







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