- @@CONNECTIONS - return the number of connections since sql server was started.
- @@CPU_BUSY
- return the time in milliseconds that the CPU has been actively doing work since
sql server was started. - @@CURSOR_ROWS - the number of rows currently in the last cursor set opened on the current connection.
- @@DATEFIRST
- returns the numeric value that corresponds to day of week.
1 -> Monday to 7 -> Sunday - @@DBTS - returns the last used timestamp for the current database.
- @@ERROR - Return the error code of the last sql statement
- @@IDENTITY - returns the identity value of the last sql insert statement.
- @@FETCH_STATUS - return the indicator of the of the last cursor fetch operation.
- Replication is the process of automatically doing what, in a very loose sense, amount of copying some or all the information in your database to some other database. The other database may be on the same physical machine as the original, or it may be located remotely.
- To View the total table in database SELECT NAME FROM SYSOBJECTS WHERE TYPE='U'
- Stored Procedure with output parameter Create Proc USP_GetEmpDetails
- Normalization: The process of organizing data to minimize redundancy is called normalization.
- De-Normalization:
De-normalization is the process of attempting to optimize the performance of a database by adding redundant data. - Use SET NOCOUNT ON/OFF while using SELECT and Other DML Commands.
- Use Schema Name with Object Name while writing the Stored Procedures(Sql Server 2005)
e.g.SELECT EMPNO, NAME FROM Dbo.EMPLOYEE - Do not use the prefix “sp_Trans” in the stored procedure name. Use like
"USP_Trans"
E.g.
CREATE PROC dbo.ProcName
AS
SET NOCOUNT ON;
--Procedure code here
SELECT column1 FROM dbo.TblTable1
-- Reset SET NOCOUNT to OFF
SET NOCOUNT OFF;
GO



0 comments:
Post a Comment