why did you close this issue without even dealing with it??? This is
a problem description!!
View Complete Post
Is it possible to use a stored procedure to create a bunch of other stored procedures? When the user creates a new database, I need to create a bunch of stored procedures and I would like to just run a stored procedure on the new database that creates
all the needed stored procedures. I tried just putting the CREATE PROCEDURE syntax inside a stored procedure and got some errors. I imagine this can be done using dynamic sql and the EXECUTE function but I was hoping there was a better way.
If a stored procedure is a stored procedure, then why when I am creating a stored procedure in VS 2010 for a windows forms program,
do I have to include a 'Create procedurename' in my stored procedure?
Doesn’t the add stored procedure function in VS 2010 already know that it is a stored procedure already?
I'm not trying to be funny about it.
It just seems like some sort of redundancy. Maybe somebody's answer will give me a better idea of what SQL Server is and what a stored procedure is.
Any help would be gratefully appreciated.
I have the following stored procedure
ALTER PROCEDURE dbo.GetProvMoveModifier
DECLARE @mod float
SELECT @mod = PROV_TYPES.MOVE_MOD
FROM PROV_DETAILS INNER JOIN
PROV_TYPES ON PROV_DETAILS.TYPE_ID = PROV_TYPES.TYPE_ID
WHERE (PROV_DETAILS.PROV_ID = @prov_id)
MOVE_MOD is defined as a float.
Yet within Dataclasses.designer.cs the function gets added as:
public int GetProvMoveModifier([Parameter(DbType="Int")] System.Nullable<int> prov_id)
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), prov_id);
Naturally this is causing some issues as my C# code needs to handle decimal values. If I try to manually change the designer code to use floats, I get the following error
'System.Single' is not a valid return type for a mapped stored procedure method.
Any thoughts? I could setup a work-around, but I would think I could return a decimal value from a stored procedure.
Hi! I have a bunch (~10) of different task lists corresponding to different projects; each list has a mixture of Statuses, i.e., some completed, some In Progress, some Not Started. I'd like to create a (preferably dynamically updated)
single task list consisting of all the incomplete tasks from each of the project lists. After much trial and error (I'm still a relative newbie with DB stuff; even more so w/ Sharepoint stuff) I figured out how to do this by viewing the lists
in Access and creating a query which resulted in the compiled list I describe above; however, when I clicked on the "Publish" to Sharepoint button and returned to Sharepoint default view, I couldn't find this new list anywhere (e.g., the new, empty list I
had created and changed to Access view, and from which I imported the other lists and created my query, was empty, and my list of task lists in the left side-bar didn't have my query-result-list).
How do I do what I want, w/ or w/out Access? Thanks!
What would be the best & easy way to create XML using Stored Procedures. We use SQL 2008
I have one drodownlist which show data based om textbox values...
Let us consider i have
Select Name from table1 where Type IN(@typ)
here @typ is textbox values
here for example textbox will have some thing like this L1,L2,L3..
How to filter Name based and shown in drodownlist based on this L1,L2,L3(on textbox)..
Help me in this
Is it possible to change the select, insert and update stored procedure of an SqlDataSource at run time. I don't mean to change the definition of the stored procedure, but I mean to change the assignment, i.e. To change the select stored procedure from "selectSP1" to "selectSP2" at run time. Is it possible?
we are creating a custom report tool, which could be used for generate the report as per end user's needs. In that we are providing an option as user could create a query and procedure as well.
In sql server we can use "EXEC" function for execute dynamic query.
Could anyone help me for create the dynamic query in Oracle?
I just tried with "execute immediate", which would throws error as
Please help me.
Please help me.
Language Integrated Query makes lots of things easier. Here we put LINQ, or more specifically the LINQ to SQL provider, to use testing SQL stored procedures.
Dr. James McCaffrey
MSDN Magazine April 2008
Design-time automation makes coding faster and ensures that all the procedures generated use the same naming conventions and structure. In an effort to improve their coding efficiency in a large SQL project, the authors wrote a set of design-time stored procedures that generate run-time stored procedures, and have used them in project after project ever since. Recently, the authors updated their procedures to make use of SQL Server 2000 features, including user-defined functions. This article covers the creation and execution of these dynamic T-SQL scripts to automate the coding of common database stored procedures.
Peter W. DeBetta and J. Byer Hill
MSDN Magazine April 2003
One major inconvenience of using SQL stored procedures from code is having to match type information. You have to write long wrapper functions around the procedures just to expose the data types. In the .NET Framework, however, the reflection services of the System.Reflection namespace allow you to query rich metadata that describe data types. This article explains how to use reflection in .NET to end your stored procedure nightmares. The author creates four custom classes, including one that generates a SQLCommand object based on the metadata of a method. Using this library, you'll be on your way to automating the generation of stored procedures.
MSDN Magazine August 2002
MSDN Magazine June 2002
Edited by Nancy Michell
MSDN Magazine May 2002
Front-end developers frequently want to add functionality to the presentation tier of an n-tier architecture, but such requests can require changes on all tiers just to get the data and present it. This process can be made easier and more flexible by using SQL Server stored procedures to automate the delivery of data in XML format from the database to the front-end components. In the component presented here, stored procedures are invoked by XML strings, XML is returned, converted using XSL, and presented to the client in HTML. The technique supports rapid changes yet doesn't sacrifice the n-tier approach. This approach can be used with either SQL Server 7.0 or SQL Server 2000.
Dave Grundgeiger, Anson Goldade, and Varon Fugman
MSDN Magazine August 2001
MSDN Magazine July 2000