This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare @SomeString varchar(30) | |
set @SomeString='ABC-AB-B-ABC-ABCD-0001-001-X' | |
-- We are searching for last occurrence of '-' in @SomeString | |
select LEN(@SomeString)-(CHARINDEX('-',REVERSE(@SomeString))) as LastOccuranceIndex | |
--LastOccuranceIndex should return 26 :P |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="ArrayOfStructuresToQuery" access="public" returntype="query" output="false"> | |
<cfargument name="StructArray" type="any" required="true" /> | |
<cfscript> | |
KeyList=StructKeyList(arguments.StructArray[1]); | |
qbook = QueryNew(KeyList); | |
for(i=1; i <= ArrayLen(arguments.StructArray); i=i+1){ | |
QueryAddRow(qbook); | |
for(y=1;y lte ListLen(KeyList);y=y+1){ | |
QuerySetCell(qbook, ListGetAt(KeyList,y), arguments.StructArray[i][ListGetAt(KeyList,y)]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="GetMaxValueOfKeyInStructArray" access="public" returntype="numeric" output="false"> | |
<cfargument name="StructArray" type="any" required="true" /> | |
<cfargument name="StructKey" type="any" required="true" /> | |
<cfscript> | |
sqlMax=0; | |
temp=0; | |
for(i=1; i <= ArrayLen(arguments.StructArray); i=i+1){ | |
if(StructFind(arguments.StructArray[i], "#arguments.StructKey#")){ | |
temp=StructFind(arguments.StructArray[i], "#arguments.StructKey#"); | |
if(temp>sqlMax){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use database_name | |
declare @i int | |
set @i = 0 | |
while (@i<99) | |
begin | |
declare @table_name varchar(100) | |
declare table_list cursor for | |
select name from sysobjects o2 where xtype='U' and | |
not exists ( | |
select * from sysforeignkeys k |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>HTML5 Page</title> | |
</head> | |
<body> | |
<header> | |
<nav> | |
<!-- Menu --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
objContactsMeta = getComponentMetaData('path.to.component'); | |
</cfscript> | |
<cfdump var="#objContactsMeta#" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [master] | |
GO | |
/****** Object: StoredProcedure [dbo].[kill_database_users] Script Date: 11/08/2012 19:24:32 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
create PROCEDURE [dbo].[kill_database_users] @arg_dbname sysname with recompile | |
AS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ============================================= | |
-- Author: Nenad Kostic | |
-- Create date: 11/29/2012 | |
-- Description: Backup Instance | |
-- Big Thanks : Dragan Zdravkovic | |
-- ============================================= | |
USE MASTER | |
DECLARE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ECHO OFF | |
CLS | |
:MENU | |
ECHO. | |
ECHO ............................................... | |
ECHO SELECT SERVER or 0 to EXIT. | |
ECHO ............................................... | |
ECHO. | |
ECHO 1 - BACKUP INSTANCE SERVERNAME\INSTANCENAME | |
ECHO 0 - EXIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content> | |
<![CDATA[ | |
<cfcomponent | |
displayname="Application" | |
output="true" | |
hint="Handle the application."> | |
OlderNewer