Intercepting Connections Requests
May 13, 2008
Hello,
You help is very much appreciated.
I have an Intranet environment that contains tens of apps that use a specific database.
I want to create an Intranet test environment (which will use a test database), by basically copying the existing Intranet environment to a new location.
* I cannot change the connection strings in the applications level since each app stores it differently (some store it in Web.Config, some hard coded, etc....).
Then, have a layer that sits between the Intranet Apps and SQL SERVER (or inside SQL SERVER itself), that will intercept the connections requests.
Once intercepted, the code will check if the connection request comes from Intranet Test environemnt, and if so, change the connection string on the fly to point to the test database.
The question:
Is there a way in SQL SERVER 2005, to intercept connections, and then, based on the application that requested the connection, modify the connection on the fly (so that if the calling app is from test_Intranet – intercept the connection and change it to point to a test database, otherwise leave the connection as it is (live database).
Thank you,
Roy
View 2 Replies
ADVERTISEMENT
May 13, 2008
Hello,
You help is very much appreciated.
I have an Intranet environment that contains tens of apps that use a specific database.
I want to create an Intranet test environment (which will use a test database), by basically copying the existing Intranet environment to a new location.
* I cannot change the connection strings in the applications level since each app stores it differently (some store it in Web.Config, some hard coded, etc....).
Then, have a layer that sits between the Intranet Apps and SQL SERVER (or inside SQL SERVER itself), that will intercept the connections requests.
Once intercepted, the code will check if the connection request comes from Intranet Test environemnt, and if so, change the connection string on the fly to point to the test database.
The question:
Is there a way in SQL SERVER 2005, to intercept connections, and then, based on the application that requested the connection, modify the connection on the fly (so that if the calling app is from test_Intranet €“ intercept the connection and change it to point to a test database, otherwise leave the connection as it is (live database).
Thank you,
Roy
View 5 Replies
View Related
Apr 5, 2006
Folks,
I have been hunting for a way to trace sql requests going to/from the sql express server (from VS.2005 using asp.net). I.E., I want to see the raw SQL commands that asp.net is generating.
Can anyone point me to a tool or article? Thanks,
--stuart
View 1 Replies
View Related
Mar 27, 2008
Hi. I'm new to SQL Server programming. I'm using it at my new job for the first time and catching on quickly. I've run into a problem where I run a request via interactive query and it times out. It's really annoying because it seems to happy a lot. Is this just a memory issue with my machine (it has 2.8 GB of RAM) or there a way around it?
Thanks!
View 12 Replies
View Related
Jul 23, 2005
I'm monitoring one of our servers, and on the whole it is performingwell. However, I'm puzzled by the number of LockRequests/sec thatPerfmon is recording. We frequently see values exceeding 50,000 andthe current peak is 533,616 (the average, as I type this, is 35,102).There are only 40 users on the system.sp_lock shows nothing like this number of locks; it shows somethingof the order of 30 locks maximum for each execution, which seems farmore reasonable.SQL Profiler seems to back up the Perfmon values; it records hundredsof "Lock Acquired" events per second during these peak periods.For example:NO. OFLOCKS OBJECT STARTTIME===== ====== ======================678User_T2005-04-15 09:03:22.863931User_T2005-04-15 09:03:22.877924User_T2005-04-15 09:03:22.89316EnquiryUser_T2005-04-15 09:03:22.893961User_T2005-04-15 09:03:22.910820User_T2005-04-15 09:03:22.9234NULL2005-04-15 09:03:22.923828User_T2005-04-15 09:03:22.9404NULL2005-04-15 09:03:22.940734User_T2005-04-15 09:03:22.957Can anyone think why such a comparatively small system should generatethese numbers of locks? Why does sp_lock NOT show the same level oflocking?
View 4 Replies
View Related
Jun 21, 2005
May be it's too late, but I think this requests could be scheduled at least
View 145 Replies
View Related
Mar 21, 2008
Hi:
one production server DB is getting slower... (SQL2K sp4 ent)
1. dbcc checkdb(abc) with 0 errors
2. no blocking
3. no abnormal in sql log and event system log
4. only found one crypt32 auto update fail last night.
the Lock Requests/sec is kind high from 5400 to 15400 on 0.01 scale. max is from 57611 to 155411.
Could I increase the locks assigned to sql and what is the best way for it?
thanks
david
View 1 Replies
View Related
Sep 5, 2006
To any Microsoft SSIS developers reading this forum, some requests:
1) do NOT allow a package to run if it has "package configurations" enabled and one or more XML files with configurations cannot be found;
2) update the properties window with the properties read from the "package configurations";
3) allow relative paths in the "package configurations" locations (relative to the package location)
Thank you :-)
View 2 Replies
View Related
Nov 28, 2006
i have an aplication with any problems, the aplication is hang and in the log is
SQL Server has encountered 1 occurrence(s) of IO requests taking longer than 15 seconds to complete on file [d:Program FilesMicrosoft SQL ServerMSSQLdata empdb.mdf] in database [tempdb] (2). The OS file handle is 0x000003DC. The offset of the latest long IO is: 0x00000016930000 and the aplication log is
E R R: [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionWrite (WrapperWrite()). NUMERO -2147467259 FUENTE Microsoft OLE DB Provider for ODBC Drivers
can yu help me
View 4 Replies
View Related
May 17, 2007
I have a scenario where we want something like a message bus. We can have multiple clients sending in events and would like a way to
i) persist those events
ii) Send out the notifications to the subcribers (this would be some C# services)
What is the best way to do this? I know that we can build something from scratch using WCF Publish-Subscribe. But i was interested in knowing if I can leverage SQL Service Broker to do the work.
View 8 Replies
View Related
Feb 13, 2007
Hi,
One of my client want to shift his reporting to SSRS. He wants to submit his report requests to SSRS. He wants the report should run at the reporting server side (not on client system) and output should be exported to a folder on server.
I am some what successful in submitting the report requests using subscriptions. But I have no idea to retrieve the requests from SSRS with the execution status.
I have to display all submitted reprot requests with execution status (success or fail) in a data grid and user selects one report to see the out file. Where can I get this information?
And how can I create a subscription that runs immediatly after submission. (without any delay)?
Help me please!!!
Thanks in advance, Gouri Sankar
View 4 Replies
View Related
Feb 2, 2007
Hello, I have a bit of a problem. Some of my pages has way to many database requests, some pages upto 70 requests,and the loading time can be all the way up to 12seconds because of the many requests. So i am trying to optimize it abit.What i want to know if how to send several ID's to the database and collect the result from all of the ID's, i have a stored procedure like this:
public DataTable User_GetUsernameTypeTwo(string strUsername){OpenDBCon();mCom.Parameters.Clear();mCom.CommandText = "Profile_GetUsernameTypeTwo";mCom.Parameters.Add(new SqlParameter("@UserName", SqlDbType.NVarChar, 20));mCom.Parameters["@UserName"].Value = strUsername;myAdap = new SqlDataAdapter();myTable = new DataTable();myAdap.SelectCommand = mCom;myAdap.Fill(myTable);CloseDBCon();return myTable;}
To this i send a username and in return i get info about the user that then is presented on the page. If i have a gridview on the page with 20 posts, then it needs to make 20 requests to this file in order to collect all the info for all the users. Then i have one just like the one above that collects the photos of all the users. So my first thought was that i merge these two together, witch works perfect, reduces the database calls by around 40%. Then i thought, perhaps can i get all the info from all the users in 1 request, to reduce the load on the database even more, my problem is: How can i rewrite the one above to accept lets say 50 usernames (1 username can max have 20characters), and return the info from all of them. Since i use a stored procedure i cant with ease use WHILE (username = xxx) AND (username = yyy) AND (username = ccc), then i would have to add 50 Parameters and add each username to a seperate parameter and then look if the parameter is null or if it contains a username. So i need to find another way to send the usernames, so the sqlserver can add them to the where clause, perhpas using IN?
This is the sql server store procedure (it works perfect, when its one user i am requesting info about), i am using FULL OUTER JOIN because ALL fields i request can be NULL:
ALTER PROCEDURE [dbo].[Profile_GetUserpopupInfo] -- Add the parameters for the stored procedure here@UserName nvarchar(20)ASBEGIN-- SET NOCOUNT ON added to prevent extra result sets from-- interfering with SELECT statements.SET NOCOUNT ON;SELECT settings_username.color, settings_username.pic1, settings_username.pic2, profile_profilephoto.imageurl, profile_profilephoto.alttext FROM settings_username FULL OUTER JOIN profile_profilephoto ON profile_profilephoto.username = settings_username.username AND (profile_profilephoto.approved = 1) WHERE (settings_username.username = @UserName)END
Anyone got any idea of how to send a bunch of usernames to this stored proc? (it must be efficient since there is alot of users)
Patrick
View 1 Replies
View Related
Mar 30, 2007
We are experiencing a situation where the SRS (2000 SP2) report server will no longer render reports. In the log file, there are many instances of
w3wp!runningjobs!434!3/23/2007-10:12:57:: i INFO: Adding: 8 running jobs to the databasew3wp!runningjobs!434!3/23/2007-10:13:57:: i INFO: RunningJobContext.IsClientConnected; found orphaned requestw3wp!runningjobs!434!3/23/2007-10:13:57:: i INFO: RunningJobContext.IsExpired; found expired requestw3wp!runningjobs!434!3/23/2007-10:13:57:: i INFO: RunningJobContext.IsExpired; found expired requestw3wp!runningjobs!434!3/23/2007-10:13:57:: i INFO: RunningJobContext.IsExpired; found expired requestw3wp!runningjobs!434!3/23/2007-10:13:57:: i INFO: RunningJobContext.IsClientConnected; found orphaned requestw3wp!runningjobs!434!3/23/2007-10:13:57:: i INFO: RunningJobContext.IsClientConnected; found orphaned requestw3wp!runningjobs!434!3/23/2007-10:13:57:: i INFO: RunningJobContext.IsExpired; found expired requestw3wp!runningjobs!434!3/23/2007-10:14:57:: i INFO: RunningJobContext.IsClientConnected; found orphaned requestw3wp!runningjobs!434!3/23/2007-10:14:57:: i INFO: RunningJobContext.IsExpired; found expired requestw3wp!runningjobs!434!3/23/2007-10:14:57:: i INFO: RunningJobContext.IsExpired; found expired requestw3wp!runningjobs!434!3/23/2007-10:14:57:: i INFO: RunningJobContext.IsExpired; found expired requestw3wp!runningjobs!434!3/23/2007-10:14:57:: i INFO: RunningJobContext.IsClientConnected; found orphaned requestw3wp!runningjobs!434!3/23/2007-10:14:57:: i INFO: RunningJobContext.IsClientConnected; found orphaned requestw3wp!runningjobs!434!3/23/2007-10:14:57:: i INFO: RunningJobContext.IsExpired; found expired request
What could be causing this? The reports are making queries through an OLE DB provider. There are no scheduled jobs, and the load doesn't seem that heavy.
View 1 Replies
View Related
Sep 29, 2005
I have an application that calculates a bunch of numbers and then inserts them into a table (or updates a record in the table if it exists). In my test environment it is issuing 100 insert or update requests to the server per second and it could run for several hours.After a the first several hundred requests, the SQL server is bogging down (processor at 90-100%) and the application slows down while it waits on SQL to update the database.What would be the best way to optimize this app? Would it help to loop through all my insert/update requests and then send them as one big batch of statements to the server (per 1000 requests or something)? Is there a better way of doing this?Thanks!
View 1 Replies
View Related
Feb 14, 2006
Hello,
I have been working as Sybase DBA for 5+ years, and I would very much like to add MS SQL Server to my resume. Given the common roots of the two RDBMS, it seems that the learning curve would not be as sharp as if I were going to learn Oracle or DB2. Can anyone out there know of any books that are geared toward learning MS SQL Server from a Sybase DBAs perspective?
Thank you,
- Chris Merz
View 3 Replies
View Related
Jun 5, 2007
Hi,
I want to know how to assign a normal user to take backup,Restore and attach and detach the database in sqlserver2000.
Please can anyone help me to find out which server role or database role will suites my requirements.
Regards
Md S.Hassan
View 1 Replies
View Related
Jan 27, 2015
For Bulk Load requests in SQL server, Are there any specific profiler event? Like the one we have for RPC RPC:Starting and for Batch Requests, we have SQL:BatchStarting.
Are Bulk Load requests that are being monitored through Profiler captured as SQL:Batch... events at the backend?
Are there any new features added in 2012 or 2014 to identify a Bulk request submitted through bcp.exe utility or any other sqlbulkcopy program?
View 1 Replies
View Related
Jul 31, 2013
Working on this issue ... SSIS package trying to load data from DB2 to SQL ....
IBM OLE DB Provider for DB2"
Hresult: 0x8004D01C
Description: " SQL1224N The database manager is not able to accept new requests, has terminated all requests in
progress, or has terminated the specified request because of an error or a forced interrupt. SQLSTATE=55032
SSIS Error Code DTS_E_PRIMEOUTPUTFAILED -
The PrimeOutput method on component "OLE DB Source" (1)
returned error code 0xC0202009. The component returned a failure code when the pipeline engine called PrimeOutput().
The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.
View 2 Replies
View Related
Oct 8, 2015
some times i need to take db in single user mode , which can be done using following
ALTER DATABASE xyz
SETÂ SINGLE_USER WITH NO_WAIT
this has other options but each one has some problems like if any single window is open at any location etc etc.
Q1)so the need is i want to honor running transaction from msss or any application then i want db to get into single mode so that i can perform my task.
Q2) some times i need to restart db as it becomes slow , i am trying to find the reason primarily i have seen it is memory.so i want to restart my db honoring all requests.
View 6 Replies
View Related
Sep 13, 2007
Hello,
I see the following error on the sql server log of one of our sql servers running sql 2000 with sp4.
SQL Server has encountered 1964 occurrence(s) of IO requests taking longer than 15 seconds to complete on file [h: empdb.mdf] in database [tempdb] (2). The OS file handle is 0x00000534. The offset of the latest long IO is: 0x0000002b09e000
Any idea as to what might be causing this error. Appreciate any comments.
Thanks!
View 3 Replies
View Related
May 17, 2005
Hi there,
Here we have got a
asp.net application that was developed when database was
sitting on SQL server 6.5. Now client has moved all of their databases
to SQL server 2000. When the database was on 6.5 the previous
development team has used oledb connections all over. As the databases
have been moved to SQL server 2000 now i am in process of changing the
database connection part. As part of the process i have a login
authorization code.
Private Function Authenticate(ByVal username As String, ByVal password As String, ByRef results As NorisSetupLib.AuthorizationResult) As Boolean
Dim conn As IDbConnection = GetConnection()
Try
Dim cmd As IDbCommand = conn.CreateCommand()
Dim sql As String = "EDSConfirmUpdate" '"EDSConfirmUpdate""PswdConfirmation"
'Dim cmd As SqlCommand = New SqlCommand("sql", conn)
cmd.CommandText = sql
cmd.CommandType = CommandType.StoredProcedure
NorisHelpers.DBHelpers.AddParam(cmd, "@logon", username)
NorisHelpers.DBHelpers.AddParam(cmd, "@password", password)
conn.Open()
'Get string for return values
Dim ReturnValue As String = cmd.ExecuteScalar.ToString
'Split string into array
Dim Values() As String = ReturnValue.Split(";~".ToCharArray)
'If the return code is CONTINUE, all is well. Otherwise, collect the
'reason why the result failed and let the user know
If Values(0) = "CONTINUE" Then
Return True
Else
results.Result = Values(0)
'Make sure there is a message being returned
If Values.Length > 1 Then
results.Message = Values(2)
End If
Return False
End If
Catch ex As Exception
Throw ex
Finally
If (Not conn Is Nothing AndAlso conn.State = ConnectionState.Open) Then
conn.Close()
End If
End Try
End Function
''' -----------------------------------------------------------------------------
''' <summary>
''' Getting the Connection from the config file
''' </summary>
''' <returns>A connection object</returns>
''' <remarks>
''' This is the same for all of the data classes.
''' Reads a specific
connection string from the web.config file for the service, creates a
connection object and returns it as an IDbConnection.
''' </remarks>
''' -----------------------------------------------------------------------------
Private Function GetConnection() As IDbConnection
'Dim conn As IDbConnection = New System.Data.OleDb.OleDbConnection
Dim conn As IDbConnection = New System.Data.SqlClient.SqlConnection
conn.ConnectionString = NorisHelpers.DBHelpers.GetConnectionString(NorisHelpers.DBHelpers.COMMON)
Return conn
End Function
in the above GetConnection() method i
have commented out the .net dataprovider for oledb and changed it to
.net dataprovider for SQLconnection. this function works fine. But in
the authenticate method above at the line
Dim ReturnValue As String = cmd.ExecuteScalar.ToString
for some reason its throwing the below error.
Run-time exception thrown : System.Data.SqlClient.SqlException - @password is not a parameter for procedure EDSConfirmUpdate.
If i comment out the
Dim conn As IDbConnection = New System.Data.SqlClient.SqlConnection
and uncomment the .net oledb provider,
Dim conn As IDbConnection = New System.Data.OleDb.OleDbConnection
then it works fine.
I also have changed the webconfig file as below.
<!--<add
key="Common" value='User ID=**secret**;pwd=**secret**;Data
Source="ESMALLDB2K";Initial Catalog=cj_common;Auto
Translate=True;Persist Security Info=False;Provider="SQLOLEDB.1";'
/>-->
<add key="Common" value='User ID=**secret**;pwd=**secret**;Data Source="ESMALLDB2K";Initial Catalog=cj_common;' />
Please help. Thanks in advance.
View 4 Replies
View Related
Oct 15, 2007
I have created a local user on Report Server Computer and the user has the administrative rights.
When i try to connect Report Server (http://xxx.xxx.xxx.xxx/reportserver) with this user's credantials. (ReportServer directory security is set -only- to Basic Authentication. ).
I get the following error.
Reporting Services Error
--------------------------------------------------------------------------------
The number of requests for "XXXServerXXXUser" has exceeded the maximum number allowed for a single user.
--------------------------------------------------------------------------------
SQL Server Reporting Services
Then i try to login using a different user with administrative rights on the machine, i can logon successfully.
The system is up for a month but this problem occured today?!? What could be the problem?!?
View 2 Replies
View Related
Jul 20, 2005
Just a quick question about connection management. My application willnever need more than 1 or 2 connections about at any given time. Also, I donot expect many users to be connected at any given time. For efficiency, Iwould like to keep connections alive throughout the lifetime of the objectsrequiring them, rather than opening a new connection, executing code andthen closing it again. What is the most efficient way of doing this?Should I perform the open/close or just one open when I create the objectand a close when I dispose of it?
View 1 Replies
View Related
Dec 27, 2007
Hi I have some simple questions of for MS SQL. Say I have a database with a table Called Company. In this table I have Employee's with these columns(EmployeeID<PK>, FirstName, LastName) Now I am inserting some data like this.EmployeeID FirstName, LastName------------------------------------------------------- 1 Bob Smith2 Joe Mitter Now Say I have this situation(this will look weird for this example but for another examples and the stuff I am working on it make sense). Say I have a new Employee Called Jessica White. Jessica must be the second record. So I need to insert it between the 1st and 2nd record. Like I said I am very noob at doing this stuff so I am not sure how I would do it. I first was going to my table and then went to modify. This brought up a blank grid with all my column names. I then started to add all my data in. I found out later to make my life easier I need to enter in certain spots null rows in it to help with formating(otherwise I would have had to figure out a way to do make null rows with c# code). I then went back to this grid and I tried to add a record before the data just like you if you used excel. I quickly found out you can not do that. This resulted me having to recreate the table and reput the all the data back in(this told me I was doing something very very wrong). I was then thinking of writing it with a query and I been playing around with it and still running into problems like say I had a table called test with a coloum called id<PK> and testss(yes bad names just playing around though).So if I did something like this:INSERT INTO testVALUES(2)INSERT INTO testVALUES(1)SELECT * FROM testNow I am trying to figure out how to insert something between rows 1 and 2. Would I have to drop the table or delete all the data and then run a saved copy of my script with the added change or what?My second question is what is a good site that has examples of all the commands(I don't want to read a book on it I have had a oracle sql course and well it was just boring and I did not learn too much.). I think the best way for me to learn is just continue doing my site and picking it up on the file and when I got a problem read about it and ask on the forums. Thanks
View 11 Replies
View Related
Jul 13, 2001
Very strange event. Installed new machine into NT 4 network, which has a PDC and a BDC. We have copies of all SQL databases on both the PDC and the BDC. I installed SQL 7 on new workstation. Throught Control Panel/ODBC connections I can reach the SQL files on bith the PDC and BDC. Howver when I try to use Enterprise Manager, I can connect to the tables on the PDC, but not the BDC. SQL lists both machines in the server group, but only allows me to access tables on PDC! Here is the Event information that I recived on the BDC:
The computer IVR1 tried to connect to the server NTBACKUPSERVER using the trust relationship established by the MASSCOM domain. However, the computer lost the correct security identifier (SID) when the domain was reconfigured.
How do I fix this?
View 2 Replies
View Related
Apr 14, 2000
HI all,
I have a problem here. I am having two computers both are loaded windows NT 4.0 AND SERVICE PACK 4 AND ALSO I INSTALLED SQL SERVER 7.0.
Now i want to connect those two servers , so pls anyone suggest me how i have to do.I connected both servers thru HUB.
Pls suggest me..
thank u..
--ram
View 1 Replies
View Related
Oct 9, 1998
I figure anyone who has done VB and SQL Server might have run into this.
>
> I am set up as a DBO on SQL Server with access to db1 and db2. My default
> is set to db2. From my local machine, I can log through VB(DSN-less) in
> to
> either one without a problem. BUT, if I go to another machine and try to
> log in through VB(DSN-less) to db1, it rejects my login. Here is my
> connect
> string :
>
> UID=xxxxxxx;PWD=pedro;DATABASE=db2;DRIVER={SQL
> Server};SERVER=Athens;DSN=``;
>
> The only thing that changes when I log into db1 is the database parameter-
> "DATABASE=db1".
>
> Am I doing something wrong here? Is there something that needs to be
> setup
> differently in SQL Server? Do I need to put something else into the
> connect
> string?
>
> This happens for the other developers as well, not just me.
>
> Any help would be GREATLY appreciated.
View 2 Replies
View Related
Apr 12, 2001
I am looking for some ideas on the following DTS challenge: I need to import the data from an Access 97 database into a set of tables(about 25). The location of the database can be anywhere on the users drive(s) and I will need to get the location of the database from a registry setting and use it to define the connection.
Thanks
View 1 Replies
View Related
Jun 11, 2004
We have a case where a user is using Excel sheet to connect the database on SQL2K and generally his connection runs in the upper 150 in numbers. He generally gets more than 150 connections open.
I know that it's not a good thing, but is there a way to limit it or even kill it after it reaches max?
What are the disadvantages of opening too many connections?
View 1 Replies
View Related
Sep 7, 2006
I'm getting the classic message "The timeout period elapsed prior to obtaining a connection from the pool" etc when connecting to my SQL Server 2005 Express from a .Net application.
Then I try connecting, simultaneously, from a simple ASP.net thing I wrote just for testing and this works fine. So, then the connection pool can't be full, can it? Or, does each application have its own pool??
View 6 Replies
View Related
Apr 16, 2004
Ok, yeah, I'm being lazy...
Any comments?
View 8 Replies
View Related
Feb 9, 2006
Hi
I have heard that SQL Server can support upto 10,000 users,
What if my application , connects to the sql & does not do antything then , why does the SQL server slow down with just 700 users.
I mean just the connection is established & NOTHING further is done.
Thanks
View 6 Replies
View Related
Nov 29, 2007
hi,
have been looking for ages for somewhere that might be able to answer my question so thought i'd try here.
anyhows, my place of work have goldmine 6.7 running on a server. the problem is that some of the client machines seem to be taking 2 connections to the server when logged into goldmine and some only 1.
when looking at the open sessions it shows a second for some users accessing pipesqlquery. all users show this but only some show it as a second connection.
please any ideas
View 5 Replies
View Related