set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[Toc_sp_GetStudentNetworkByUserInfoId] @UserInfoId INT AS BEGIN /* SELECT u.UserId, u.UserName FROM aspnet_Users u WHERE u.UserId IN(SELECT ui.UserId FROM TOC_UserInfo ui WHERE ui.UserInfoId IN(SELECT un.LinkedUserInfoId FROM TOC_UserNetwork un WHERE un.RelationshipTypeId=1 AND un.UserInfoId=@UserInfoId)); */ SELECT ui.UserId, u.UserName, ed.Major FROM TOC_UserEducationalDetails ed JOIN TOC_UserInfo ui ON ed.UserInfoId=ui.UserInfoId JOIN TOC_UserNetwork un ON ui.UserInfoId=un.LinkedUserInfoId JOIN aspnet_Users u ON ui.UserId=u.UserId WHERE un.RelationshipTypeId=1 AND un.UserInfoId=@UserInfoId; END SELECT TOP 3 u.UserName,ui.PictureURL,ud.UserDescription FROM TOC_UserInterestUpdateDetails ud JOIN TOC_UserInfo ui ON ud.UserInfoId=ui.UserInfoId JOIN aspnet_Users u ON ui.UserId=u.UserId ORDER BY ud.DateAdded DESC; SELECT TOP 3 u.UserName,ui.ThumbnailPictureURL,ud.UserDescription FROM TOC_UserInterestUpdateDetails ud JOIN TOC_UserInfo ui ON ud.UserInfoId=ui.UserInfoId JOIN aspnet_Users u ON ui.UserId=u.UserId JOIN aspnet_UsersInRoles aur ON aur.UserId=u.UserId JOIN aspnet_Roles ar ON ar.RoleId=aur.RoleId WHERE ar.RoleName='Corporator' ORDER BY ud.DateAdded DESC;
select clkp.CompanyName,clkp.CompanyLogoURL,clkp.CompanySiteURL,cd.LookingToConnect from TOC_CompanyLKP clkp join TOC_CompanyDetails cd on clkp.CompanyId = cd.CompanyId where clkp.CompanyId = 20;