Thursday, July 2, 2015
Monday, June 29, 2015
Jquery add href to a tag
$('#workFlowlink1').attr('href', '#');
$('#workFlowlink2').attr('href', '#');
$('#workFlowlink1').attr('href', '../Webpages/Workflow.aspx');
$('#workFlowlink2').attr('href', '../Webpages/Workflow.aspx');
$('#workFlowlink2').attr('href', '#');
$('#workFlowlink1').attr('href', '../Webpages/Workflow.aspx');
$('#workFlowlink2').attr('href', '../Webpages/Workflow.aspx');
Thursday, June 18, 2015
SQL nested case when then
CASE
WHEN alertcon.alert_type = 'E'
THEN
CASE
WHEN alertgat.gateway_id = 'M' THEN escUser.login_id
WHEN alertgat.gateway_id = 'E' THEN escUser.email_id
ELSE ''
END
WHEN alertcon.alert_type = 'R'
THEN
CASE
WHEN alertgat.gateway_id = 'M' THEN escUser.login_id
WHEN alertgat.gateway_id = 'E' THEN escUser.email_id
ELSE ''
END
END as Recepient
WHEN alertcon.alert_type = 'E'
THEN
CASE
WHEN alertgat.gateway_id = 'M' THEN escUser.login_id
WHEN alertgat.gateway_id = 'E' THEN escUser.email_id
ELSE ''
END
WHEN alertcon.alert_type = 'R'
THEN
CASE
WHEN alertgat.gateway_id = 'M' THEN escUser.login_id
WHEN alertgat.gateway_id = 'E' THEN escUser.email_id
ELSE ''
END
END as Recepient
Tuesday, June 16, 2015
Monday, June 15, 2015
Static Cursors
A static cursor populates the result set at the time of cursor creation and query result is cached for the lifetime of the cursor. A static cursor can move forward and backward direction. A static cursor is slower and use more memory in comparison to other cursor. Hence you should use it only if scrolling is required and other types of cursors are not suitable.
No UPDATE, INSERT, or DELETE operations are reflected in a static cursor (unless the cursor is closed and reopened). By default static cursors are scrollable. SQL Server static cursors are always read-only.
- SET NOCOUNT ON
- DECLARE @Id int
- DECLARE @name varchar(50)
- DECLARE @salary int
- DECLARE cur_emp CURSOR
- STATIC FOR
- SELECT EmpID,EmpName,Salary from Employee
- OPEN cur_emp
- IF @@CURSOR_ROWS > 0
- BEGIN
- FETCH NEXT FROM cur_emp INTO @Id,@name,@salary
- WHILE @@Fetch_status = 0
- BEGIN
- PRINT 'ID : '+ convert(varchar(20),@Id)+', Name : '+@name+ ', Salary : '+convert(varchar(20),@salary)
- FETCH NEXT FROM cur_emp INTO @Id,@name,@salary
- END
- END
- CLOSE cur_emp
- DEALLOCATE cur_emp
- SET NOCOUNT OFF
Subscribe to:
Posts (Atom)