This video explains the concept of MVC software architecture pattern, stands for Model View Controller.
Tec Lab
Technical help Lab for developers
Saturday, August 31, 2013
Wednesday, July 24, 2013
Sunday, December 23, 2012
ORACLE IS_MEMBER function like in SQL SERVER
CREATE OR REPLACE FUNCTION IS_MEMBER( USER_ID Varchar )
RETURN NUMBER IS
dResult NUMBER;
sLoginUser Varchar(200);
BEGIN
dResult :=0;
SELECT user into sLoginUser from dual;
IF upper(sLoginUser)= upper(USER_ID) THEN
dResult :=1;
END IF;
RETURN dResult;
END;
/
Wednesday, November 7, 2012
Monday, November 5, 2012
Wednesday, August 8, 2012
Sunday, July 8, 2012
Wednesday, May 2, 2012
Sunday, November 20, 2011
Find the error in following
|
Wednesday, June 15, 2011
Monday, January 10, 2011
How reducing the sql server database log file
1. Login to the SQL server 2005 under "sa" login. Then run the following command
2. Take a full backup of the database.
3. Now run the following.
USE <write the database name>;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE <write the database name>
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 10 MB.
DBCC SHRINKFILE (<Database Logical Name>, 10);
GO
-- Reset the database recovery model.
ALTER DATABASE <write the database name>
SET RECOVERY FULL;
GO
NOTE : if the database recovery model was originally SIMPLE, then change it to SIMPLE after running the above script.
But if it is originally "FULL", then no need to change it again. Because the above script automatically change it to "FULL".
Tuesday, October 19, 2010
Tuesday, October 5, 2010
Accessing Oracle 9i Stored Procedures Using ADO.NET
Accessing Oracle 9i Stored Procedures Using ADO.NET
Sunday, October 3, 2010
How To Obtain The Size Of All Tables In A SQL Server Database
SET NOCOUNT ON
DBCC UPDATEUSAGE(0)
-- DB size.
EXEC sp_spaceused
-- Table row counts and sizes.
CREATE TABLE #t
(
[name] NVARCHAR(128),
[rows] CHAR(11),
reserved VARCHAR(18),
data VARCHAR(18),
index_size VARCHAR(18),
unused VARCHAR(18)
)
INSERT #t EXEC sp_msForEachTable 'EXEC sp_spaceused ''?'''
SELECT *
FROM #t
-- # of rows.
SELECT REPLACE(data,'KB','') FROM #t --order by data
alter table #t add data_1 numeric(18,2)
UPDATE #t SET data_1=convert(numeric(18,2),REPLACE(data,'KB',''))
SELECT * FROM #t order by data_1
DROP TABLE #t
Thursday, September 30, 2010
How to export the data to existing EXCEL file from the SQL Server table
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926
IF EXISTS (SELECT srv.name FROM sys.servers srv WHERE srv.server_id != 0 AND srv.name = N'XLS')EXEC master.dbo.sp_dropserver @server=N'XLS', @droplogins='droplogins'
GO
EXEC sp_addlinkedserver N'XLS', 'Jet 4.0','Microsoft.Jet.OLEDB.4.0','c:\testing.xls',NULL,'Excel 5.0;
declare @text VARCHAR(400)
SET @text='HBS '
insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 5.0;Database=c:\testing.xls;', 'SELECT * FROM [Sheet1$]') select EMP_NUMBER, emp_calling_name ,@text TEXT from DSI.hs_hr_employee --where emp_number='000001'
Sunday, September 26, 2010
Tuesday, July 13, 2010
Monday, May 10, 2010
Great Recursive SQL SELECT
Check this out
Select HIE_NAME,HIE_CODE,HIE_COST_CENTRE FROM HS_HR_HIERARCHY
CONNECT BY
PRIOR HIE_CODE = HIE_RELATIONSHIP START WITH HIE_CODE = '013'
http://www-128.ibm.com/developerworks/db2/library/techarticle/0307steinbach/
0307steinbach.html
Select HIE_NAME,HIE_CODE,HIE_COST_CENTRE FROM HS_HR_HIERARCHY
CONNECT BY
PRIOR HIE_CODE = HIE_RELATIONSHIP START WITH HIE_CODE = '013'
http://www-128.ibm.com/developerworks/db2/library/techarticle/0307steinbach/
0307steinbach.html
Subscribe to:
Posts (Atom)