Tracking Activity
This script creates a table named [JFW]
.[TrackingActivity] in the [JFW_live]
database. The table is used to track user activity and store information such as user ID, device ID, tracking event ID, URL, IP address, operating system, browser name, browser version, request from mobile flag, user agent, location, latitude, longitude, description, modified by, modified date, created by, and created date.
Table Columns:
[ID]
: bigint, identity column, unique identifier for each tracking activity record[User_ID]
: bigint, foreign key referencing the[JFW]
.[User] table, identifies the user associated with the activity[Device_ID]
: bigint, foreign key referencing the devices table, identifies the device associated with the activity[Tracking_Event_ID]
: bigint, foreign key referencing the[JFW]
.[TrackingEvent] table, identifies the tracking event associated with the activity[URL]
: nvarchar(1000), the URL visited by the user[IP_Address]
: varchar(20), the IP address of the user[OS]
: nvarchar(50), the operating system of the user's device[Browser_Name]
: nvarchar(50), the name of the browser used by the user[Browser_Version]
: nvarchar(50), the version of the browser used by the user[Request_From_Mobile]
: bit, flag indicating whether the request was made from a mobile device[User_Agent]
: nvarchar(500), the user agent string of the user's device[Location]
: nvarchar(250), the location of the user[Latitude]
: float, the latitude coordinate of the user's location[Longitude]
: float, the longitude coordinate of the user's location[Description]
: nvarchar(1000), additional description or details about the activity[Modified_By]
: bigint, foreign key referencing the[JFW]
.[User] table, identifies the user who last modified the activity[Modified_Date]
: datetime, the date and time when the activity was last modified[Created_By]
: bigint, foreign key referencing the[JFW]
.[User] table, identifies the user who created the activity[Created_Date]
: datetime, the date and time when the activity was created
Table Constraints:
[PK_Activity]
: Primary key constraint on the[ID]
column[DF_Activity_RequestFromMobile]
: Default constraint on the[Request_From_Mobile]
column, sets the default value to 0[DF_Activity_ModifiedDate]
: Default constraint on the[Modified_Date]
column, sets the default value to the current UTC date and time[DF_Activity_CreatedDate]
: Default constraint on the[Created_Date]
column, sets the default value to the current UTC date and time[FK_TrackingActivity_TrackingEvent]
: Foreign key constraint on the[Tracking_Event_ID]
column, references the[JFW]
.[TrackingEvent] table[FK_TrackingActivity_UserID]
: Foreign key constraint on the[User_ID]
column, references the[JFW]
.[User] table
Last updated
Was this helpful?