Geeks With Blogs
Mayank Sharma 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 ......

Posted On Friday, May 7, 2010 9:35 AM

SQL Server: DateTime and Indexes

A nice post about handling DateTime fields and indexing.

http://itknowledgeexchange.techtarget.com/sql-server/dates-can-easily-be-the-hardest-datatype-to-work-with/

Posted On Tuesday, September 22, 2009 12:52 PM

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... ......

Posted On Friday, January 2, 2009 8:08 AM

Copyright © bullpit | Powered by: GeeksWithBlogs.net