Wednesday, March 14, 2012

pass parameters to validator client side.

 function ValidateLanguageCheckBoxList(sender, args) {
     ......
     var t = sender.initValidator;
     args.IsValid = false;
    .......
  }


ScriptManager.RegisterExpandoAttribute(CheckListRequiredValidator, CheckListRequiredValidator.ClientID, "initValidator", "true", true);

Wednesday, March 7, 2012

job permission

jobs are running with agency account. when using dynamic sql, you have set sp 
WITH EXECUTE AS OWNER or grant the SELECT permission to agency account.

Friday, March 2, 2012

Reseed a table

SQL SERVER – DBCC RESEED Table Identity Value – Reset Table Identity

DBCC CHECKIDENT can reseed (reset) the identity value of the table. For example, YourTable has 25 rows with 25 as last identity. If we want next record to have identity as 35 we need to run following T SQL script in Query Analyzer.
DBCC CHECKIDENT (yourtable, reseed, 34)
If table has to start with an identity of 1 with the next insert then table should be reseeded with the identity to 0. If identity seed is set below values that currently are in table, it will violate the uniqueness constraint as soon as the values start to duplicate and will generate error.