2008-10-09

දැනට ක්‍රියාත්මක යූද හමූදාවේ රෙජිමේන්තු

  1. සන්නාහ සන්නද්ධ බලකාය
  2. කාලතුවක්කු හමූදාව
  3. ඉංජිනේරු බලකාය
  4. සංඥා බලකාය
  5. පාබල හමූදාව
  6. සිංහ රෙජිමේන්තුව
  7. ගැමූණූ හේවා බලකාය
  8. ගජබා රෙජිමේන්තුව
  9. විජයබාහූ රෙජිමේන්තුව
  10. යාන්ත්‍රික පාබල රෙජිමේන්තුව
  11. කමාන්ඩෝ රෙජිමේන්තුව
  12. සන්නද්ධ බූද්ධි බලකාය
  13. ඉංජිනේරු සේවා බලකාය
  14. සේවා බලකාය
  15. වෛද්‍ය බලකාය
  16. යූධෝපකරණ බලකාය
  17. විදුලි හා යාන්ත්‍රික ඉංජිනේරු බලකාය
  18. පොලිස් හේවා බලකාය
  19. පොදු සේවා බලකාය
  20. කාන්තා බලකාය
  21. රයිපල් බලකාය
  22. ජාතික ආරක්ෂක බලමූළුව
  23. පූරෝගාමී බලකාය.

2008-09-26

Adding a column with row numbers to the sql Table

THE SQL Code is as follows for without column No field:

SELECT ALSubject FROM Subject_Table



SUBJECTS

Accountancy
Applied Maths
Buniness Studies
Economics
Statistics
Zoology


*********************************************************
The code sql code with adding a column
method:-1
SELECT Row_Number() OVER (order by ALSubject asc) as ID,t.ALSubject As Name FROM ( SELECT ALSubject FROM Subject_Table) t
method:-1
SELECT Row_Number() OVER (order by ALSubject asc) as ID , ALSubject AS Name FROM Subject_Table where ALSubject<>'' group by ALSubject


ID NAME
1 Accountancy
2 Applied Maths
3 Business Studies
4 Economics
5 Statistics
6 Zoology

2008-09-22

Check table Existence in SQL

IF OBJECT_ID ('DATABASE_NAME.dbo.TABLE_NAME','U') IS NOT NULL
BEGIN
--do any thing if the table exists
ELSE
--do any thing if the table dose not exists
END
********************************************************************
'U':- Is a symbol for identifying a table in SQL

2008-09-09

සුද්දා අපේ MORAL කඞපු භැටි

දන්නවද පරන්ගියා මුල්ලේරියාවෙ මානසික රොහලක් හෑදුවේ ඇයි කියලා.......
II රාජසිංහ රජ්ජුරුවො පරන්ගියාට මුල්ලේරියාවෙ තමයි එලව එලව ගෑහුවේ. හරියටම කියනවානම් මුල්ලේරියාවෙ වෙලේ තමයි සටන අතිවෙලා තියෙන්නේ.ඉතින් මේ සටනේ දි තාම ඉතිහාස සදහන් වන විදිහට සුද්දේ ලබපු දෙවනි ලොකුම පරාජය.පලවෙනි එක තාම වියට්නාමයේ දි වියට්නාම ජාතිකයන් ප්‍රන්ස කාරායා එරෙහිව ලබපු ජය.හෑබයි එකත් තුවකුවේ පිහිටෙන් තමා.

2008-09-03

How to analyze without using SQL CURSORs

##First study how to handle data using a CURSOR ##

--Code Start
DECLARE get_Details CURSOR FOR

CREATE TABLE #Temp(Stu_id bigint,
Stu_No nvarchar,
Stu_Name nvarchar)

OPEN get_Details

DECLARE @id bigint
DECLARE @Stu_No nvarchar(64)
DECLARE @Stu_Name nvarchar(100)

FETCH NEXT FROM get_Details INTO @Stu_NO

WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @id =id,@Stu_NO = NO,@Stu_Name = firstname,FROM aca_User WHERE id = @Stu_NO

INSERT INTO #Temp ( Stu_id,Stu_NO,Stu_Name) VALUES (@id,@Stu_NO,@Stu_Name)
FETCH NEXT FROM get_Details INTO @Stu_NO END


CLOSE get_Details
DEALLOCATE get_Details


SELECT * FROM #Temp


--Code is End

##Then know about that the same thing can do without using sql Cursor's
Because the cursor want higher memory usage of the RAM & then it produced more lower performance##


drop table EMPLOYEE2
SELECT ROWID=IDENTITY(int,1,1),userid
INTO EMPLOYEE2 FROM aca_role_assignments WHERE (roleid = @roleid) AND (contextid = @contexid) ORDER BY id

declare @rowcount int,
@counter int
SET @rowcount = (SELECT count(userid) FROM aca_role_assignments
WHERE (roleid =@roleid) AND (contextid = @contexid))

CREATE TABLE #Temp( Stu_id bigint,
Stu_NO nvarchar(100), Stu_Name nvarchar(100))

DECLARE @id bigint
DECLARE @Stu_NO nvarchar(100)
DECLARE @Stu_Name nvarchar(100)

set @counter = 1
while @counter <= @rowcount begin SELECT @id =id, @Stu_NO = firstname, @Stu_Name = lastname, from aca_user where id =(SELECT userid FROM EMPLOYEE2 WHERE ROWID=@counter) INSERT INTO #Temp ( Stu_id, Stu_NO,Stu_Name) VALUES (@id, @Stu_NO,@Stu_Name) set @counter = @counter + 1 end DELETE FROM aca_StudentSpecficCourse SELECT * FROM #Temp

2008-08-31

GET & USE Sinhala Unicode

USE THIS LINK. This site is maintain under ICTA Project:

http://siyabas.lk/sinhala_how_to_install.html


ONLINE KEYBOARD:http://www.ucsc.cmb.ac.lk/ltrl/services/keyboard/

LAYOUT of the Sinhala KEYBOARD:http://www.siyabas.lk/docs/sin-kbd-layout5.pdf

2008-08-20

Sinhala Custom Messages

*අතීතය සිහිනයක් පමනයි සැබෑ සුවයක් නැත......
*නයි කයිද රෝස් පාන්
*වලාවක් සේ අයාලේ ගිය සිතට නිවහන ඔබ ළගයි.....
*ජීවිතය යනු ඵනු ගෙඬියකි.
ලෙල්ලෙන් ලෙල්ල ගලවා ගෙන යාමේදී ඉතිරි වෙන දෙයක් නැත....
* මං මුලා වී පාර සොයා ගෙන කතරක් ඈතින් යන ඟමනේ
මං මුලා වු සමනලියකගෙනි පාර අසා සිටියේ...
* සමුගන්නට නම් අහිමි වූ ආදරෙයන් මෙලෙස....
ඉවසම් ද මගේ ෙසාදුරිෙය්, ෙම් දුක කෙලස.......
* ඉහිරුනු කිරි කොතලෙට ඉකි බිදලා පල නැහැ
නුඹට පිහාටුයි මට පැල්පතයි තියෙන්නේ........
* ඔබට වරම් නැති මටද වරම් නැති සෙහහස කොතැනද සැගව ගියේ
ඉවත ගලා ගිය කදුලක දියවි ප්‍රථම ප්‍රේමයැ යි බොදව ගියේ......
* ගල් ලෙන broken
ලෙන් දොර opened
Lion භා...//
මම were know that
මම suspected
සිංහ Ba//
* සබද අපි කදු නොවෙමු උනුනුන් පරයා නෑගෙන නිසල දිය දහර වෙමු එකම ගගකට ගලන....
* LIVE FREE OR DIE HARD..................................
* U Die a Hero OR Live long enough to Became a VILLAIN!!!!!!!!!!
*there are no boundaries in this struggle to the death. we cannot be indifferent to what happens any where in the world,for a victory by any country over imperialism is our victory ;just as any country's defeat is a defeat for all of us.
*වලාවක් ලෙසින් මා
ඈදෙද්දි අයාලේ
ඔබෙන් එක් ලෑබුයේ
හේමන්ත කලේ..............
*පිළිම නෙළා නැති විරුවන් පිරිසක්
සැමරුම් දින නැති විරුවන් පිරිසක්
සැතපෙන බව පස් කඳු යට රහසේ
මිහිකත කම්පාවී – පුපුරා දෙස් දේවී

SQL Query Stuff

1 . By using this query can search any string contain within stored procedure, function or view SELECT object_name(id) FROM sys.sysc...