Monday, February 13, 2012

Using MultiValue Parameters with Stored Procedures

Eg: Select ProductID, Name From Production.Product p Where p.color in (@parameter)
 
select ProductID, Name from Production.Product p where p.Color in (SELECT Val from dbo.fn_String_To_Table(@parameter,',',1))


CREATE FUNCTION [dbo].[fn_String_To_Table] (
            @String VARCHAR(max), /* input string */
   @Delimeter char(1),   /* delimiter */
   @TrimSpace bit )      /* kill whitespace? */
RETURNS @Table TABLE ( [Val] VARCHAR(4000) )
AS
BEGIN
    DECLARE @Val    VARCHAR(4000)
    WHILE LEN(@String) > 0
    BEGIN
        SET @Val    = LEFT(@String,
             ISNULL(NULLIF(CHARINDEX(@Delimeter, @String) - 1, -1),
             LEN(@String)))
        SET @String = SUBSTRING(@String,
             ISNULL(NULLIF(CHARINDEX(@Delimeter, @String), 0),
             LEN(@String)) + 1, LEN(@String))
  IF @TrimSpace = 1 Set @Val = LTRIM(RTRIM(@Val))
    INSERT INTO @Table ( [Val] )
        VALUES ( @Val )
    END
    RETURN
END

Monday, January 30, 2012

windows mobile 6.5 disable autocomplete

To disable autocomplete function :
change the following registry entry and do a Warmboot.

Before edit the registry, must unlock the registry first !!!
[HKEY_CURRUNT_USER\ControlPanel\Sip]
"SuggWords"=dword:00000000


Remote Edit Registry : CeRegEditor
Main features:
- keys/values create and edit
- fast search
- export/import keys to/from REG file
- create "image" registry with compare and restore service
- free for private and commercial use
- registry compare to CAB or REG files
- open REG/RGU, CAB, HV as regular registry, with all edit functions available
...and many more

link to web site: http://ceregeditor.mdsoft.pl?lang=en

link to software: http://ceregeditor.mdsoft.pl/ceregedit_setup.exe

Tuesday, December 13, 2011

repair a BitLocker-protected drive

To repair a BitLocker-protected drive by using Repair-bde

  1. Open a Command Prompt window as an administrator.
    1. To do this, click Start, type cmd in the Search programs and files box, right-click cmd.exe, and then click Run as administrator.
    2. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Yes.
  2. At the command prompt, type one of the following commands, depending on which recovery information you want to use:
    1. To repair using a recovery password:

      repair-bde C: Z: -rp 062612-026103-175593-225830-027357-086526-362263-513414
    2. To repair using a recovery key:

      repair-bde C: Z: -rk F:\RecoveryKey.bek
    3. To repair using a recovery package and the corresponding recovery password:

      repair-bde C: Z: -kp F:\ExportedKeyPackage -rp 062612-026103-175593-225830-027357-086526-362263-513414
    4. To repair using a recovery package and the corresponding recovery key:

      repair-bde C: Z: -kp F:\ExportedKeyPackage -rk F:\RecoveryKey.bek
:- C: - Repair Drive , Z: Drive to store recovery information and must have enough capacity.

Paused BitLocker Fix
You may want to provide people the tools to resume a bitlocker process after it has been paused. I had to find the answer on the internet and then do some modifying to make it work.

This can be done by going to Start and opening the CMD. Then type: cscript %systemroot%\system32\manage-bde.wsf -resume DriveLetter:

There are also a variety of other things that can be checked by viewing the parameter list:
cscript %systemroot%\system32\manage-bde.wsf -?