<?xml version="1.0" encoding="UTF-8" standalone="no"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-1376516553035122580</atom:id><lastBuildDate>Thu, 24 Oct 2024 14:55:48 +0000</lastBuildDate><category>mssql</category><category>coldfusion</category><title>Kris blog</title><description></description><link>http://cfkris.blogspot.com/</link><managingEditor>noreply@blogger.com (Unknown)</managingEditor><generator>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><language>en-us</language><itunes:explicit>no</itunes:explicit><itunes:subtitle/><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-8350531266155278713</guid><pubDate>Wed, 17 Mar 2010 16:06:00 +0000</pubDate><atom:updated>2010-03-17T18:07:43.886+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mssql</category><title>SQL prime numbers</title><atom:summary type="text">The following function returns the prime numbers of a list of numberCREATE FUNCTION dbo.PrimeNumbers(@NumberList nvarchar(max))RETURNS nvarchar(max)ASBEGINdeclare @pdv as nvarchar(150)set @pdv = ''select @pdv = @pdv + value + ','from (select s.value,case when exists(select 1 from dbo.fn_t_dstring2table(@NumberList, ',') dwhere cast(d.value as numeric(18,2)) &lt; cast(s.value as numeric(18,2)) and </atom:summary><link>http://cfkris.blogspot.com/2010/03/sql-prime-numbers.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-20328872913878778</guid><pubDate>Sun, 28 Feb 2010 09:09:00 +0000</pubDate><atom:updated>2010-02-28T17:43:49.053+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mssql</category><title>Convert Arabic numbers in SQL 2005</title><atom:summary type="text">The following function converts arabic numbers (nvarchar) to digital numbersAlter Function [dbo].[Convert_Arabic_To_Decimal](  @String nvarchar(100))Returns numeric(20,6)asBEGIN declare @String2 nvarchar(100) declare @rtrn as numeric(20,6) declare @iMode as smallint declare @bMode as smallint declare @Digit as numeric(18,6) set @String2 = @String set @rtrn = 0 set @iMode = 1 set @bMode = 1 while </atom:summary><link>http://cfkris.blogspot.com/2010/02/convert-arabic-numbers-in-sql-2005.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-1028837831927019857</guid><pubDate>Sun, 28 Feb 2010 09:04:00 +0000</pubDate><atom:updated>2010-02-28T11:09:10.629+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mssql</category><title>Arabic numbers in SQL 2005</title><atom:summary type="text">The arabic numbers in SQL 2005 have unicode between 1632 - 1641 where 1632=0 and 1641=9, whoever when converting arabic numeric string to digit number the system usually confuse the NChar(1632) with NChar(1776), both character they look the same</atom:summary><link>http://cfkris.blogspot.com/2010/02/arabic-numbers-in-sql-2005.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-1196727552531697328</guid><pubDate>Sat, 27 Feb 2010 15:59:00 +0000</pubDate><atom:updated>2010-02-27T18:01:56.474+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mssql</category><title>listFind function in MS SQL 2005</title><atom:summary type="text">The following function locates the position of an element in a delimited listALTER FUNCTION [dbo].[listFind]( @List nvarchar(max), @Element nvarchar(150), @Delimiter nvarchar(10) = ',')RETURNS smallintASBEGIN declare @IndexPos int declare @CurrentElement nvarchar(150) declare @I int  declare @TemList nvarchar(max) set @TemList = @list if (len(@List)&lt;=0)  return 0 set @IndexPos = charIndex(@</atom:summary><link>http://cfkris.blogspot.com/2010/02/listfind-function-in-ms-sql-2005.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-3396143584952226502</guid><pubDate>Sat, 27 Feb 2010 15:49:00 +0000</pubDate><atom:updated>2010-02-27T17:57:15.993+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mssql</category><title>listGetAt functions in SQL 2005</title><atom:summary type="text">The following list return the element at the X position in a delimited sting listALTER FUNCTION [dbo].[listGetAt]( @List nvarchar(max),      -- delimited list @ElementPos int,  -- the element position @Delimiter nvarchar(10) = ',', -- the delimiter string @ReturnOnNotFound nvarchar(100) = null -- the default value if element does not exist)RETURNS nvarchar(100)ASBEGIN declare @StrartPos int </atom:summary><link>http://cfkris.blogspot.com/2010/02/listgetat-functions-in-sql-2005.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-2534191935831794780</guid><pubDate>Thu, 24 Jan 2008 08:05:00 +0000</pubDate><atom:updated>2008-02-18T16:08:12.496+02:00</atom:updated><title/><atom:summary type="text">You can convert a coldfusion string to a Java array of bytes using the .getBytes hidden function&amp;lt;Cfset variables.aBytes = variables.cString.getBytes() /&amp;gt;            </atom:summary><link>http://cfkris.blogspot.com/2008/01/you-can-convert-coldfusion-string-to.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-7364846566855511743</guid><pubDate>Thu, 03 Jan 2008 12:44:00 +0000</pubDate><atom:updated>2008-02-18T16:08:12.511+02:00</atom:updated><title/><atom:summary type="text">  Converting russian characters too URL hexadecimal charactersThe binary code should be of the following format   // The position in the Unicode table tells us how many bytes are needed.        // Note that if we talk about first, second, etc. in the following, we are        // counting from left to right:        //        //   Position in   |  Bytes needed   | Binary representation        //  </atom:summary><link>http://cfkris.blogspot.com/2008/01/converting-russian-characters-too-url.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-8826386568306635351</guid><pubDate>Thu, 03 Jan 2008 12:42:00 +0000</pubDate><atom:updated>2008-02-18T16:08:12.537+02:00</atom:updated><title/><atom:summary type="text">You can retrieve the last executed queries from the database using the querySELECT deqs.last_execution_time AS [Time], dest.text AS [Query],deqs.*FROM sys.dm_exec_query_stats AS deqsCROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS destORDER BY deqs.last_execution_time DESC  </atom:summary><link>http://cfkris.blogspot.com/2008/01/you-can-retrieve-last-executed-queries.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-7118120503290523516</guid><pubDate>Tue, 23 Oct 2007 15:53:00 +0000</pubDate><atom:updated>2007-10-23T17:54:26.330+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mssql</category><title>define trigger execution order</title><atom:summary type="text">sp_settriggerorder use for defining the After trigger execution order. You can specify only the first trigger to be executed and the last trigger to be executed.the syntax of the command issp_settriggerorder [ @triggername = ] '[ triggerschema. ] triggername'       , [ @order = ] 'value(First or Last)'       , [ @stmttype = ] 'statement_type ( Insert or update or delete)'       [ , [ @namespace =</atom:summary><link>http://cfkris.blogspot.com/2007/10/spsettriggerorder-use-for-defining.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-153121383420912147</guid><pubDate>Mon, 22 Oct 2007 15:59:00 +0000</pubDate><atom:updated>2007-10-22T18:02:57.975+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mssql</category><title>Update from</title><atom:summary type="text">You can use the Update from statement to update tables of one table from anotherfor example you have a table Employee_old_table (employee_id,employee_name,employee_lname)and e table employee_new_table (employee_id,employee_full_name,employee_first_name,employee_last_name)to set the employee order.employee_full_name = employee.employee_name + ' ' + employee_lnameyou can do thisupdate </atom:summary><link>http://cfkris.blogspot.com/2007/10/you-can-use-update-from-statement-to.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-5638785673031674213</guid><pubDate>Tue, 16 Oct 2007 15:54:00 +0000</pubDate><atom:updated>2007-10-19T17:47:02.488+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mssql</category><title>Return a value from a strore procedure value</title><atom:summary type="text">Store procedures can return value using a return statement in the store procedureyou can do something like thiscreate PROCEDURE dbo.test1    (        @iID int    )ASBEGIN    SET NOCOUNT ON;    Declare @iNewId int    set @iNewId = @iID + 1    return @iNewIdENDdeclare @iT  intexec @iT = dbo.test1 6print @iT</atom:summary><link>http://cfkris.blogspot.com/2007/10/return-value-from-strore-procedure.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-47337248548413165</guid><pubDate>Tue, 16 Oct 2007 07:45:00 +0000</pubDate><atom:updated>2007-10-19T17:47:15.598+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldfusion</category><title>Adding elements to a structure</title><atom:summary type="text">While I was playing with a request structure in coldfusion I come across a strange scenario with adding elements in the structureThere are 3 ways to add an element in the structure&amp;lt;cfset request.sMyStructre[elementid] = value /&amp;gt;&amp;lt;cfset structInsert(request.sMyStructre,elementid,value) /&amp;gt;&amp;lt;cfset request.sMyStructre.elementid = value /&amp;gt;Even though the result of those 3 commant 99% </atom:summary><link>http://cfkris.blogspot.com/2007/10/while-i-was-playing-with-request.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-4335426168034563797</guid><pubDate>Wed, 10 Oct 2007 16:30:00 +0000</pubDate><atom:updated>2007-10-19T17:48:08.435+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldfusion</category><title>ColdFusion 8 and MSSQL triggers</title><atom:summary type="text">Coldfusion 8 handles MSSQL triggers different that older versions of Coldfusion.IN older CFMXWe had some For insert triggers on tables for updating related tables etc.. The last trigger used to return the new identity using select SCOPE_IDENTITY() as @iNewRecthe cfquery was&amp;lt;cfquery name="qInsert" datasource="#myDSN#"&amp;gt;insert into tbl1 (name,fname)values('test1','test2') &amp;lt;/cfquery&amp;gt;Then </atom:summary><link>http://cfkris.blogspot.com/2007/10/coldfusion-8-handles-mssql-triggers.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-3700676670743966128</guid><pubDate>Mon, 08 Oct 2007 15:36:00 +0000</pubDate><atom:updated>2007-10-19T17:48:08.435+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldfusion</category><title>DateDiff in coldfusion does not work the same way as dateDiff in sql</title><atom:summary type="text">DateDiff in coldfusion does not work the same way as dateDiff in sqlI believe Coldfusion gets the different between date1 and date2 in ms and then converts this value to the date part that you specify on the dateDiff function. Sql subtracts the datepart value of date 1 from the date part value of date2.What does that meanDateDiff('d','2007/10/02','2007/12/01') in coldfusion is : 1 dateDiff(month,</atom:summary><link>http://cfkris.blogspot.com/2007/10/datediff-in-coldfusion-does-not-work.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-5946937260484279352</guid><pubDate>Wed, 03 Oct 2007 16:08:00 +0000</pubDate><atom:updated>2007-10-19T17:48:08.435+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldfusion</category><title>Calling public methods with in the component without 'this' is faster</title><atom:summary type="text">I did some testing  whether i should use this to call public methods with in the component and it seams that calling a public method with in the component is faster if you do not use the 'this' .I created 2 simple cfc that were calling internally a public function the one with this.function name and the other one the function name directly not using the this was faster for 15-20 %</atom:summary><link>http://cfkris.blogspot.com/2007/10/calling-public-methods-with-in.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-7608183642337104656</guid><pubDate>Wed, 19 Sep 2007 14:23:00 +0000</pubDate><atom:updated>2007-10-19T17:48:28.754+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mssql</category><title>MSSQL, - 2005 - search in the code of Store procedure,function, views and triggers</title><atom:summary type="text">We had an sql function that we didn't know if is used for anywhere, so we decided to remove it. There was no reference to the store procedure in our code so the only place remaining was the sql store procedures, functions and triggers and viewsTo do this we use the sql queryselect *from  sys.objectswhere type_desc in ('SQL_SCALAR_FUNCTION','VIEW','SQL_STORED_PROCEDURE','SQL_SCALAR_FUNCTION','</atom:summary><link>http://cfkris.blogspot.com/2007/09/mssql-2005-search-in-code-of-store.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-5794430870684376039</guid><pubDate>Mon, 17 Sep 2007 10:35:00 +0000</pubDate><atom:updated>2007-10-19T17:48:08.435+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldfusion</category><title>Query Of Queries is case sensitive</title><atom:summary type="text">I discover recently that Query of queries is case sensitive. to solve the problem  i use the function Lcase to convert the coldfusion variables to low case and the query function Lower to convert the query column to low case.                select *                from qQ2                where                    lower(column_1) = '#LCase(cF1)#'</atom:summary><link>http://cfkris.blogspot.com/2007/09/query-of-queries-is-case-sensitive.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1376516553035122580.post-5290864763912691082</guid><pubDate>Fri, 14 Sep 2007 08:40:00 +0000</pubDate><atom:updated>2007-10-19T17:48:08.435+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldfusion</category><title>ColdFusion 8 Bug - CronService fails with: whith listAll schedule task</title><atom:summary type="text">This is an error i found on CF 8 using the coldfusion.server.ServiceFactoryWhen you use the createObject("JAVA","coldfusion.server.ServiceFactory").getCronService().listAll() to get the list of schedule task on the server it doesn't return any newly added schedule tasks that were added with the cfschedule command (it return                         [undefined array element]) - however this is not </atom:summary><link>http://cfkris.blogspot.com/2007/09/cf8-bug-cronservice-fails-with-whith.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item></channel></rss>