Sql Server

SharePoint Best Practices : Part 1

Create SQL Server Alias in SharePoint Farm Recently we ran in to a problem, where our production application suddenly started throwing 502 errors due to performance degradation. After analyzing few things, we suspect that our database server has some problems. As this was a production server and we didn’t want to keep this problem for SharePoint Best Practices : Part 1

Edit More Than 200 Rows in SQL Server 2008

While working with Sql Server, sometimes we need to update a record quickly. Even so quickly that we don’t want to write a query. Even that’s not a big problem just we need to right click desired table and select “Edit Top 200 Rows” option. This opens top 200 records of that table in editable mode and Edit More Than 200 Rows in SQL Server 2008

Procedure or Function expects parameter, which was not supplied : Resolved

I created a stored procedure as follows: Create procedure spInsertTable1  @Name varchar(50),  @Phone Varchar(50)  As  Begin   Insert into Table1(Name,Phone) values (@Name,@Phone)  End Now I wanted to insert the values from front end using this stored procedure. To achieving this thing I wrote the below mentioned code. protected void btnSubmit_Click(object sender, EventArgs e)         {             Procedure or Function expects parameter, which was not supplied : Resolved

Stored Procedure in Depth

Stored Procedures can be defined as compiled SQL statements stored in the database. Using stored procedures has many advantages over simply calling a query from the front-end, especially in web applications and large size applications. Advantages of Stored Procedures: 1. Since the queries are executed as a batch, the network traffic is significantly reduced. 2. Execution time Stored Procedure in Depth

Sql Server: Insert comma separated values in different rows

This is a code snippet for a Stored Procedure which accepts a comma separated values in parameter @Retailers which needs to be stored in a table with different rows. One fine day i had such type of requirement and i fount this post in a forum. I felt like it to share with you. Declare Sql Server: Insert comma separated values in different rows

Convert date from dd/MM/yyyy to MM/dd/yyyy for storing in SharePoint list or Sql Server Database

I was working on a custom web part that takes the date in Indian format e.g. dd/MM/yyyy while inserting the record in SharePoint custom list. But as we know that SharePoint custom list insert the date value as MM/dd/yyyy format. So it was throwing me the error for invalid string format so below is the Convert date from dd/MM/yyyy to MM/dd/yyyy for storing in SharePoint list or Sql Server Database

Triggers

A TRIGGER is a special type of stored procedure, which is ‘fired’ automatically when the data in a specified table is modified. It is invoked when an INSERT, UPDATE, or DELETE action is performed on a table.   Creating a TriggerSyntax: CREATE TRIGGER trigger_nameON { table | view } [ WITH ENCRYPTION ] {     Triggers

Views in Sql Server

A view, or virtual table, can be defined as an alternate way of collecting data from one or more tables in a database. Thus, the view consists of rows and columns just like a normal table that is generated dynamically when a query is executed. It, however, does not actually exist as a stored set Views in Sql Server

Row_Number function in SQL Server 2005

This article explains about the Row_Number function in SQL Server 2005. It explains whether SQL Server 2005 Row_Number function will support SubQueries or not. Introduction SQL Server 2005 have introduced new function  ROW_NUMBER to find the Row number of a particular column if its specified in orderby Clause The syntax for RowNumber is, SELECT ROW_NUMBER Row_Number function in SQL Server 2005