Complete User Tracking Solution Needed

Posted on 2005-04-18
Last Modified: 2010-03-19
I am implementing a user tracking system on our database tables that run a website. I need to track IP addresses, Host Names, User Name, times, transaction types, and any other things your experts can think of. Please proved function names and explanations of how to use them, or provide SQL to create functions that will track actions.

The functions I am already using are:


What I would really like is the IP address of the user. Any other tracking information/strategy is appriciated.
Question by:paulfryer
    LVL 11

    Accepted Solution

    this should probably have been posted in the EE section of the programming language you're using in your web pages (asp? jsp? php?).

    If you're using asp, there are some code samples of gathering that sort of data:

    LVL 1

    Author Comment

    I would prefer TSQL because the database is used by PHP, ASP, ColdFusion, ect.
    LVL 20

    Expert Comment

    I don't think you can do this in T-SQL... much of the data you want to track isn't natively available at the MSSQL level.  You will probably need to provide it to the DB code from the web page level.
    LVL 11

    Expert Comment

    JesterToo is right, per my previous post. SQL can't just go out and grab user data, that must come through a webapp programming languange.
    LVL 13

    Expert Comment

    why don't you integrate user tracking code right into your web apps..? this kind of activity should be handled by a web language and should not even be attempted at T-SQL level

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
    Via a live example, show how to shrink a transaction log file down to a reasonable size.

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now