<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.blackbaud.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag 'SQL'</title><link>http://forums.blackbaud.com/search/SearchResults.aspx?o=DateDescending&amp;tag=SQL&amp;orTags=0</link><description>Search results matching tag 'SQL'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP2 (Debug Build: 20611.960)</generator><item><title>SQL Queries for Patron Edge, Part III</title><link>http://forums.blackbaud.com/blogs/patronedge/archive/2009/11/18/sql-queries-for-patron-edge-part-iii.aspx</link><pubDate>Wed, 18 Nov 2009 20:08:00 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:50050</guid><dc:creator>06C0951D-0F3F-44D1-AA8F-3C9415303DC1</dc:creator><description>&lt;p&gt;This is my final entry in the series on SQL queries for Patron Edge. Today let’s take a look at the access control tables, so we can do some cool stuff with barcode scanning results:&lt;/p&gt;

&lt;p&gt;select * 
  &lt;br /&gt;from Barcodes_Log 

  &lt;br /&gt;inner join Barcodes on Barcodes.brtSourceCode = Barcodes_Log.brtlCrossRefID and Barcodes.brtSourceTable = 2 

  &lt;br /&gt;inner join Barcodes_Scanners on Barcodes_Scanners.brtscCode = Barcodes_Log.brtlScannerID 

  &lt;br /&gt;inner join SubsStaticReport on SubsStaticReport.ssrSubsProgNum = Barcodes.brtSourceCode &lt;/p&gt;

&lt;p&gt;Scanning tables are pretty complex, so let’s break down some of the fields:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;brtlCrossRefID – Corresponds to Barcodes.brtSourceCode &lt;/li&gt;

  &lt;li&gt;brtlScanningResult – Corresponds to the lookup table Barcodes_ResultMessages &lt;/li&gt;

  &lt;li&gt;brtSourceCode – Corresponds to ReportStatic.rpsTickCode for tickets, SubsStaticReport.ssrSubsProgNum for membership cards and series &lt;/li&gt;

  &lt;li&gt;brtSourceTable – 1 for ticket, 2 for membership, 3 for series ticket, 4 for series event ticket &lt;/li&gt;

  &lt;li&gt;brtEntityType – only used for tickets, 1 for Show, 2 for Event &lt;/li&gt;

  &lt;li&gt;brtEntityCode – Corresponds to Shows.shCode or Events.evCode, based on the brtEntityType &lt;/li&gt;

  &lt;li&gt;brtStatus – 0 for active barcodes, 9 for canceled/reprinted &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now you can report on barcode scanning to do things like plan staffing at entrances, figure out traffic flow through your venue, etc. How are you using scanning data? Leave a note in the comments.&lt;/p&gt;</description></item><item><title>SQL Queries for Patron Edge, Part II</title><link>http://forums.blackbaud.com/blogs/patronedge/archive/2009/11/13/sql-queries-for-patron-edge-part-ii.aspx</link><pubDate>Fri, 13 Nov 2009 18:19:00 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:49490</guid><dc:creator>06C0951D-0F3F-44D1-AA8F-3C9415303DC1</dc:creator><description>&lt;p&gt;Continuing on yesterday’s theme, here are a few more tables and joins to do with what you will. We’ll start with the SubsStaticReport table this time, which is a data warehouse table that contains all of your subscriptions and memberships.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;select * 
    &lt;br /&gt;from SubsStaticReport 

    &lt;br /&gt;inner join Clients on Clients.cltCode = ssrSubsNum 

    &lt;br /&gt;inner join StatusType on StatusType.stsStatus = ssrRenewalStatus&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;ssrSubsNum - Corresponds to Clients.cltCode &lt;/li&gt;

  &lt;li&gt;ssrCurrentStatus and ssrRenewalStatus – Correspond to the StatusType lookup table &lt;/li&gt;

  &lt;li&gt;ssrLastTransact – for series/memberships that are edited or&amp;nbsp; canceled, this field points to ssrTransactNum of the original series/membership &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let’s add on commissions and discounts:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;select * 
    &lt;br /&gt;from SubsStaticReport 

    &lt;br /&gt;inner join Clients on Clients.cltCode = ssrSubsNum 

    &lt;br /&gt;inner join StatusType on StatusType.stsStatus = ssrRenewalStatus 

    &lt;br /&gt;inner join CalculatedCommission on CalculatedCommission.clcTicketNum = rpsTickCode and clcType = 4&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can refer to &lt;a href="http://forums.blackbaud.com/blogs/patronedge/archive/2009/11/11/sql-queries-for-patron-edge-part-i.aspx"&gt;SQL Queries for Patron Edge, Part I&lt;/a&gt; to see what all the commission fields mean. Leave a comment below with your questions!&lt;/p&gt;</description></item><item><title>SQL Queries for Patron Edge, Part I</title><link>http://forums.blackbaud.com/blogs/patronedge/archive/2009/11/11/sql-queries-for-patron-edge-part-i.aspx</link><pubDate>Thu, 12 Nov 2009 00:12:00 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:49255</guid><dc:creator>06C0951D-0F3F-44D1-AA8F-3C9415303DC1</dc:creator><description>
&lt;p&gt;While giving a session at the Museum Computer Network conference on extracting data from a Patron Edge database, one of the attendees suggested creating a handful of sample queries. The idea is that with some samples showing the important table joins, users can run with them, expand on them, or even just push them directly into Excel to do pivot tables.&lt;/p&gt;

&lt;p&gt;With that in mind, here are a couple of samples to get started:&lt;/p&gt;

&lt;blockquote&gt;
  
&lt;p&gt;select * 
    &lt;br /&gt;from ReportStatic 
    &lt;br /&gt;inner join Clients on Clients.cltCode = rpsMailingList
    &lt;br /&gt;inner join Orders on Orders.ordCode = rpsOrder&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The ReportStatic table is one of the major data warehouse tables in the system. It has a row for every ticket sale and return, including event tickets that are part of a subscription. Below are some useful fields that aren’t intuitive without having worked in the back end for a while. Check them out:&lt;/p&gt;

&lt;ul&gt;
  
&lt;li&gt;rpsTickCode – For single tickets, this is the Tickets.tiCode field. For subscription event tickets, it is the TicketsSubscription.tisCode field&lt;/li&gt;

  
&lt;li&gt;rpsMailingList – Corresponds to Clients.cltCode&lt;/li&gt;

  
&lt;li&gt;rpsOrder – Corresponds to Orders.ordCode&lt;/li&gt;

  
&lt;li&gt;rpsSaleStatus – Active tickets have a status of 1, canceled tickets are a 9&lt;/li&gt;

  
&lt;li&gt;rpsTickType – Corresponds to Colors.clrStatus&lt;/li&gt;

  
&lt;li&gt;rpsPriceLevel – Corresponds to Tariff.taCode&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, let’s add a little more to the query:&lt;/p&gt;

&lt;blockquote&gt;
  
&lt;p&gt;select * 
    &lt;br /&gt;from ReportStatic 
    &lt;br /&gt;inner join Clients on Clients.cltCode = rpsMailingList
    &lt;br /&gt;inner join Orders on Orders.ordCode = rpsOrder
    &lt;br /&gt;inner join CalculatedCommission on CalculatedCommission.clcTicketNum = rpsTickCode&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This gives us some new fields to look at:&lt;/p&gt;

&lt;ul&gt;
  
&lt;li&gt;clcCommission – Corresponds to Commission.cmsCode&lt;/li&gt;

  
&lt;li&gt;clcCachInOut – 0 means a positive amount (i.e. commission), 1 is a negative amount (i.e. discount)&lt;/li&gt;

  
&lt;li&gt;clcType – 1 for single tickets, 4 for memberships/subscriptions&lt;/li&gt;

  
&lt;li&gt;clcStatus – 0 for active, 9 for returned&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hopefully this will help you get started writing your own queries and reports. Be sure to leave a comment here, or start a new thread on the Patron Edge forum, with questions and to share your own queries.&lt;/p&gt;
</description></item><item><title>Unable to connect Native Error: 17</title><link>http://forums.blackbaud.com/blogs/technical/archive/2009/10/22/unable-to-connect-native-error-17.aspx</link><pubDate>Thu, 22 Oct 2009 12:43:00 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:46171</guid><dc:creator>EC919830-3CD1-4982-A17A-F868ACBF7C79</dc:creator><description>&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;Windows Server 2008 has been out for a while and it’s easier to &lt;a href="http://www.blackbaud.com/kb/index?page=content&amp;amp;id=BB144770"&gt;move your Blackbaud product(s) to a new server&lt;/a&gt; than to continue maintaining the old server.&amp;nbsp; After moving to a new server some of you may have trouble connecting your Blackbaud application to the new SQL Server.&amp;nbsp; Workstations may get the error, “&lt;font color="#ff0000"&gt;SQL Server does not exist or access denied. Native error: 17&lt;/font&gt;.”&amp;nbsp; This is much more common with the release of Windows Server 2008.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;The single most common reason can be summed up in one word – “Firewall.”&amp;nbsp; Windows Server 2008 comes with the Firewall enabled by default and Windows Update has a habit of turning on Firewalls that have been turned off.&lt;br /&gt;&amp;nbsp; &lt;br /&gt;When moving servers, &lt;a href="http://technet.microsoft.com/en-us/library/cc749056%28WS.10%29.aspx"&gt;check the Firewall settings&lt;/a&gt; and &lt;a href="http://www.blackbaud.com/kb/index?page=content&amp;amp;id=BB134012"&gt;the ports being used by SQL Server&lt;/a&gt; on the new server, sometimes they match up fine, other times they will be different.&amp;nbsp; To determine if the Firewall is your issue, disable the firewall on your server and try to connect through your Blackbaud application on the workstation.&amp;nbsp; If you can log in then the Firewall is your issue and you need to add an exception for the SQL Server port.&amp;nbsp; If you still can’t log in then you have another issue. &lt;br /&gt;&amp;nbsp;&lt;br /&gt;The second most common issue is with DNS. The DNS server may not yet reflect the new server Name and IP Address. Try to PING the server by Name to see if it resolves to the correct IP Address.&amp;nbsp; For example, when you open a command prompt and type PING Servername, it should result in a response of “Pinging Servername [192.168.0.1] (where Servername is the name of your server and 192.168.0.1 is the IP Address of your Server).&amp;nbsp; If the results return a different IP address then you need to check your DNS settings.&amp;nbsp; If you receive the correct IP address but failed ping results then you need to check Network Connectivity to the server.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="http://www.blackbaud.com/kb/index?page=content&amp;amp;id=BB140810"&gt;How to Troubleshoot login issues&lt;/a&gt; is a useful solution if we are still having trouble logging in after moving to a new server.&amp;nbsp; If you are familiar with working in the registry check the InstallSource (&lt;a href="http://www.blackbaud.com/kb/index?page=content&amp;amp;id=BB378320"&gt;The Raiser’s Edge&lt;/a&gt; or &lt;a href="http://www.blackbaud.com/kb/index?page=content&amp;amp;id=BB132388"&gt;Financial Edge/Education Edge/Student Information System&lt;/a&gt;) for your product to see if it has updated to point to the new Deploy kit on the new server. A simple repair by running the Setup.exe located in the Deploy folder will typically point the workstation to the new server.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;Problems connecting to the database can be a common issue when working with SQL Server applications such as Blackbaud Products.&amp;nbsp; Many of these issues are caused by Firewalls or incorrect DNS settings.&amp;nbsp; Checking these two areas first will help resolve a majority of database connectivity issues related to the error “&lt;font color="#ff0000"&gt;SQL Server does not exist or access denied. Native error: 17.&lt;/font&gt;”&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>