Posts

Showing posts from September, 2024

How to restore a Database

Triggers

Stored Procedure

 To Create : WithOut Params: CREATE PROCEDURE <stored procedure name> AS BEGIN <Query/Logic> END; With Params: CREATE PROCEDURE <stored procedure name> (      @prameter1 name  datatype,      @prameter2 name datatype, ) AS BEGIN <Query/Logic> END; To Declare: Same as Create but in the place of Create line put DECLARE and remove AS  DECLARE (      @prameter1 name  datatype = value,      @prameter2 name datatype = value, ) BEGIN <Query/Logic> END; To Update/Modify: Same as Create but in the place of Create line put Modify To view: sp_helptext <stored procedure name> To Exec: WithOut Params EXEC <stored procedure name> With Params EXEC <stored procedure name> @prameter1 name = value, @prameter2 name = value

Other Functions

 App_Name() Cast() Coalesce() Collationproperty() Columns_Updated() Convert() Current User Datalength() @@Error fn_Helpcollations() fn_lndexinfo() :.fn Servershareddrives :.fn Virtualservernodes Formatmessage() Getansinull() Host_ld() Host_Name() Ident_Current() Ident_lncr() Ident_Seed() @@ldentity Identity() (Select Into) Isnull() Isnumeric() Newid() Nullif() Parsename() Permissions() @@Rowcount Rowcount_Big() Scope_ldentity() Serverproperty() Sessionproperty() Session_User Stats_Date() System_lJser @@Trancount Update() User_Name()

Mathematical Functions

 Abs() Acos() Asin() Atan() Atn2() Ceiling() Cos() Cot() Degrees() Exp() Floor() Log() Log10() Power() Radians() Rand() Round() Sign() Sin() Sqrt() Square() Tan()