Thursday, February 5, 2009

Customize Table from string Data in Sqlserver

Hi,
Now let's to discus how we can create a customize Table in Sqlserver.
while my work i face a problem of filterization of employee code.I have to filter some record based on the employee code.
I was passing multiple employeecode to the procedure which datatype is bigint.
so passed the employeecode as a varchar to the procedure by separating ',' .
so let's see how i solve this problem.
for example :
EmployeeCodes : 1,2,3,4

create Procedure USP_Filter_Employees
@EmpCode Varchar(100)
As
DECLARE @idoc int
set @
EmpCode ='< col > < r > '+@EmpCode
select @EmpCode =replace (@EmpCode ,',' ,'</r ><r >' )+'<r></col>'

EXEC sp_xml_preparedocument @idoc OUTPUT, @EmpCode
select * from EmployeeDetails where EmployeeCode in
(
SELECT cast(cast (text as varchar) as bigint)FROM OPENXML (@idoc, '/col/r',3) where text is not null
)
End



Thursday, April 17, 2008

Success........

Behiend of Success is Difficulty.
Something difficult is neither easy nor impossible. It requires skills, effort, attention, but still the result is not guaranteed.
"Difficulty" is a key concept for a new economics, because mainstream neoclassical economics distiguishes only what feasible from what impossible, without allowing this intermediate category so relevant in reality.
People face difficult tasks, thus have to cope with them by learning, technology, social networking, etc. To a large extent, the fact that acquiring information, elaborating it, delivering a proposal that matches conflicting criteria are all difficult tasks constitutes the rationale for bounded rationality and its simplifying routines.
In another vein, there is an important relation between difficulty and motivation. A slightly more difficult task than the present skill level would guarantee is particularly motivating: too easy or impossible tasks are less motivating that challenging tasks.