.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SQL Server 2005 - How to Call One Store Proc from Other Store Proc ?

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :

Hi ,

I have a Requirment, How can I called One Store Procedure from Other Store Procedure ?

After Calling to Other Store Proc, How can i Store that other Store Proc Result Sets in the Temp Table, So i can process in the Current Store Proc Result Sets ?



View Complete Post

More Related Resource Links

Store Null Data In image datatype in sql server 2005



i wanted to store image in sqlserver database image field and i did. But now in some cases i want to store null value in that image field please let me know how to do this using file uploader.please give complete sample code.


How To Create Dynamic Insert Store Proc


I want to Create a Insert Procedure for Table which has Three Coloum I want to use this Insert Store Proc for another table which has two coloum. If it works then I don't Have to create more Store Proc for Every Table One Insert Proc will Serve my Purpose I am My giving my proc below

Create Proc All_Insert


@Name varchar (30),

@Phone varchar (15)

@Mobile Varchar (15)





insert into Table1














How can I avoid error a Insert Store proc if he don't find any coloum in a table


I have created one Insert Proc for a table which has three Colourm. 

Id int, [Name] varchar (30), Phone varchar (15) I want to use this proc for another Table which has two coloum which is semiler with first table lie   Id int, [Name] varchar (30) I want to use one Insert Store Proc For two Table. I can avoid null value of parameter but but can't avoid if the coloum is not exist. 



Collect The coloums Name from Table by store proc


How I can Collect Coloums Namee from table by passing the table name in Parameter.

Decrypt the encrypted store procedure through the T-SQL programming in SQL Server 2005


HI ,


I have a encrypted store procedure in my production server .Right now I do not have the script now I want do some modification.

Please any one can help me to decrypt the store procedure it will be a great help for me.


For any suggestion thanks  in advance.

" Education is the beginning of transformation. Dedicate yourself to daily learning via Blogs/Forums/books and coaching "
Click here to read my blog

how to store query string in sql server 2005


Hi all,


how to store query string in sql server 20005 

SQL Server 2005 store procedure performance issue


We are calling store procedure from vb.net client following are the observation.

1) sqlserver 2005  takes huge amount of time (more than 1 hour) to execute procedure. The procedure has select statement using join statement. (Generally this procedure executes and populate data in 5 seconds when it is called from .net client.)

2) If same procedure is executed from sql server management studio, procedure executes and populate data in 5 seconds (works as per expectation)

3) If we recompile procedure (i.e. open procedure in alter mode in management studio and click on execute button) ,  the procedure executes and populate data as per expectation.

4) This is intermittent issue on production machine. Most of the time procedure is executed and populate data as per expectation when called from vb.net client. But it does not give expected outout in some scenario. The frequency for occurring the issue is  once in 15 days and there is no pattern in which the issue is occurring.


Can any one help to resolve the issue.


Thanks in advance!!!




Slow Store proc



can someone pls help me! I have a sql query that runs 8 seconds but it takes more than 20min when i put that query in a store proc. what could be the cause of this? I tried taking the same query and put it in a SSRS 2008 Dataset and see if it will return anything, It runs for ever!


SQL Server CE: New Version Lets You Store and Update Data on Handheld Devices


Handheld device users need to be able to synchronize with a main data store when it's convenient and, preferably, when the back-end database server isn't busy. SQL Server 2000 Windows CE Edition allows you to build a traveling data store that can be displayed and run on a variety of devices. SQL Server CE supports a subset of the full SQL Server package, and can be used as a standalone server or in tandem with SWL Server and IIS. The architecture of SQL Server CE, along with data manipulation, synchronization, and connectivity issues, are discussed in this article. Topics such as making your data public, choosing the right type of replication, and handling errors are also covered.

Paul Yao and David Durant

MSDN Magazine June 2001

VB.NET - store HTML code in SQL Server


Hey guys/gals!!

Quick question - I want to allow someone to enter HTML markup in a control, and save the input exactly as entered. 

I want people to put a minimum of 50 words, to maximum of 500, and be able to save the formatting of their text in SQL 2005 server database. 

Also, I understand this is two questions, but how do I save metadata of an image file in the sql database? I mean, I get the gist of it, but how do I do it? 

Thanks everyone!

Does SQL Server have to load and init statics every time a SQL/CLR managed proc is invoked?

We are working with SQL/CLR stored procedures, triggers etc and it seems that all assemblies we use are unloaded/loaded every time a proc or trigger or TVF is called. Is this true? Is there any way to retain data between invocations of procs? for example can I create some static struct or object that I can setup once and then just refer to after that, so that unless we terminate SQL server, the static data is always in memory? Thanks PS: This was originally posted here, but that forum seems to be rarely frequented.  

Sending Email by exeucting a stored proc on SQL Server that references CLR

Hi Guys, I want to modify the data type of the @body variable in the stored procedure that sends an email. The stored procedure is as follows:   CREATE PROCEDURE [dbo].[spSendMail4]<br/> @recipients [nvarchar](4000),<br/> @cc [nvarchar](4000),<br/> @subject [nvarchar](4000),<br/> @from [nvarchar](4000), @body [nvarchar](4000), @attachment [nvarchar](4000)<br/> WITH EXECUTE AS CALLER<br/> AS <br/> EXTERNAL NAME [SMTPCLR].[StoredProcedure].[spSendMail]<br/> GO   I want to change the @body variable to data type: text. The reason for this, is because I am sending an HTML email whose content (characters) exceed 8000. Basically the new stored procedure should looks like below:   CREATE PROCEDURE [dbo].[spSendMail4] @recipients [nvarchar](4000), @cc [nvarchar](4000), @subject [nvarchar](4000), @from [nvarchar](4000), @body text, @attachment [nvarchar](4000) WITH EXECUTE AS CALLER AS EXTERNAL NAME [SMTPCLR].[StoredProcedure].[spSendMail] GO   If attempt to make this change, I get the below error:   CREATE PROCEDURE for "spSendMail" failed because T-SQL and CLR types for parameter "@body" do not match.   Understandably so, because from the article http://msdn.microsoft.com/en-us/library/ms131092%28SQL.100%29.aspx CLR data type (.NET Framework) is not compa

2005 proc not working in 2008

following proc works in 2005, and fails in 2008 returning "Msg 207, Level 16, State 1, Invalid column name 'xxx' " message.  Anyone have any ideas? The proc alters an existing proc in another db to return a different value: existing proc: /******************************************************* USE [tstDB] GO CREATE PROCEDURE [dbo].[sp_GetName] AS SELECT "aaa" AS strDescription GO /******************************************************* proc to alter return value: /******************************************************* USE [srcDB] GO Drop Procedure up_chg_name go Create Procedure up_chg_name (@chgName varchar(20),@db varchar(100)) AS Declare @ls_sql nvarchar(255) set @ls_sql='USE '+@db+' EXECUTE ('' ALTER PROCEDURE dbo.sp_GetName AS SELECT "'+@chgName+'" AS strName '')' exec(@ls_sql) GO /******************************************************* execute the altering proc: /******************************************************* USE [srcDB] GO exec up_chg_name @chgName=xxx',@db='tstDB' go /******************************************************* this fails with: "Msg 207, Level 16, State 1, Invalid column name 'xxx' message" - any ideas? Thanks  

Is there a way to backup all my store procedures under a particular SQL 2005 database?

hi all, Is there a script, doc, VBS script, SQL statement out there which will read all my store procedures and save them as a TXT file? Currently I have to save all of them in text files before I update them when I get a new web site release. Thank you  JCD

Client (Excel) crashes on exit with C# Interop Server (in-proc)

Hello, I'm having a generic problem understanding how to free resources when writing .net COM Servers (using CCW). Excel 2007 VBA is my client in this case. I believe it to be a problem that resources aren't immediately freed and on exit of Excel, a crash occurs which is probably due to invalid resources. The code server code I have is as follows: using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Windows.Forms; using System.Threading; using System.Diagnostics; namespace myclass { [Guid("84F0D8F6-AF73-43fe-92D3-C7264EDBDB18")] [ComVisible(true)] public interface IProgress { [DispId(1)] void Show(); [DispId(7)] void Finished(bool WaitOnOk); } [Guid("1195C591-8592-4533-BFFD-C383B33B2976"), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] [ComVisible(true)] public interface IProgressEvents { } [Guid("9773AD88-E17C-4c27-94AE-BA3FC330F162"), ClassInterface(ClassInterfaceType.None), ComSourceInterfaces(typeof(IProgressEvents))] [ComVisible(true)] public class Progress : IProgress { System.Diagnostics.BooleanSwitch trace = null; System.IO.FileStream log = null; private bool m_InitForm = false; public Progress() { log = System.IO.File.Create(@"c:\hbasElvis.txt"); Trace.Listeners.A

SSIS - Call a Store procedure

Can someone show me an example of how to call a store procedure that checks for empty fields in a SQL database table, by returning a value when fields are empty. then send an email to the adminstratore.

How can a proc call another proc in SSIS?

My first proc retireves two parameter values and then executes a second proc using those parms as input parms and populates a dest table Proc 1 exec  p_getdata parm1,parm2  this works fine in sql server resulting in a populated destination table What is best way to accomplsh this in SSIS?  
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend