What is the best method of storing the Data Source for a global stored procedure to a database

I have a web app, and want to use the same web app for all, but pointing different users to different databases.  For example, when I have a company sign-up to use the web app, I will be creating a new sql database, and then want to feed the Data Source code into the SQL String when they sign in, pointing them to this new database.  I am considering using a Session Variable since the session variable is left at the server.  Is that a good way to do it?

What I expect to do is this.  Have a master database that keeps the a company, users, and their Datasource in a table.  When they login, code will look up their DataSource.  I will place this Datasource into a Session Variable, and then use the DataSource information stored in the Session variable for all Database calls since their won't be a performance hit.

Anything wrong with this approach?

Thanks

0
JAYHAWKER
5/1/2009 12:48:42 PM
asp.net.state-management 8807 articles. 0 followers. Follow

1 Replies
1073 Views

Similar Articles

[PageSpeed] 59

I think that this approach should work OK, and I have actually used a similar model before, with a primary "master" database being the only connection string in the application.  You might want to think about how you secure the secondary connections.


Andrew
blog.andrewrivers.co.uk
0
wildmoose
5/1/2009 4:07:28 PM
Reply:

Similar Artilces:

Oracle Stored Procedure as Data Source
Using: Windows 2000 SP3 PowerBuilder 8.0.3 Build 9704, JDBC Database Connection JVM.dll is coming from D:\Program Files\Sybase\Shared\jdk1.2.2\jre\bin\classic CLASSES12.zip is coming from D:\Oracle\ora81\jdbc\lib When attempting to create a dw from an Oracle stored procedure source, the lower portion of the create dw wizard displays the following: "Procedure SP_SECURITY " with no source following. Under the hood (via network analyzer), we see that a SELECT statement is sent to the Oracle database requesting the source of our sel...

Calling a stored procedure inside another stored procedure (or "nested stored procedures")
Hi all - I'm trying to optimized my stored procedures to be a bit easier to maintain, and am sure this is possible, not am very unclear on the syntax to doing this correctly.  For example, I have a simple stored procedure that takes a string as a parameter, and returns its resolved index that corresponds to a record in my database. ie exec dbo.DeriveStatusID 'Created' returns an int value as 1 (performed by "SELECT statusID FROM statusList WHERE statusName= 'Created')  but I also have a second stored procedure that needs to make reference to&n...

storing data on temperory basis before storing in database
i want the user to be able to add list of members from a database storing all the eligable people  and viewd on another control..i did it by creating two gridviews and when one is selected from the first it is added to the second,,,directly..... but that is not what i am required to do....i want the user to select users and see them on the control below (by control a mean a grid view or a tablular entity but the grid view can only display the data to the datasource)...and once the submit button is clicked then the data chosen should be copied to the database...i thought about creating ...

Using ADO.NET Execute Second Stored Procedure Depending of Output of First Stored Procedure
When a user logs onto the app, I capture their UserId, today's date and thier WINNT using ADO.NET calling a stored procedue-no problem. Now, once the above mention fields have been populated, when the same user logs on again and this time click their daily attendance time, I need to execute and update stored procedure-no problem. Each time the user logs onto the attendance page, they need to be able to view the previuos time stamps, on page load.- no problem The problem is that I cannot get all three to work in concert, although they will work independently, somewhat. Sotred proc...

How to store a Stored Procedure
Hello, I'm using an ADOStoredProcedure to connect to an access 'mdb' database. In access, no matter what I try, I cannot find out how to actually write the stored procedure itself. I have tried adding a query and a module. When using c++ to list the stored procedures available in the mdb file, none show up. All I want to do is increment a field by +x+, when the ID of a record is passed. Ideally, I'd like to be able to send the new value back to the c++ program after the increment, so I can update my listview. Thanks in advance for any help/advice. James On 9/15/12...

Execute stored procedure from stored procedure
Hello,i need to execute a stored procedure from another stored procedure. For example:StoredProcedure1: Returns a table with columns "year" and "value".StoredProcedure2: Also returns a table with columns "year" and "value".In Stored Procedure3: I would like to use the results from StoredProcedure1 and StoredProcedure2 and join them. Can somebody give me an example how to execute a stored procedure from another one and use the result table for a new command?Kind regards and thanks,carsaw hi,first off all let me clarify here - you cannot return ta...

Calling a Stored Procedure from a Stored Procedure
Can you do this? I have a sp that returns a list of eligible accounts and then I use that list in other sp but I don't want to keep copying the code, I would like to be able to use it as a sub query in other sp but I don't know if this is possible or what the syntax would be. Thanks, Aaron You cannot do that directly. You can: 1. Use User defined functions which can return a resultset 2. Use a local #temp table which can hold the resultset of the called stored procedure and use this #temp table in your subsequent processing INSERT #tempTable EXEC s...

calling a stored procedure from a stored procedure
Hi Group! I'm on ASA 8.02 Build 4411 writing sprocs in WATCOM SQL. I have a sproc which breaks a given string-parameter into pieces. It's result set contains the pieces, e.g. last line of sproc: "select item from mytable;". This sproc works fine. Now I need to call this procedure from another procedure which has a variable result set. I tried the following: <snip... set ll_retval = 0; call sp_breakstring(as_bzp,','); BreakLoop: while ll_retval <> 100 and not ll_retval < 0 loop set li_zaehler = li_zaehler + 1; fetch next sp_breakstrin...

How to write a stored procedure to copy the data from one database to another database
 I want to copy the data from one database to another database every 12 hrs.(This is variable). Say for example I have 3 applications and I want to copy the data from Parentdatabase1 and insert into CopyofParentdatabase1 for every 6 hrsParentdatabase2 and insert into CopyofParentdatabase2 for every 8 hrsParentdatabase3 and insert into CopyofParentdatabase3 for every 12 hrsI have heard that we can do this by using SQL Server Integration Services but as of now we cannot use SSIS. So I want to do this using Stored procedures. Is there a way to schedule the batch job for to run all these st...

Best method for storing data
I have a situation where I need to store an array of bytes. What would be the best SQL datatype for that? It is a fixed length of three.Cheers, Kevin...

stored procedure data source
hello when i try to create a dw based on a stored procedure as the datasoure( in PB 7.0), i'm not getting any of the the procedures in the "select stored procedure" selection window, why is this so? i've all the sp_pb70.. procedures available in the sybsystemprocs and able to open the procedure from within the PB database painter. i'm able to create the same in PB 8.0 pl. help thanks in advance anu ...

stored procedure as data source
My stored procedure consists of OPEN cursor for SELECT ......... FROM ( SELECT ....... FROM (SELECT ...... FROM ...... UNION SELECT ..... FROM.....) GROUP BY .... ) table1, table2 ORDER BY..... ; The nested SELECT works as stand-alone SQL and returns rows correctly. When placed in the stored procedure to be used as a data source for ...

Stored Procedure as Data Source
Hi- I am attempting my first datawindow using an Oracle stored procedure as the datasource. I have as of yet been unable to make it work. I would appreciate anybody that has used an Oracle stored procedure linked to a datawindow to possibly e-mail me any source procedure they have as well as steps to link the two. My problem seems to lie either in my IN/OUT parameters or my steps in PowerBuilder to link it. When I go to the painter in a new datawindow and choose my procedure out of the listing, I don't see anywhere to choose the columns I want. I am also confused with the m...

Stored procedure data source...
I would like to use an ASE informational stored procedure as the data source for a datawindow. The stored procedure is "sp_showplan <spid>, null, null, null". How can I make this happen ? Thanks in advance. -Wally Since I didn't get any comments on the previous post I'll try to give a little more info... The output from sp_showplan does not come from a standard "select" statement. I have successfully created other datawindows with a stored procedure as the datasource. Has anyone had any luck with building a datawindow with one of t...

Web resources about - What is the best method of storing the Data Source for a global stored procedure to a database - asp.net.state-management

Parliamentary procedure - Wikipedia, the free encyclopedia
... of the House of Commons of the Parliament of the United Kingdom , from which it derives its name. In the United States, parliamentary procedure ...

Procedure is more a snap than a snip
A QUEENSLAND doctor is bidding to set an unusual world record by performing the highest number of vasectomies in one day, with the help of fellow ...

Rushed cosmetic procedures a 'recipe for disaster'
&#8203;When Chanelle O'Hare went searching online for a deal on potential cosmetic procedures, she could not have imagined that what she ended ...

Jetstar procedures under investigation after planes took off too heavy
Jetstar's procedures for calculating the weight of its aircraft are under review by the Australian Transport Safety Bureau after two of its planes ...

Old Lady Lawyer: Uncivil Procedure
What is some of the worst behavior you've witnesses by attorneys?

NFL Announces Changes to Officiating Procedures for Playoffs - Bleacher Report
The NFL formally approved changes to its postseason officiating procedures to allow referees the opportunity to consult Vice President of Officiating ...

We need to reform the culture of law enforcement, not just the procedures
We need to reform the culture of law enforcement, not just the procedures by digby I have a new piece up at Salon this morning about police ...

Will Paul Ryan Make His Mark As Speaker By Instituting Impeachment Procedures Against President Obama ...
Wisconsin Ayn Rand devotee Paul Ryan just started his new job as Speaker of the dysfunctional House Republicans. And he's already headed for ...

Catholic hospital allowed to deny sterilization procedure, judge says
Hospital in California argued that the procedure known as ‚Äčtubal ligation would violate its religious freedom

TSA Updates Screening Procedure, Will Mandate Some Passengers Use Full-Body Scanners
... Imaging Technologies, or AIT, in favor of full-body pat-downs by TSA agents. Under the new mandate, not everyone can opt for the pat-down procedure. ...

Resources last updated: 1/18/2016 3:54:37 AM