Worst Practice - Bad Connection Strings and Bad Info in Sysprocesses

  • Rob Weston

    SSC Veteran

    Points: 237

    Can you do this with VBScript in asp pages as it seems to reflect good practice!

  • Andy Warren

    SSC Guru

    Points: 119676

    Sure. Pretty common to include the requesting IP address to make it more helpful.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • Igor Urdenko

    SSC Journeyman

    Points: 86

    Good idea! I am on the start point of the big databse project now and this will for sure save my time and will save me from a headache.

    Thank you.

    P.S. Where is possible to read about what parameters can we put into connection string? Because before I've read this article I had no idea about application name and some other parameters.


    To change the world find its source code...

  • Rayven

    SSCarpal Tunnel

    Points: 4337

    * BLUSH * Big Time!

    This is ripe coming from a DBA who still develops, but I'd often looked at the sysprocesses and wondered whether I could get the additional information to appear there - a severe case of RTFM!! Guilty as charged m'lud!

    Isn't is amazing how quickly I can now respond right down to the desk when there are problems by identifying the precise user causing locks and slow processes within seconds. Eveyone will soon think I'm spying on them (more than I do now anyway).

    Great artice, and an example of how a small change can make a huge impact.


    ---------------------------------------
    It is by caffeine alone I set my mind in motion.
    It is by the Beans of Java that thoughts acquire speed,
    the hands acquire shaking, the shaking becomes a warning.
    It is by caffeine alone I set my mind in motion.

  • David Burrows

    SSC Guru

    Points: 64493

    Good article Andy. My apps use common code for connection strings so adding this would be easy for me. As I do not have a large user base for my apps I track usage by workstation ID/database and a quick phone call usally identifies what the user is doing. Must admit though I have been using the app/page name addition in asp for some years (not to steal your thunder though!) and makes diagnosing easy but as already stated it will increase your connections from web server even with connection pooling.

    BTW I did read somewhere (can't remmeber where) that there were problems with switching on connection pooling with the later versions of MDAC which cause connection failure and network errors.

    Edited by - davidburrows on 08/01/2003 02:25:48 AM

    Far away is close at hand in the images of elsewhere.
    Anon.

  • JohnWatts

    SSC Enthusiast

    Points: 180

    My only complaint is that I needed you to write this article about a year ago!

    Oh well, such is life.

  • johnsonj

    SSCrazy

    Points: 2159

    I've always used the very minimum connection string in my applications, but I ran into the exact problem Andy was talking about -- I had an older version running and had to find it by trial and error. I will definitely be putting the extra info in all my future projects.

    Joe Johnson


    Joe Johnson
    NETDIO,LLC.

  • Brian McCool

    SSC Enthusiast

    Points: 143

    I've always given thought on how this could be done, but never followed through. This is definately going into our best practices documentation!

    Are there any other nifty things (clues) that can be added to the connection string that would show up in sysprocesses?

    Brian McCool

  • Frank Kalis

    SSC Guru

    Points: 111183

    Hi there,

    the following came right in

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q313295

    Thought I'd share it

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Andy Warren

    SSC Guru

    Points: 119676

    Not that I've thought of, but you could really stick any bit of data there that might help you troubleshoot. MDAC version? Client OS? Though you could log that stuff elsewhere, if something like that helps you run down a problem, try it.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • dforbes@quadtra.com

    Valued Member

    Points: 74

    Having often filled the role of developer in an organization, I find it somewhat offensive that you claim someone is a victim of a "baaaaad developer." If an organization is sophisticated enough to have a dba who monitors database activity from multiple applications, that organization should also have a clearly defined process around how to connect to their databases.

    Requirements of a project should include such information. The developer implements what is asked in those requirements.

  • Andy Warren

    SSC Guru

    Points: 119676

    Not trying to be offensive, though I think its semi-accepted practice for DBA's to complain about developers and vice versa. I'd like to think you're right that in large shops this would be part of the ground rules, not so sure. In any case, my hope is to get people to add it to their base requirements even if they are a 1-2 developer operation.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • bozo7

    Ten Centuries

    Points: 1278

    Not coming from a VB development shop, we use strictly Delphi, I am not familiar with defing the connection like that. You can do it Delphi but there is no reason to. I have noticed however when our research department pulls data into Access.

    This has never been a issue for us as we have several .udl files on our file server that the application reads it's connection info from at startup. This allows us to switch SQL Servers rapidly. If one server went down all I have to do is switch the connection properties in the .udl file and everyone is then using a backup server. This came in handy when we upgraded our server this spring.

    Ross

  • Andy Warren

    SSC Guru

    Points: 119676

    UDL's are ok, as are DSN's for that matter, both exist to let you easily edit connection strings. The downside is that they aren't secure if you're using a sql login/password. But that is another discussion!

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • TomT

    Right there with Babe

    Points: 747

    Very helpful article. I may have missed this in the thread, but I'm wondering if there's a way to get the workstation id from within an MS Access app?

    Thanks

Viewing 15 posts - 16 through 30 (of 37 total)

You must be logged in to reply to this topic. Login to reply