Skip to main content

Posts

Sql Server Tips

IF WE WANT TO SELECT  TOP N ROWS  FROM A TABLE ,  WE USE THE FETCH NEXT  SELECT    * FROM  table1   ---//First m rows ignore first n rows ORDER BY id OFFSET n ROWS FETCH NEXT m ROWS ONLY if n=0, m=10 then first  10 rows if n=10, m=10 then first  10 rows start from 11th row Row_number()   SELECT  ROW_NUMBER() OVER(order by db.id) Insertion Simultaneouly in temp table with output clause DECLARE @table1 table (   Id int,   name nvarchar(50) ); DECLARE @table2 table (  Id int,  name nvarchar(50) ); INSERT INTO @table2 OUTPUT INSERTED.*   INTO @table1   select top 10 id, name  from FinalTable SELECT * FROM @table2; SELECT * FROM @table1;
Recent posts

XML vs User defined table type

Suppose , I have to insert multiple records at a single click. The option for a developer to insert the data in database with the help of 2 options. 1. With XML 2. With User defined table type. Here, we are defining both these options one by one. 1.With XML We have a grid with 3 columns boxid, quantity and weight and we have picked the data from the gridview and store these data in 3 different array objects .suppose in the below example quantity is a string has value “200,300,140”.we fetch the values from string to array. string[] arrrQ = quantity.Split(','); //fetch the value from string to array string[] arrW = weight.Split(','); string[] arrB = boxtypeId.Split(','); XmlDocument oXmlProductDetail = new XmlDocument(); // create an object of XmlDocument class XmlElement oXmlElement = oXmlProductDetail.CreateElement("doc");// create an element with specified name ...

Ajax call to run a server side method

Client Side Code =========================== Server Side Code ======================\ protected void Page_Load(object sender, EventArgs e) { Button1.Attributes.Add("onclick", "return MyConfirmMethod();"); } [WebMethod] public static string MyServerMethod() { return "This is my Page."; }

How to write a techniical Paper?

How to write and publish technical papersYour first paper This article is complied from my personal experience of publishing technical research papers, which will also help you to write and publish your first paper. First of all I appreciate your decision to publish a paper since it is capable of benchmarking your efforts, as well as it is a contribution to the world of science! Here you goes.. This article is meant for beginners and intermediate scholars. The references used is included in the references section. 1. Preliminary The first activity for publishing a technical paper is to figure out your technical area of interest. Make sure the you had carried out enough studies on basics of that topic. Then you have you to update yourself with the ongoing technical happenings in your chosen field. You can do this by 1) Reading and googling a lot of technical papers. There are a lot of journals and IEEE papers floating around in net. 2) Go to one or more conferences, listen carefully to...