posts - 31, comments - 85, trackbacks - 0

My Links

News

Archives

Post Categories

SQL

Everything to do with SQL, Stored Procedures, Triggers etc.
Procedure or function has too many arguments specified
This error took me a while to figure out. I was using SqlDataSource with stored procedures for SELECT and UPDATE commands. The SELECT worked fine. Then I added UPDATE command and while trying to update, I would get this error: "Procedure of function has too many arguments specified" Apparently, good guys at .NET decided it is necessary to send SELECT parameters with the UPDATE command as well. So when I was sending the required parameters to the UPDATE sp, in reality, it was also getting my SELECT...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Friday, May 07, 2010 9:35 AM | Feedback (2) | Filed Under [ SQL ]

SQL Server: DateTime and Indexes
A nice post about handling DateTime fields and indexing. http://itknowledgeexchange.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Tuesday, September 22, 2009 12:52 PM | Feedback (1) | Filed Under [ SQL ]

How to get a return value from a Stored Procedure that just returns a value without a parameter
Scenario - My stored procedure just returns some integer values depending on different conditions. There are no OUT or any other parameters involved for returning values from the stored procedure. e.g. IF (EXISTS( SELECT * FROM TableName WHERE UserId = @UserId AND RoleId = @RoleId)) RETURN(1) ELSE RETURN(0) If you notice, there are no output parameters involved here. The return value can be accessed from code (C# for example), like this: SqlParameter returnValueParam = command.Parameters.Add("@re...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Friday, January 02, 2009 8:08 AM | Feedback (0) | Filed Under [ SQL ]

Powered by: