Click here to Skip to main content
15,888,527 members
Home / Discussions / Database
   

Database

 
AnswerRe: Send E-mail at particular Interval Pin
Garth J Lancaster6-Apr-10 0:01
professionalGarth J Lancaster6-Apr-10 0:01 
GeneralRe: Send E-mail at particular Interval Pin
sumit70346-Apr-10 0:17
sumit70346-Apr-10 0:17 
GeneralRe: Send E-mail at particular Interval Pin
Garth J Lancaster6-Apr-10 0:35
professionalGarth J Lancaster6-Apr-10 0:35 
GeneralRe: Send E-mail at particular Interval Pin
sumit70346-Apr-10 1:00
sumit70346-Apr-10 1:00 
GeneralRe: Send E-mail at particular Interval Pin
Mycroft Holmes6-Apr-10 1:06
professionalMycroft Holmes6-Apr-10 1:06 
GeneralRe: Send E-mail at particular Interval Pin
sumit70346-Apr-10 1:31
sumit70346-Apr-10 1:31 
GeneralRe: Send E-mail at particular Interval Pin
Mycroft Holmes6-Apr-10 2:11
professionalMycroft Holmes6-Apr-10 2:11 
QuestionNeed last bit of help with a view being built Pin
Michael J. Eber5-Apr-10 13:40
Michael J. Eber5-Apr-10 13:40 
I have to construct a view to feed a 3rd party application.

On the application database they have a boolean field CanAccess which is a blanket item for access to any location.
On the master database where I'm building my view, the contact has a LocationAccess table containing access rights for each explicite location.

What I need in my view is a way of returning something like Count(select * from LocationAccess) > 0 for each contact I'm running through. Here is what I've got so far. If anyone can suggest how I add this last item I'd greatly appreciate it!
(BTW - yes the orderby is required and thus the TOP 100% is also required)

SELECT     TOP (100) PERCENT dbo.CustomerMaster.BSACustomerKey, dbo.ContactMaster.ContactName, dbo.ContactMaster.BusinessPhone, dbo.ContactMaster.MobilePhone, 
                      dbo.ContactMaster.Email, dbo.ContactMaster.FirstName, dbo.ContactMaster.LastName, dbo.ContactMaster.EmergencyMaintenance, 
                      dbo.ContactMaster.NormalMaintenance, dbo.ContactMaster.NetworkAbuse, dbo.ContactMaster.IssuedSwipeCard, dbo.ContactMaster.CardNumber, 
                      dbo.AddressList.CustomerAddressLine1, dbo.AddressList.CustomerAddressLine2, dbo.AddressList.CustomerAddressLine3, dbo.AddressList.CustomerPostBox, 
                      dbo.CityEnumerator.City, dbo.StateEnumerator.State, dbo.AddressList.CustomerCounty, dbo.AddressList.CustomerCountry, dbo.AddressList.CustomerZipcode, 
                      dbo.ContactMaster.BmcCustKey, CASE WHEN dbo.ContactMaster.Role = 1 THEN 1 ELSE 0 END AS IsAdministrator, 
                      CASE WHEN dbo.ContactMaster.Role = 6 THEN 1 ELSE 0 END AS IsDecisionMaker, 
                      CASE WHEN dbo.ContactMaster.Role = 5 THEN 1 ELSE 0 END AS IsAccountingAP
FROM         dbo.ContactMaster INNER JOIN
                      dbo.CustomerMaster ON dbo.ContactMaster.CompanyID = dbo.CustomerMaster.CustomerIdentity LEFT OUTER JOIN
                      dbo.AddressList ON dbo.ContactMaster.ContactAddress = dbo.AddressList.AddressIdentity LEFT OUTER JOIN
                      dbo.CityEnumerator ON dbo.AddressList.CustomerCity = dbo.CityEnumerator.CityIdentity LEFT OUTER JOIN
                      dbo.StateEnumerator ON dbo.AddressList.CustomerStateorProvince = dbo.StateEnumerator.StateIdentity
WHERE     (dbo.CustomerMaster.CustomerStatus = 1) AND (dbo.ContactMaster.Status = 1)
ORDER BY dbo.CustomerMaster.BSACustomerKey

AnswerRe: Need last bit of help with a view being built Pin
Mycroft Holmes5-Apr-10 16:18
professionalMycroft Holmes5-Apr-10 16:18 
GeneralRe: Need last bit of help with a view being built Pin
Michael J. Eber5-Apr-10 19:43
Michael J. Eber5-Apr-10 19:43 
GeneralRe: Need last bit of help with a view being built Pin
Mycroft Holmes5-Apr-10 19:53
professionalMycroft Holmes5-Apr-10 19:53 
QuestionHow To fetch records from xlsheet Pin
raghvendrapanda5-Apr-10 1:53
raghvendrapanda5-Apr-10 1:53 
AnswerRe: How To fetch records from xlsheet Pin
Eddy Vluggen5-Apr-10 22:08
professionalEddy Vluggen5-Apr-10 22:08 
QuestionUndo Restore in Sql 2005 Pin
Abdul Rahman Hamidy4-Apr-10 19:34
Abdul Rahman Hamidy4-Apr-10 19:34 
AnswerRe: Undo Restore in Sql 2005 Pin
Mycroft Holmes5-Apr-10 1:36
professionalMycroft Holmes5-Apr-10 1:36 
AnswerRe: Undo Restore in Sql 2005 Pin
T21026-Apr-10 14:22
T21026-Apr-10 14:22 
QuestionSorting Pivot results Pin
Andy_L_J2-Apr-10 13:01
Andy_L_J2-Apr-10 13:01 
AnswerRe: Sorting Pivot results Pin
Mycroft Holmes2-Apr-10 13:18
professionalMycroft Holmes2-Apr-10 13:18 
GeneralRe: Sorting Pivot results Pin
Andy_L_J2-Apr-10 14:33
Andy_L_J2-Apr-10 14:33 
QuestionSSIS - Ignore Duplicate Records while Doing Data Flow. Pin
codeproject_Tarun2-Apr-10 4:44
codeproject_Tarun2-Apr-10 4:44 
AnswerRe: SSIS - Ignore Duplicate Records while Doing Data Flow. Pin
Andy_L_J2-Apr-10 13:07
Andy_L_J2-Apr-10 13:07 
QuestionSQL Server - what is the best to move a database between to another computer Pin
LouWilk2-Apr-10 3:26
LouWilk2-Apr-10 3:26 
AnswerRe: SQL Server - what is the best to move a database between to another computer Pin
scottgp2-Apr-10 3:49
professionalscottgp2-Apr-10 3:49 
AnswerRe: SQL Server - what is the best to move a database between to another computer Pin
St_Pierce2-Apr-10 4:04
St_Pierce2-Apr-10 4:04 
QuestionI Think I May Go Back To MS Access Pin
Roger Wright1-Apr-10 18:26
professionalRoger Wright1-Apr-10 18:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.