<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-6873956949413362303</atom:id><lastBuildDate>Sat, 14 Jun 2025 14:56:24 +0000</lastBuildDate><category>Auto</category><category>Jquery</category><category>Parameter</category><category>SSRS</category><category>View Report</category><category>automatically</category><category>drop down</category><category>postback</category><category>query</category><title>Fuzzylogic</title><description>Fuzzylogic is a blog that explores Microsoft SQL Server, BI, C#, ASP.Net and sometimes MS Access. Oh yeh and I may even talk a little rugby now and again.</description><link>http://camerontownshend.blogspot.com/</link><managingEditor>noreply@blogger.com (Cameron Townshend)</managingEditor><generator>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-799553504672492953</guid><pubDate>Sat, 14 Nov 2015 08:34:00 +0000</pubDate><atom:updated>2015-11-14T19:34:24.600+11:00</atom:updated><title>jQuery Validation Plugin: Remote Validation With AJAX (3/4)</title><description>&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;270&quot; src=&quot;https://www.youtube.com/embed/EwTr2BwtZmQ&quot; width=&quot;480&quot;&gt;&lt;/iframe&gt;</description><link>http://camerontownshend.blogspot.com/2015/11/jquery-validation-plugin-remote.html</link><author>noreply@blogger.com (Cameron Townshend)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/EwTr2BwtZmQ/default.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-3872550003732216433</guid><pubDate>Tue, 10 Nov 2015 13:11:00 +0000</pubDate><atom:updated>2015-11-11T00:11:03.938+11:00</atom:updated><title>Using PowerShell-FTP-Client to download and delete files from an FTP server</title><description>&lt;ol&gt;
&lt;li&gt; Configure PowerShell - out the scope of this blog entry, but &lt;a href=&quot;https://technet.microsoft.com/en-us/library/bb978526.aspx&quot;&gt;here&lt;/a&gt; with Microsoft&lt;/li&gt;
&lt;li&gt; Download and install the &lt;a href=&quot;https://gallery.technet.microsoft.com/scriptcenter/PowerShell-FTP-Client-db6fe0cb&quot;&gt;PowerShell FTP Client Module&lt;/a&gt; by Michal Gajda.&lt;/li&gt;
&lt;li&gt; Use the code below which logs on to the FTP server and then gets a list of files&lt;/li&gt;
&lt;li&gt; Downloads each file in the list&lt;/li&gt;
&lt;li&gt; Deletes the file after download
&lt;/ol&gt;
&lt;pre class=&quot;brush: powershell&quot;&gt;
$FtpServer = &quot;ftp.server.com&quot;
$User = &quot;username&quot;
$PWD = &quot;cleverpassword&quot;
$Password =  ConvertTo-SecureString $Pwd -AsPlainText -Force
$FtpCredentials = New-Object System.Management.Automation.PSCredential ($User, $Password)
Set-FTPConnection -Credentials $FtpCredentials -Server $FtpServer -Session MyFtpSession -UsePassive 
$FtpSession = Get-FTPConnection -Session MyFtpSession
$ServerPath = &quot;/backups/test/&quot;
$LocalPath  = &quot;C:\Data\test\&quot;
$fileList   = Get-FTPChildItem -Session $FtpSession -Path $ServerPath -Filter *.txt
foreach ($element in $fileList ) {
 $filename = $ServerPath  + $element.name
 Get-FTPItem    -Path $filename -Session $FtpSession -LocalPath $LocalPath -Overwrite $true
    Remove-FTPItem -Path $filename -Session $FtpSession 
}
&lt;/pre&gt;</description><link>http://camerontownshend.blogspot.com/2015/11/using-powershell-ftp-client-to-download.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-5763398971797338259</guid><pubDate>Tue, 10 Nov 2015 06:09:00 +0000</pubDate><atom:updated>2015-11-10T17:09:41.059+11:00</atom:updated><title>How to allow a user to run a SQL Server Agent Job from a client application.</title><description>I wanted to allow users to run a SQL Server agent Job from a client application. 

Short Answer
CALL msdb.[dbo].[sp_start_job]

I had a number of errors but the fix was to
1) Add their login as a user to the msdb database 
2) Put the user into group: SQLAgentOperatorRole
&lt;br/&gt;
Long answer
I had a stored procedure like below
&lt;pre class=&quot;brush: sql&quot;&gt;
CREATE PROCEDURE [dbo].[startJob] @JobName nvarchar(255) as
BEGIN
 declare @retval int
 EXEC @retval = msdb..sp_start_job @JobName
 return @retval 
END
&lt;/pre&gt;
And runs OK for me but didnt work for a user. Problem 1
&quot;the execute permission was denied on the object &#39;sp_start_job&#39; database &#39;msdb&#39;&quot;
To check this permission run this query

&lt;pre class=&quot;brush: sql&quot;&gt;
SELECT PR.NAME, DP.PERMISSION_NAME, DP.STATE_DESC
FROM MSDB.SYS.DATABASE_PERMISSIONS DP
JOIN MSDB.SYS.OBJECTS O ON DP.MAJOR_ID = O.OBJECT_ID
JOIN MSDB.SYS.DATABASE_PRINCIPALS PR
ON DP.GRANTEE_PRINCIPAL_ID = PR.PRINCIPAL_ID
WHERE O.NAME = &#39;SP_START_JOB&#39;

Results
NAME                 PERMISSION_NAME STATE_DESC
TargetServersRole EXECUTE         DENY
SQLAgentUserRole EXECUTE         GRANT

USE [msdb]
GO
CREATE USER [domain\securitygroup] FOR LOGIN [domain\securitygroup]
GO
EXEC sp_addrolemember N&#39;SQLAgentUserRole&#39;, N&#39;domain\securitygroup&#39;
GO
&lt;/pre&gt;
&lt;br/&gt;
Then I got
&lt;pre class=&quot;brush: sql&quot;&gt;
Server: Msg 14262, Level 16, State 1, Procedure sp_verify_job_identifiers, Line 61
The specified @job_name (&#39;My Job X&#39;) does not exist.
&lt;/pre&gt;

This is because the user did not have permission to run someone else&#39;s job. They need to be made a member of the SQLAgentOperatorRole to do that.
&lt;pre class=&quot;brush: sql&quot;&gt;

EXEC sp_addrolemember N&#39;SQLAgentOperatorRole&#39;, N&#39;domain\securitygroup&#39;
GO
&lt;/pre&gt;

References: &lt;a href=&quot;http://technet.microsoft.com/en-us/library/ms186757.aspx&quot;&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://technet.microsoft.com/en-us/library/ms188283.aspx&quot;&gt;&lt;/a&gt;
</description><link>http://camerontownshend.blogspot.com/2015/11/how-to-allow-user-to-run-sql-server.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-8834059006407696019</guid><pubDate>Mon, 15 Apr 2013 11:39:00 +0000</pubDate><atom:updated>2013-04-15T22:41:33.999+10:00</atom:updated><title>Amazing video </title><description>This is an live action short video from Russia (I believe). It&#39;s in the style of a first person shooter game. &lt;br/&gt;

&lt;iframe src=&quot;http://www.facebook.com/video/embed?video_id=499301706801446&quot; width=&quot;440&quot; height=&quot;280&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;true&quot;&gt;&lt;/iframe&gt;
</description><link>http://camerontownshend.blogspot.com/2013/04/amazing-video.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-3793569455354125086</guid><pubDate>Tue, 05 Feb 2013 04:07:00 +0000</pubDate><atom:updated>2013-02-05T15:07:08.748+11:00</atom:updated><title>How to stop Excel from automatically splitting a CSV</title><description>One of the annoying features added to Excel is that when you open a file with csv extension it automatically parses the file on the &quot;,&quot; and butchers your file. This is annoying if the file uses another character to split or contains German numbers which use a comma for the decimal etc. So how do you fix this?
1) Open Excel (dont double click on the CSV)
2) Go to &quot;Data&quot; -&gt; &quot;Get External Data from Text&quot;
3) Select the CSV file
4) Click &quot;Import&quot;
5) Go through the wizard and specify the delimiter and that all fields are text not numebrs etc
6) You are done.</description><link>http://camerontownshend.blogspot.com/2013/02/how-to-stop-excel-from-automatically.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-5473509045830930730</guid><pubDate>Thu, 22 Nov 2012 19:12:00 +0000</pubDate><atom:updated>2015-11-11T00:15:21.613+11:00</atom:updated><title>Learning Silverlight</title><description>I recently had to take over a Silverlight application and had to remind myself how it hangs together. Here are some good blogs on the topic&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://weblogs.asp.net/scottgu/pages/silverlight-2-end-to-end-tutorial-building-a-digg-search-client.aspx&quot;&gt;http://weblogs.asp.net/scottgu/pages/silverlight-2-end-to-end-tutorial-building-a-digg-search-client.aspx&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://timheuer.com/blog/articles/getting-started-with-silverlight-development.aspx&quot;&gt;http://timheuer.com/blog/articles/getting-started-with-silverlight-development.aspx&lt;/a&gt;&lt;/li&gt;
 
&lt;li&gt;&lt;a href=&quot;http://www.silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/default.html&quot;&gt;http://www.silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/default.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><link>http://camerontownshend.blogspot.com/2012/11/learning-silverlight.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-456018312485354454</guid><pubDate>Thu, 22 Nov 2012 19:08:00 +0000</pubDate><atom:updated>2015-11-11T00:26:54.034+11:00</atom:updated><title>How to blog Code</title><description>Here is a great blog  on how to post code snippets.


&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;a href=&quot;http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html&quot;&gt;http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
Copy and paste source into 
&lt;a href=&quot;http://www.opinionatedgeek.com/dotnet/tools/htmlencode/encode.aspx&quot;&gt;http://www.opinionatedgeek.com/dotnet/tools/htmlencode/encode.aspx
&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
encode the source then copy from above step and paste into blog
&lt;/li&gt;
&lt;li&gt;
Then wrap in tags
&lt;script class=&quot;brush: xml&quot; type=&quot;syntaxhighlighter&quot;&gt;

&lt;![CDATA[&lt;pre class=&quot;brush: javascript&quot;&gt;
&lt;/pre&gt;
]]&gt;
&lt;/script&gt;
&lt;/li&gt;
&lt;/ol&gt;
</description><link>http://camerontownshend.blogspot.com/2012/11/how-to-blog-code.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-1065205018800853750</guid><pubDate>Thu, 22 Nov 2012 19:06:00 +0000</pubDate><atom:updated>2012-11-23T06:06:10.759+11:00</atom:updated><title>I was recommended a good Yum Cha in Sydney</title><description>Mr Chao Seafood Restaurant 
TEL:0295808003 
Address:127-137 Forest Road Hurstville Nsw 2220, Hurstville, NSW, 2220
</description><link>http://camerontownshend.blogspot.com/2012/11/i-was-recommended-good-yum-cha-in-sydney.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-2603834625537011964</guid><pubDate>Thu, 22 Nov 2012 19:03:00 +0000</pubDate><atom:updated>2012-11-23T06:03:32.786+11:00</atom:updated><title>POS Hacked</title><description>I recently heard about a Point of Sale (POS) system that was hacked. The owner of the restaurant had to compensate the victims of credit card fraud.

http://www.wired.com/threatlevel/2009/11/pos/
</description><link>http://camerontownshend.blogspot.com/2012/11/pos-hacked.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-7975945042704746914</guid><pubDate>Thu, 22 Nov 2012 18:59:00 +0000</pubDate><atom:updated>2013-04-15T21:46:09.915+10:00</atom:updated><title>SSRS reports in new window</title><description>I recently received this request 
&lt;blockquote&gt;
On Thu, Nov 15, 2012 at 2:26 PM, Ajay &lt;XXXXXX@XXXX.cOM&gt; wrote:
Standard SSRS web interface, where displays the various reports.
(from the page, where each reports have a menu which has options for
Move, Delete, Subscribe etc.)
When the link is clicked it navigates to the report

Can this link be configured so that when clicked, it opens the report
in a new window.

We are using this SSRS page as Iframe in existing web page, and by
default on clicking it opens in the iframe and is hard to read the
report.


Thanks
Ajay
&lt;/blockquote&gt;
&lt;br/&gt;

Heres the answer.

If you are brave. Open Folder.aspx in 
MSSQLServerSSRSRootFolder\Reporting Services\ReportManager\Pages\Folder.aspx
and add the following JQuery to the top of the file
&lt;pre class=&quot;brush: javascript&quot;&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script language = &amp;quot;Javascript&amp;quot;&amp;gt;
$(function(){
    $(&amp;#39;a&amp;#39;).click(function() {
        $(this).attr(&amp;#39;target&amp;#39;, &amp;#39;_blank&amp;#39;);
    });
});
&amp;lt;/script&amp;gt;

&lt;/pre&gt;

How this works is that the Folder.aspx page contains the HTML that each report will be listed in when displaying the default SSRS folder window. The JQuery will add code to the click event on each hyperlink &quot;a&quot;nchor tag. The JQuery is telling the browser to open in a new window. 
Cameron

__________________</description><link>http://camerontownshend.blogspot.com/2012/11/ssrs-reports-in-new-window.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-2667005457615754681</guid><pubDate>Thu, 22 Nov 2012 18:52:00 +0000</pubDate><atom:updated>2012-11-23T05:52:04.507+11:00</atom:updated><title>Cannot Restart SQL Services</title><description>I recently received this request to restart the SQL Server Services
Hi All

I&#39;ve a Local copy of SQL Server installed on my Computer ( SQL Server 2008 R2), it was all working fine up until below situation.

I used local SSMS to connect to remote SQL server(SQL Server 2008 ) and performed some queries and closed the session.

Then when I tried to connect to my Local SQL server using local SSMS, it pops up a message saying &quot; Cannot Connect to localhost&quot; A network specific or instance specific error occurred while establishing a connection to SQl Server.

I observed under &quot;SQL   Server Configuration Manager&quot; all services are stopped !! When I tried to re-start them it comes up with another error as &quot; The request failed or service did not respond in a timely fashion. Consult the event log or other
applicable error logs for details&quot;


Here&#39;s the answer

Can you send the event log information? Have you tried a complete reboot? other issues to look at are login account  username/pwd problem. I have also seen networking problems where the network trace route to the local host is not working.
This could be a networking problem e.g. you have logged in to a vpn client or similar and it is still connected etc. 

Hi,
Thanks, it looks like Logon issue, since my password has been changed after SQL server was installed on this machine, ??I Event Log says:

&quot;The SQL Server Analysis Services (MSSQLSERVER) service failed to start due to the following error: 
The service did not start due to a logon failure.&quot;


Just like it says on the box. The answer is the event log. You just need to remember/know where to know.
</description><link>http://camerontownshend.blogspot.com/2012/11/cannot-restart-sql-services.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-7604863071965774851</guid><pubDate>Thu, 22 Nov 2012 18:48:00 +0000</pubDate><atom:updated>2012-11-23T05:48:28.291+11:00</atom:updated><title>ApplicationPoolIdentity in IIS 7.5</title><description>I found this fantastic article on ApplicationPoolIdentity in IIS 7.5
http://www.iis.net/learn/manage/configuring-security/application-pool-identities

Very Good article on how the IIS7.5 service creates Virtual Accounts and Secures them</description><link>http://camerontownshend.blogspot.com/2012/11/applicationpoolidentity-in-iis-75.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-7645830780916863476</guid><pubDate>Thu, 22 Nov 2012 18:46:00 +0000</pubDate><atom:updated>2012-11-23T05:46:39.270+11:00</atom:updated><title>SQL Query to Calculate Surrender Amounts</title><description>I recently received a request to handle closing out repayment data in a SQL query as per below. (Answer at the end.)


Hi All,
I am working on a stored procedure which use to update a Table, I have come across a  business request, which I need some assistance of developing suitable logic:
Appreciate if someone can provide some advice on how to handle below situation in SQL please. My main question on this regard is how to distribute &#39;Surrender&#39; ( Return Amount ) as per below Logic????



I have two tables,“Master Table” and “Detail_Table”,  a stored Proc been used to populate “Detail_Table” based on records in“Master Table” 

Pseudo Code explanation:


Read a record by record from “Master Table” and update &quot;Detail Table&quot;

If ‘Transaction Type’ = ‘New’ then
     Put “Monthly_Net_premium” as  Annual_premium/12  into “Detail_Table”
NEXT

#### My concern is how to handle &#39;Surrender&#39; ## ###

If ‘Transaction Type = “Surrender” then
Update “Detail_Table” as below logic ( Which I have no idea how to do )))

     Reverse Monthly values received from the policy, reversing from last premium received until it reaches Return Amount. (e.g. 52 + 52 + 52 + 44 as Return amount = 200)
Master Table record containing Fin_id =216, is the record for &#39;Surrender&#39;, which has Annual Premium value(624) as well , and we know it distributed (i.e. Annual_premium/12 )



** What is the methodology to use to apportion Return amount , compensating  what had received  until it reached return amount??



 e.g. of processing first two records in &quot;Master Table&quot; shown in Tables


Master Table
Fin_id
Policy_id
Transaction Type
Annual Premium
Return Amount
Start Date
End Date

215
4402
New
624
-
1/Apr/2009
31/Mar/2010

216
4402
Surrender
624
(200)
1/Apr/2009
31/Mar/2010

 
Detail_Table
Fin_Id
Policy_ID
Effective_Date
Monthly_Net_Premium
215
4402
April-2009
52
215
4402
May-2009
52
215
4402
June-2009
52
215
4402
July-2009
52
215
4402
August-2009
52
215
4402
September-2009
52
215
4402
October-2009
52
215
4402
November-2009
52
215
4402
December-2009
52
215
4402
January-2010
52
215
4402
February-2010
52
215
4402
March-2010
52
216
4402
December -2009
(44)
216
4402
January-2010
(52)
216
4402
February-2010
(52)
216
4402
March-2010
(52)
 
Part of stored procedure:
USE [Mira_Test]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
 
ALTER PROCEDURE [dbo].[UpdateDetail]
AS
 
BEGIN
 
SET NOCOUNT ON;
 
WITH c_Daily AS (
      SELECT
             fin_id
            , policy_id
            , transaction_type
            , Return_Amount
            , Start_Date
            , End_Date
            , direct_debit_details_id
            , Surrender_Date
            , CASE
                  WHEN transaction_type IN ( &#39;Surrender&#39; )
                   THEN 0     -- I need Help Here #################
                  ELSE (Annual_premium) / 12
            END AS monthly_net_premium
            FROM dbo.masterTable
     
)
-- Now generate a row for each transaction day
 
INSERT dbo.DetailTable
      (
             FinID
            , Policy_id
            , Effective_Date
            , monthly_net_premium
                       
           
            --- some joins etc...
 
END;
 
RETURN 0;


Heres the answer
Mira
Here is some SQL that may help. I have put in an update statement for a single pass and also a slect statement, so you can test it. Basically, it works out the number of whole months that you need to take the premium out of the return amount then it works out the balance. It does it in reverse order based on the business rule.


Update Detail_Table
Set Monthly_Net_Premium = CASE
                  WHEN transaction_type IN ( &#39;Surrender&#39; )
                   THEN (case 
       When DATEDIFF(month, Effective_Date, End_date)  = (floor(-1*Return_amount / (Annual_Premium/12) )) 
        then (-1*Return_amount -  ((floor(-1*Return_amount / (Annual_premium/12))) * Annual_premium/12)) else ((Annual_premium) / 12) end)
                  ELSE (Annual_premium) / 12
                  end
from Detail_Table inner join Master_Table on Detail_Table.Policy_id = Master_Table.Policy_id and Detail_Table.Fin_id = Master_Table.Fin_id 



Select Detail_Table.Policy_id, Detail_Table.fin_id,  Monthly_Net_Premium, 
 transaction_type,
  
  DATEDIFF(month, Effective_Date, End_date),
  (floor(-1*Return_amount / (Annual_Premium/12))),
  DATEADD(month, -1*(floor(-1*Return_amount / (Annual_Premium/12) ))-1, End_date), 
  Effective_Date,
 (-1*Return_amount -  ((floor(-1*Return_amount / (Annual_premium/12))) * Annual_premium/12)),
 ((Annual_premium) / 12)
from Detail_Table inner join Master_Table on Detail_Table.Policy_id = Master_Table.Policy_id and Detail_Table.Fin_id = Master_Table.Fin_id 
 
Regards
Cameron
 
  </description><link>http://camerontownshend.blogspot.com/2012/11/sql-query-to-calculate-surrender-amounts.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-3235534926951161879</guid><pubDate>Thu, 22 Nov 2012 18:41:00 +0000</pubDate><atom:updated>2012-11-23T05:41:15.494+11:00</atom:updated><title>SQL basics to Expert </title><description>Depends on whether you want to be excellent at TSQL dev or SQL Server management. Assuming dev track first then. The progression I have below should take you from zero to hero pretty quick. Once you have done all of this material you will be a 1%er. Will take you about 1-2years to do everything suggested here.
 
Do the books that lead to 70-433 certification. I did the dev track recently 70-433 and learnt alot about TSQL especially the new additions. The Self Paced Training kits from MS are excellent starting points 
 
MCTS Self-Paced Training Kit (Exam 70-433): Microsoft® SQL Server® 2008 Database Development - http://www.amazon.com/MCTS-Self-Paced-Training-Exam-70-433/dp/0735626391
 
Then there is the excellent SQL Server Internals to understand whats happening under the covers.
Microsoft® SQL Server® 2008 Internals (Pro - Developer) - http://www.amazon.com/Microsoft%C2%AE-SQL-Server%C2%AE-2008-Internals/ 
 
Improving .NET Application Performance and Scalability - http://msdn.microsoft.com/en-us/library/ff649152.aspx  especially Chapter 14 — Improving SQL Server Performance - http://msdn.microsoft.com/en-us/library/ff647793.aspx
 
The book that really mad a difference for me a long time ago was this one. Not available anymore but superb - 
Microsoft SQL Server 2000 Performance Tuning Technical Reference - http://www.amazon.com/Microsoft-Server-Performance-Technical-Reference/dp/0735612706/
 
Read Paul Randells blog - phenomenal - http://sqlskills.com/blogs/paul/
 
Also get yourself a subscription to PluralSight, excellent material presented by good people.

Well, there are various tutorials via MS (and a host of other places), there are quite a few samples in the online help as well…
 
This page is archived but still has a list of pretty good links : http://archive.msdn.microsoft.com/SQLTutorials
 
There is also a wide range of tutorials : http://msdn.microsoft.com/en-us/library/ms167593(v=sql.105).aspx (for example look at lesson 1 : http://msdn.microsoft.com/en-us/library/ms365325(v=sql.105).aspx )
 
If specifically with ASP.NET then there are some good tutorials and sample apps over at : http://www.asp.net/mvc
</description><link>http://camerontownshend.blogspot.com/2012/11/sql-basics-to-expert.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-2955034644408608288</guid><pubDate>Mon, 12 Nov 2012 06:11:00 +0000</pubDate><atom:updated>2015-11-10T16:56:36.351+11:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Auto</category><category domain="http://www.blogger.com/atom/ns#">automatically</category><category domain="http://www.blogger.com/atom/ns#">drop down</category><category domain="http://www.blogger.com/atom/ns#">Jquery</category><category domain="http://www.blogger.com/atom/ns#">Parameter</category><category domain="http://www.blogger.com/atom/ns#">postback</category><category domain="http://www.blogger.com/atom/ns#">query</category><category domain="http://www.blogger.com/atom/ns#">SSRS</category><category domain="http://www.blogger.com/atom/ns#">View Report</category><title>SSRS Automatically View Report after selecting drop down parameter value</title><description>In SQL Server Reporting Services (SSRS), I had a client who wanted to automatically rerun their report after selecting a value in a drop down without having to click on the &quot;View Report&quot; button. This can be done using JQuery and below is how it is done.


1.) Go to the &quot;Report.aspx&quot; page in the ReportManager directory. On My machine it is here. C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\Pages\Report.aspx&quot;

2) At the top of the file after the &quot;Page&quot; directive in asp.net add the following script.
&lt;pre class=&quot;brush: javascript&quot;&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script language = &amp;quot;Javascript&amp;quot;&amp;gt;

 $(function(){
 $(&amp;#39;body&amp;#39;).on(&amp;#39;change&amp;#39;, &amp;#39;select&amp;#39;, function () {
 $(&amp;#39;input[value=&amp;quot;View Report&amp;quot;]&amp;#39;).click();
 });
});
&amp;lt;/script&amp;gt;
&lt;/pre&gt;



3) Now every time you click on the value in the drop box it will automatically postback and refresh the form with your selected parameter.
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ7FSnad6TIBaa5vpQk63BWcW-jbb5pYdV1whW81mUgM5L-Sm2tibl9zj_KdLxet7ZcKKD_0hU4Yms-iW21slv6My216c0R9MYBaf47BHIm6BjIcfj8U84gLdhcUHk5RBTdpEftNAnn0_i/s1600/auto+postback+ssrs.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear:left; float:left;margin-right:1em; margin-bottom:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;226&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ7FSnad6TIBaa5vpQk63BWcW-jbb5pYdV1whW81mUgM5L-Sm2tibl9zj_KdLxet7ZcKKD_0hU4Yms-iW21slv6My216c0R9MYBaf47BHIm6BjIcfj8U84gLdhcUHk5RBTdpEftNAnn0_i/s320/auto+postback+ssrs.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br/&gt;
&lt;strong&gt;Postscript&lt;/strong&gt;&lt;br/&gt;
 After various feedback, people have asked for how to make the report refresh only on a particular control. This can be done with jQuery. Naturally with jQuery there are lots of ways of achieving this, so I have opted for the simplest. The short answer is here is the code below. 

&lt;pre class=&quot;brush: javascript&quot;&gt;
&amp;lt;%@ Register TagPrefix=&amp;quot;MSRS&amp;quot; Namespace=&amp;quot;Microsoft.ReportingServices.UI&amp;quot; Assembly=&amp;quot;ReportingServicesWebUserInterface&amp;quot; %&amp;gt;

&amp;lt;%@ Page Language=&amp;quot;c#&amp;quot; CodeBehind=&amp;quot;Report.aspx.cs&amp;quot; AutoEventWireup=&amp;quot;false&amp;quot; Inherits=&amp;quot;Microsoft.ReportingServices.UI.ReportWrapperPage&amp;quot; EnableEventValidation=&amp;quot;false&amp;quot; %&amp;gt;

&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    $(function () {
        $(&amp;#39;body&amp;#39;).on(&amp;#39;change&amp;#39;, &amp;#39;select&amp;#39;, function () {
            var currentControl = this
            //Need to add checks here that we have selected values etc.
            var allBoxes = $(&amp;#39;select&amp;#39;);
            var fire = true
            allBoxes.each(function () {
                if (this.value == &amp;quot;0&amp;quot;) {
                    fire = false;
                }
            });
            if (fire == true) {
                var relevantControlPrompt = &amp;#39;Asset Type&amp;#39;;
                var relaventspanText = $(&amp;#39;label[for=&amp;quot;&amp;#39; + currentControl.id + &amp;#39;&amp;quot;]&amp;#39;).children(&amp;quot;span&amp;quot;).html();
                if (relaventspanText == relevantControlPrompt) {
                    fire = true;
                } else {
                    fire = false;
                }
            }
            if (fire == true) {
                $(&amp;#39;input[value=&amp;quot;View Report&amp;quot;]&amp;#39;).click();
            }
        });
    });
&amp;lt;/script&amp;gt;

&lt;/pre&gt;

How does it work?
It relies on the way that SSRS renders the report page.  

SSRS programmatically generates the controls on the form. We don&#39;t know the name/id of the controls before we start looking at the HTML that is generated. However Microsoft kindly took advantage of the HTML &quot;for&quot; attribute which links form prompt labels with their relevant input control. So in jQuery I can take advantage of this.

&lt;br/&gt;

SSRS
a) Creates a list of controls with prompts stored in labels. b) the labels are flagged with &quot;for&quot; with a pointer to the relevant select drop down list box. c) using jQuery we can now find out if the current Select is the one that we want to watch. 

In the example below, we have chosen to look at the &quot;Asset Type&quot; drop down. ...snippet from outputted html by SSRS

&lt;pre class=&quot;brush: html&quot;&gt;
&amp;lt;label for=&amp;quot;ctl32_ctl04_ctl06_ddValue&amp;quot;&amp;gt;&amp;lt;span&amp;gt;Asset Type&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;
&lt;/pre&gt;

the relevant select looks like this
&lt;pre class=&quot;brush: html&quot;&gt;
&amp;lt;select name=&amp;quot;ctl32$ctl04$ctl06$ddValue&amp;quot; id=&amp;quot;ctl32_ctl04_ctl06_ddValue&amp;quot; style=&amp;quot;width: 182px;&amp;quot;&amp;gt;
&lt;/pre&gt;


So the label has a &quot;for&quot; attribute &quot;ctl32_ctl04_ctl06_ddValue&quot; which points to the id of the relevant select. 

The code will run for every select on the form but will only refresh the report for the chosen select.
The selector uses the jquery syntax to search for a label with the &lt;b&gt;for&lt;/b&gt; attribute = to my control id. I then get the child span and then get its html. This should then say &quot;Asset Type&quot; or whatever is the relevant select for your requirement.
&lt;pre class=&quot;brush: javascript&quot;&gt;
var relaventspanText = $(&amp;#39;label[for=&amp;quot;&amp;#39; + currentControl.id + &amp;#39;&amp;quot;]&amp;#39;).children(&amp;quot;span&amp;quot;).html();
&lt;/pre&gt;

Note: The javascript also includes logic to suppress refreshing until all values have been selected, if that is required.

&lt;/div&gt;</description><link>http://camerontownshend.blogspot.com/2012/11/ssrs-automatically-view-report-after.html</link><author>noreply@blogger.com (Cameron Townshend)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ7FSnad6TIBaa5vpQk63BWcW-jbb5pYdV1whW81mUgM5L-Sm2tibl9zj_KdLxet7ZcKKD_0hU4Yms-iW21slv6My216c0R9MYBaf47BHIm6BjIcfj8U84gLdhcUHk5RBTdpEftNAnn0_i/s72-c/auto+postback+ssrs.jpg" height="72" width="72"/><thr:total>9</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-1370975959753613830</guid><pubDate>Sat, 13 Oct 2012 11:32:00 +0000</pubDate><atom:updated>2012-10-13T22:32:27.725+11:00</atom:updated><title>Quick Code Generator</title><description>Sometimes you want to generate a quick bit of code and dont want to use a massive code generator. Well what if you could just get a list of values and apply a template to them quickly and generate the resulting code. The answer is http://nimbletext.com/live


&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://nimbletext.com/img/nimbleText_plain_narrow.png&quot; imageanchor=&quot;1&quot; style=&quot;clear:left; float:left;margin-right:1em; margin-bottom:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;536&quot; width=&quot;460&quot; src=&quot;http://nimbletext.com/img/nimbleText_plain_narrow.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;


I need to insert a few values from Excel into a SQL Database.

The template looks like below
Insert  ADX.tbl_PROD_ADVERTISER_Mapping( ADVERTISER_ID,   ADVERTISER_NAME_SB,   REVENUE_STREAM,   ADVERTISER_NAME_ADX)
Values ($0, &#39;$1&#39;, &#39;$2&#39;, &#39;$3&#39;)
go

To split on tabs (defualt when copying from Excel) use &lt;b&gt;\t&lt;/b&gt; as the column separator.</description><link>http://camerontownshend.blogspot.com/2012/10/quick-code-generator.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-9153803503746819081</guid><pubDate>Fri, 13 Jul 2012 07:45:00 +0000</pubDate><atom:updated>2012-07-13T17:45:27.041+10:00</atom:updated><title>Hadoop - What is it and Why do I care? Or how to explain Hadoop to a girl in the pub.</title><description>Pretty Girl: What Do You do.
Cameron: I work with Large computer integration problems. I&#39;m currently looking at Hadoop.
PG: Whats that?
Cameron: Hadoop is the Open Source version of the Google Map/Reduce algorithm. 
Pretty Girl: My brain hurts. 
Cameron: Well imagine if you had to download the internet every night and index it and make it searchable. That would be pretty hard to do right?
Girl: Well I guess. Why do I want to do that?
Cameron: Well that’s how Google makes the Internet searchable every time you want to find something like Britney Spear’s New Song or where to find those really cool Black Milk Stockings. &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://p.twimg.com/An3Dso3CQAAjA7o.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear:left; float:left;margin-right:1em; margin-bottom:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;800&quot; width=&quot;600&quot; src=&quot;http://p.twimg.com/An3Dso3CQAAjA7o.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

 Google do the indexing for you beforehand so you get your answers back really quick. Don’t you reckon that’s cool? 
Pretty Girl: Well yeh, I wonder how they do that?
Cameron: Good question. Well Google could write a check with lots of zeros on it and give it to Oracle, but Oracle could never make a database big enough and fast enough to solve this problem. So what Google did is they decided to solve the problem in a different way. They split the job up into hundreds and thousands of little jobs. Send a piece of the problem to all of these little cheap computer boxes. Wait for them to work out their little piece of the problem. Once they had done their bit they would send it back to the answer box and it would collate all of their bits of the data and give you the answer.  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://i68.photobucket.com/albums/i2/RealConnections/google1stserver2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear:left; float:left;margin-right:1em; margin-bottom:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;500&quot; width=&quot;302&quot; src=&quot;http://i68.photobucket.com/albums/i2/RealConnections/google1stserver2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;


Pretty Girl: That’s clever.
Cameron: Yeh, really clever, and really simple (in hindsight). The first bit is called “Map” where they send the data off to the little boxes. The second bit is called “reduce” where they bring the answer back and give it to you. This is what they call Map/Reduce.
Pretty girl: Oh.
Cameron: And now Google has made this clever trick available to all of us. And that is called Hadoop. &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://a0.twimg.com/profile_images/1252505253/elephant_rgb_sq.png&quot; imageanchor=&quot;1&quot; style=&quot;clear:left; float:left;margin-right:1em; margin-bottom:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;500&quot; width=&quot;495&quot; src=&quot;http://a0.twimg.com/profile_images/1252505253/elephant_rgb_sq.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

 We can use it to solve problems that we couldn’t solve before. 
Pretty Girl: Like what?
Cameron: Well for example the Beijing Genomic Institute is mapping the DNA of millions of people.&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.maximsnews.com/110mnunBGI.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear:left; float:left;margin-right:1em; margin-bottom:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;768&quot; width=&quot;832&quot; src=&quot;http://www.maximsnews.com/110mnunBGI.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

 They are developing “personal medicine” which will target the DNA of an individual person and the medicine will work just for them. Currently cancer medicine is called cytotoxic and this means it kills cells – cancer cells and healthy cells. Yucky stuff. With Personal medicine they wont have to do that.  . Or what about seeing what people are saying about your brand on twitter (remember Qantas twitter fail. &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://blogs.news.com.au/images/uploads/Failwhale.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear:left; float:left;margin-right:1em; margin-bottom:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;350&quot; width=&quot;467&quot; src=&quot;http://blogs.news.com.au/images/uploads/Failwhale.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

 ), Facebook, and linked-in. Or detecting credit card fraud, or … This is only possible with the massive computing power available in the cloud. This is called Big Data. We are seeing the impossible become possible. This is why we should all be aware of what Hadoop, Big Data and Cloud are all about. 
Pretty girl: What’s the cloud?
Cameron: That’s a talk for another day.</description><link>http://camerontownshend.blogspot.com/2012/07/hadoop-what-is-it-and-why-do-i-care-or.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-479513058668207989</guid><pubDate>Mon, 28 Feb 2011 09:13:00 +0000</pubDate><atom:updated>2015-11-11T00:12:53.905+11:00</atom:updated><title>MGET with delete for FTP</title><description>A common problem for FTP users is how to download all the available files from an FTP server and delete them once they are downloaded. You can &lt;b&gt;not&lt;/b&gt; simply perform mget *.* followed by mdelete *.* because there may be new files arrived onto the FTP server since your started and you will delete them before they are downloaded.&lt;br /&gt;i.e. bad - potentially deletes files that we havent retrieved yet.&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;mget *.*&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;mdelete *.*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are a number of approaches to solving this problem for example WINSCP grabs a file then deletes it one at a time. I wanted to use the inbuilt Microsoft FTP command in a batch to download the files to our local machine then delete the files that have successfully arrived one at a time from the FTP server but not delete files that I have not retrieved that may have arrived since we started work.&lt;br /&gt;This is how it is done.&lt;br /&gt;1) Create a batch file that gets the files that you want using an ftp script and then call two batch files which create a delete script and then call the delete script, which we will do in steps 3 and 4 below&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;FTP -i -s:C:\TWC\GetFiles_FTP.txt ftp.XXX.XXX&lt;br /&gt;call C:\Data\createDelete.bat&lt;br /&gt;call C:\Data\Del_FTP.bat&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;2) The GetFiles_FTP.txt looks like this, a simple mget with your particular login details and path details&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;color:#3366ff;&quot;&gt;username&lt;br /&gt;password&lt;br /&gt;cd remotefolder&lt;br /&gt;bin&lt;br /&gt;mget *.* &quot;C:\DATA\FILES\&quot;&lt;br /&gt;bye&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;3) This is the magic step in createDelete.bat. The trick here is that we generate an ftp script file on the fly by echoing out the ftp login details to a file along with the output of the Forfiles command. This command loops though a path &quot;-p&quot; (note: no trailing back slash on the path) and for a file mask &quot;-m&quot; it performs a command &quot;-c&quot;. I am echoing &quot;del filename&quot; into the script file so we get a list of del commands for each file that we have successfully retrieved onto our local machine. This means we wont delete files that we haven&#39;t retrieved.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;color:#3366ff;&quot;&gt;echo username&gt; C:\Data\deleteFiles.txt&lt;br /&gt;echo password&gt;&gt; C:\Data\deleteFiles.txt&lt;br /&gt;echo cd /remotefolder&gt;&gt; C:\Data\deleteFiles.txt&lt;br /&gt;echo bin&gt;&gt; C:\Data\deleteFiles.txt&lt;br /&gt;Forfiles -p &quot;C:\Data\Files&quot; -m *.* -c &quot;cmd /c echo del @file&gt;&gt; C:\Data\deleteFiles.txt&quot;&lt;br /&gt;echo bye&gt;&gt; C:\Data\deleteFiles.txt&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This creates a file similar to this&lt;br /&gt;&lt;span style=&quot;font-family:courier new;color:#3366ff;&quot;&gt;username&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;color:#3366ff;&quot;&gt;password&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;color:#3366ff;&quot;&gt;cd /remotefolder&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;color:#3366ff;&quot;&gt;bin&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;color:#3366ff;&quot;&gt;del &quot;filename1&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;color:#3366ff;&quot;&gt;del &quot;filename2&quot; etc&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;color:#3366ff;&quot;&gt;bye&lt;/span&gt;&lt;br /&gt;4) Final step is to create Del_FTP.bat which simply calls the FTP command with our newly created script file. &lt;br /&gt;&lt;span style=&quot;font-family:courier new;color:#3366ff;&quot;&gt;cd C:\Data\&lt;br /&gt;FTP -i -s:C:\Data\deleteFiles.txt ftp.xxx.xxx&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;color:#3366ff;&quot;&gt;&lt;/span&gt;

&lt;br/&gt;
Now of course this is all a lot easier with &lt;a href=&quot;http://camerontownshend.blogspot.com.au/2015/11/using-powershell-ftp-client-to-download.html&quot;&gt;PowerShell&lt;/a&gt;, if you are so inclined.</description><link>http://camerontownshend.blogspot.com/2011/02/mget-with-delete-for-ftp.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-4722933790897926316</guid><pubDate>Thu, 14 Aug 2008 05:59:00 +0000</pubDate><atom:updated>2008-08-14T15:59:52.294+10:00</atom:updated><title>Problems Installing SQL Server 2008 RTM</title><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;I&#39;ve spent a couple of days trying to install SQL Server 2008 RTM. I received the following error message.&lt;/p&gt;  &lt;p&gt;TITLE: Microsoft SQL Server 2008 Setup    &lt;br /&gt;------------------------------     &lt;br /&gt;The following error has occurred:     &lt;br /&gt;The process does not possess the &#39;SeSecurityPrivilege&#39; privilege which is required for this operation.     &lt;br /&gt;Click &#39;Retry&#39; to retry the failed action, or click &#39;Cancel&#39; to cancel this action and continue setup. &lt;/p&gt;  &lt;p&gt;For help, click: &lt;a href=&quot;http://go.microsoft.com/fwlink?LinkID=20476&amp;amp;ProdName=Microsoft+SQL+Server&amp;amp;EvtSrc=setup.rll&amp;amp;EvtID=50000&amp;amp;ProdVer=10.0.1600.22&amp;amp;EvtType=0xE32A4906%25400xB49B3A64&quot;&gt;http://go.microsoft.com/fwlink?LinkID=20476&amp;amp;ProdName=Microsoft+SQL+Server&amp;amp;EvtSrc=setup.rll&amp;amp;EvtID=50000&amp;amp;ProdVer=10.0.1600.22&amp;amp;EvtType=0xE32A4906%25400xB49B3A64&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;------------------------------    &lt;br /&gt;BUTTONS:     &lt;br /&gt;&amp;amp;Retry     &lt;br /&gt;Cancel     &lt;br /&gt;------------------------------&lt;/p&gt;  &lt;p&gt;When you go to the Microsoft link provided there is a very unhelpful error message.&lt;/p&gt;  &lt;p&gt;Details    &lt;br /&gt;&lt;b&gt;ID:&lt;/b&gt;     &lt;br /&gt;50000&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&lt;b&gt;Source:&lt;/b&gt;     &lt;br /&gt;setup.rll&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;We&#39;re sorry&lt;/p&gt;  &lt;p&gt;There is no additional information about this issue in the Error and Event Log Messages or Knowledge Base databases at this time. You can use the links in the Support area to determine whether any additional information might be available elsewhere.&lt;/p&gt;  &lt;hr /&gt;  &lt;p&gt;Thank you for searching on this message; your search helps us identify those areas for which we need to provide more information.&lt;/p&gt;  &lt;p&gt;----------------------&lt;/p&gt;  &lt;p&gt;Well anyway after a bit of searching it appears that the &#39;SeSecurityPrivilege&#39; is linked to the local security policy - &amp;quot;Manage auditing and security log&amp;quot;.&amp;#160; You can access this by going to Control Panel\Administrative Tools\Local Security Policy. Then link to Local Policies\User Rights Assignment\Manage auditing and security log\&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/cameron.townshend/SKPJyjYmpGI/AAAAAAAAACI/R2zom5Wm7mI/s1600-h/image%5B2%5D.png&quot;&gt;&lt;img style=&quot;border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px&quot; height=&quot;116&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/cameron.townshend/SKPJzXuW5hI/AAAAAAAAACM/xgRagf1K-V4/image_thumb.png?imgmax=800&quot; width=&quot;244&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;When you open that screen, you will see that your current account is not authorised to Manage auditing and security logs, this will cause the SQL Server 2008 install to fail. To rectify this, you will have to add your user or group to this list.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/cameron.townshend/SKPJz0Lx3pI/AAAAAAAAACQ/-hsxOwc3Xrs/s1600-h/image%5B5%5D.png&quot;&gt;&lt;img style=&quot;border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px&quot; height=&quot;244&quot; alt=&quot;image&quot; src=&quot;http://lh5.ggpht.com/cameron.townshend/SKPJ0XMEakI/AAAAAAAAACU/0KVxDVi0CkY/image_thumb%5B1%5D.png?imgmax=800&quot; width=&quot;206&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Notice however that the &amp;quot;Add user or group&amp;quot; is disabled on my machine. This is because my PC is a member of a domain and this setting is set by the Domain administrator and not configurable by an end-user. This is despite my account actually being both a local and domain admin. You will have to get your domain administrator to add a group that you belong to into this role in the domain. After rebooting your machine to pick up the new privileges from the domain controller you will be able to install SQL Server 2008 successfully.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://lh5.ggpht.com/cameron.townshend/SKPJ1Bp9iRI/AAAAAAAAACY/yOF6kCD5LHI/s1600-h/image%5B8%5D.png&quot;&gt;&lt;img style=&quot;border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px&quot; height=&quot;184&quot; alt=&quot;image&quot; src=&quot;http://lh4.ggpht.com/cameron.townshend/SKPJ17_55vI/AAAAAAAAACc/ezHzzSfHNjQ/image_thumb%5B2%5D.png?imgmax=800&quot; width=&quot;244&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;:) &lt;/p&gt;  </description><link>http://camerontownshend.blogspot.com/2008/08/problems-installing-sql-server-2008-rtm.html</link><author>noreply@blogger.com (Cameron Townshend)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/cameron.townshend/SKPJzXuW5hI/AAAAAAAAACM/xgRagf1K-V4/s72-c/image_thumb.png?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-1512974518006029103</guid><pubDate>Fri, 18 Jul 2008 06:12:00 +0000</pubDate><atom:updated>2008-07-18T16:12:31.058+10:00</atom:updated><title>format string in MSAccess</title><description>&lt;p&gt;I recently trained some users in how to use the Format function in Microsoft Access. They wanted a definitive list of what the format strings could be. So it&#39;s probably not possible to document every single combination, however the new Microsoft Access 2007 online help does document a large number of really useful types. Go to Microsoft Office help Online &lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a title=&quot;http://office.microsoft.com/client/helppreview.aspx?AssetID=HV012026591033&amp;amp;ns=MSACCESS.DEV&amp;amp;lcid=3081&amp;amp;QueryID=gRnDnXje30&amp;amp;respos=1&quot; href=&quot;http://office.microsoft.com/client/helppreview.aspx?AssetID=HV012026591033&amp;amp;ns=MSACCESS.DEV&amp;amp;lcid=3081&amp;amp;QueryID=gRnDnXje30&amp;amp;respos=1&quot;&gt;http://office.microsoft.com/client/helppreview.aspx?AssetID=HV012026591033&amp;amp;ns=MSACCESS.DEV&amp;amp;lcid=3081&amp;amp;QueryID=gRnDnXje30&amp;amp;respos=1&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Here is an excerpt.&lt;/p&gt;  &lt;p&gt;Returns a &lt;b&gt;Variant&lt;/b&gt; (&lt;b&gt;String&lt;/b&gt;) containing an &lt;a href=&quot;http://office.microsoft.com/search/redir.aspx?AssetID=HV012009291033&amp;amp;CTT=5&amp;amp;Origin=HV012026591033&quot;&gt;expression&lt;/a&gt; formatted according to instructions contained in a format expression.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Format&lt;/b&gt;(&lt;i&gt;expression&lt;/i&gt;[, &lt;i&gt;format&lt;/i&gt;[, &lt;i&gt;firstdayofweek&lt;/i&gt;[, &lt;i&gt;firstweekofyear&lt;/i&gt;]]])&lt;/p&gt;  &lt;p&gt;The &lt;b&gt;Format&lt;/b&gt; function syntax has these parts:&lt;/p&gt; q  &lt;br /&gt;Display the quarter of the year as a number (1 &amp;#8211; 4).  </description><link>http://camerontownshend.blogspot.com/2008/07/format-string-in-msaccess.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item></channel></rss>