Tags : String Functions,Sql Server 2005,Sql Server 2008.Hi Friends,in this article i would like to explain String Functions in SQL Server.* LEN (string) - Returns the length of the given string.For Example :select len(Address) as Address from Employee* LEFT (string, length) - Returns the specified number of characters from the beginning of the string.For Example :Select LEFT(Address,1) as Address from Employee* RIGTH (string, length) - Returns the specified number of characters from the end of the string.For Example :Select RIGHT(Address,2)...
Sunday, 31 July 2011
Saturday, 30 July 2011
How to start and stop triggers in sql server?
Tags : Enable Trigger,Disable Trigger,SQL Server 2005,SQL Server 2008,Triggers,Start,Stop.Hi Friends,in this post i would like to explain enabling and disabling triggers in SQL Server.* By writing Commands we can Start/Stop triggers in SQL Server.Enabling/Starting Trigger :Enable Trigger TriggerName ON database.dbo.tablename Disabling/Stopping Trigger :Disable Trigger TriggerName ON database.dbo.tablenameThank You...
SQL Server Triggers.
Tags : SQL Server 2005,SQL Server 2008,Triggers,DML Triggers,DDL Triggers,Logon Triggers.Hi Friends,in this post i would like to explain Triggers in SQL Server.* It is one kind of stored procedure, but triggers neither accept nor return any values.* Trigger is an action which can be execute automatically.* It is defined to execute automatically when the specified event is occurred.Types of Triggers :1) DML Triggers :These triggers executes automatically when data manipulation language event occurs. DML events are insert,update,delete.2) DDL Triggers...
Tuesday, 19 July 2011
How to insert data into XML file?

Tags : Insert,Data,XML File,Asp.Net,C#.NetHi Friends,in this post i would like to explain how to insert data into XML file.* Here in my example i am stored Name,Location,Email & Gender fields into XML file.For this i took 3 TextBoxes,DropDownList for Gender,Button & a label for displaying message.* Added XML file with name(InsertData)For this Go To SolutionExplorer-->Right Click on ApplicationName-->AddNewItem-->Select...
Saturday, 2 July 2011
Example on Windows Service
Hi Friends,in this post i would like to explain windows service for displaying message box for every 3 seconds.Step 1:* Open windows service project with projectName WinService1* Goto ToolBox-->General-->Right Click-->Select choose items-->Select Timer(Systems.Timers)* Project-->AddReference-->System.Windows.Forms(Message Box is a part of above reference).* Place a Timer(System.Timers) with interval-3000 & enabled-false.Code:{//timer1_Elapsed event.System.Windows.Forms.MessageBox.Show("This message from Windows Service.");}Code...
Introduction to Windows Services.
Hi friends,in this post i would like to explain some basic things to know about windows services.* A service which is under control of windows OS is called windows service.* Windows services are used to develop automated background processes.* Windows services contains only application logic but not GUI(Graphical User Interface).* The controls which are not visible at runtime,can be placed in windows service projects. For example:Timer Control,Event log control,File system watcher control. * To develop windows services .Net provided:File-->NewProject-->VisualC#-->Windows-->WindowsServiceTemplate.*...
Saving images to our application.
Hi Friends,in this post i would like to explain how to save images from our PC to application.* For this i took one FileUpLoad control, Button control and a Label control for displaying message.Add the following name space:using System.IO;Code for button click event():protected void Button1_Click(object sender, EventArgs e){try{string filePath = FileUpload1.PostedFile.FileName;string filename = Path.GetFileName(filePath);FileUpload1.PostedFile.SaveAs(@"F:\\Asp.Net\FileUpload\Images\" + filename);Label1.Text = "Image uploaded successfully.";}catch{Label1.Text...
Unique Key on 2 columns in SQL Server.
Hi friends,in this post i would like to explain how to create Unique Key on 2 columns in SQL Server.For Example:Here i am created Unique Key for 2 columns(Name,SurName) on College table.CREATE TABLE [dbo].[College] ADD CONSTRAINT [UK_College] UNIQUE NONCLUSTERED([Name] ,[SurName])WITH (PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]Thank you...
Set Operators in SQL Server.
Hi Friends,in this post i would like to explain Set Operators in SQL Server.*Set Operators are used to combined the data from multiple tables.Set Operators:1)UNION2)UNION ALL3)INTERSECT4)EXCEPTSyntax:Select query1Select query2Select query3..................1)UNION*UNION can select only distinct/unique rows & rows can be arranged in ascending order.2)UNION ALL*UNION ALL is used to combine all rows from the given select queries.3)INTERSECT* UNION ALL is used to select only common rows from the given set of select queries.4)EXCEPT* EXCEPT is equalent...
Subscribe to:
Posts (Atom)