I am trying to make notification system for my website:
This is the table structure
notification
-----------------
id (pk)
userid
notification_type (for complexity like notifications for pictures, videos, apps etc.)
notification
time
notificationsRead
--------------------
id (pk) (i dont think this field is required, anyways)
lasttime_read
userid
Now my understanding is that when a notification is added, we need to find the users friends and insert all those rows in the notification
table right ? If this is correct, then, what would be the best way to achieve this ?
- Triggers?
- Write T-SQL (sql query in server side) to Select all the friends and then use SQL bulk copy?