inserting record into second database from a stored procedure in first database

is it possible to insert record into second database from a stored procedure which is in first database? 

-keeara g
------------------
0
keeara
8/11/2005 12:21:08 AM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

1 Replies
884 Views

Similar Articles

[PageSpeed] 49

If the store proc include an INSERT INTO statement.  Run a search for INSERT INTO in SQL Server BOL(books online).  Hope this helps.
Kind regards,
Gift Peddie
0
Caddre
8/11/2005 1:06:50 AM
Reply:

Similar Artilces:

Inserting Information into an SQL Database using Stored Procedures
Hello, I'm building an ecommerce website which requires customers to create an account before they go ahead with a purchase. I have a createaccount.aspx page in Visual Web Developer 2005 with text boxes where users can enter their details (email, password, name and address).  I'm trying to insert the information which users type into the text boxes into an SQL database table called Customers. I've dragged and dropped an SQL data source onto my page and have set it to operate on my AddCustomer stored procedure. I've confirgured my data source such that the parameter for...

inserting xml data in sql database using store procedure
 i want to write gridview data in Xml file and pass that xml file as input parameter tostore procedures and insert xml file data to sql database table.i dont how to write xml file and how to pass it to store procedurepl help me asap its urgent    "To handle XML from an xml data type column by using ADO.NET and the Microsoft .NET Framework you can use the standard behavior of the SqlCommand class. For example, an xml data type column and its values can be retrieved in the same way any SQL column is retrieved by using a SqlDataReader.However, if you want to work with the...

saving .net DateTime to sql database using Stored Procedure...
Hello, I've read many posts on this, but not found any real answers. I have a web method that accepts a DateTime parameter, then writes this value back to a SQL database table.  Sql data type is "datetime" and the column accepts nulls. When the web service is called I get an error, "SqlTypeException: SqlDateTime overflow" or another error of similiar results.When I removed the database call and just write to a label or variable on the page, the web method works fine, but when it saves to the database, the error is thrown. Any ideas on how to handle...

Using ADO.NET Execute Second Stored Procedure Depending of Output of First Stored Procedure
When a user logs onto the app, I capture their UserId, today's date and thier WINNT using ADO.NET calling a stored procedue-no problem. Now, once the above mention fields have been populated, when the same user logs on again and this time click their daily attendance time, I need to execute and update stored procedure-no problem. Each time the user logs onto the attendance page, they need to be able to view the previuos time stamps, on page load.- no problem The problem is that I cannot get all three to work in concert, although they will work independently, somewhat. Sotred proc...

Accessing Second Database from First Database
We are planning to store images as BLOBS in secondary database. Is it possible to access the tables defined in secondary database from primary database by means by view and/or trigger? On 30 Mar 2005 13:35:23 -0800, Ashish Gupta wrote: >We are planning to store images as BLOBS in secondary >database. Is it possible to access the tables defined in >secondary database from primary database by means by view >and/or trigger? You can use proxy tables. Why do you want to separate the images into a different database? Breck -- SQL Anywhere Studio 9 Developer's ...

How to transfer a GUID created using vb.net into a SQL database using a stored procedure
I am able to create a guid using: Public Function GetGUID() As String ' Returns a new GUID Return System.Guid.NewGuid.ToString End Function however when I try to add this to a parameter using the following: Me.cmdSpAddOptions.Parameters("@QuoteDetailID").Value = GetGUID() I get an error, I have also tried this: Dim uidQuoteDetail As String = GetGUID() Dim myuid = New System.Guid(uidQuoteDetail) Me.cmdSpAddOptions.Parameters("@QuoteDetailID").Value = myuid but get the error "Object must implement IConvertible" A...

detailsview move to first record after record is inserted into database not to the last.
hi friends, on item inserting of detailsview after inserting records to database i want the page index to be last page index ,becouse detailsview get refreshed so it moved me to the first record not to the last. i don;t want to do this . select top 1 * from Detail  order by ID desc   thanks DetailsView1.PageIndex = DetailsView1.Items.Count-1 Jos hi jos didn't worked.any other salutionthanks Did you databind after changing the page index? DetailsView1.PageIndex = DetailsView1.Items.Count-1DetailsView1.DataBind() Jos hi, there is no property by the name ...

help about ---store date in sql database using stored procedure
hi,friends i need your help. i want to store a date into sqlserver database using stored procedure. when i run app. it will give this error....... ---------------------------------- Server Error in '/aspnet/espms' Application. -------------------------------------------------------------------------------- String was not recognized as a valid DateTime. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Det...

Database Stored Procedures Not Showing up in Database View
 Hi I have an application that I have started to develop.  I have successfully set the connection to open the SQL Server database that I created.  When I first started on the program, I was able to create Table Adapters by dragging the tables or stored procedures onto the DataSet work surface and going through the configuration process.  At one point, however, I stopped being able to see any of my stored procedures in the database view although they are there because when I go to create a new table adapter, I am able to right click and add the new adapter and find the sto...

How to port SQL create database stored procedure to Sybase Transact-SQL
Here is the stored procedure, help would be extremely appreciated if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp__CreateDatabase]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[sp__CreateDatabase] GO CREATE PROCEDURE sp__CreateDatabase @DbName varchar(120) , @LogicalDataFileName varchar(128) = NULL , @LogicalLogFileName varchar(128) = NULL , @PhysicalDataFileLocn varchar(255) , @PhysicalLogFileLocn varchar(255) , @DataFileSize varchar(100) = 10 , @DataFileMaxSize v...

Can connect to Database, but how do I insert values into SQL Database?
I was able to connect to the SQL Database Pension with table clients with table values: ID, State, Name.'Create(connection)Dim conn As New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)'open connectionconn.Open()However, I'm not sure how to insert a new row with an incremental ID number and a new State and Name.Sorry, I'm really new with VWD. You need to read about ADO.NET before you do anything. Google it.ASP.NET Hosting (HostingFest)...

How to SELECT a record FORM a database and INSERT INTO another database?
I use ASP.NET(C#)+MYSQL,Now I have a trable:How to SELECT a record FORM a database and INSERT INTO another database?the configuration of this two databases is the same. Open 2 connections, Create 2 Commands, 1 to select data out of the Database(cmdA), another to insert it (cmdB).  get a Reader from A, loop over your data, inserting into B.   Where I don't know is How to write the CommandString?these are in a function....

Backing up the sql database(*.bak) and restoring the Database in VB.net
Hi There, I want to know how to backup and restore database from VB.net. ie I am trying to put two buttons on my form, Backup and Restore. When I click on Backup a Backup of the SQL Database with extension of *.bak is created. Similarly when I click on restore and select a database with *.bak extension it should restore that database. I saw a software where it created a backup of Sql database with extension of .zip containing the bak file which is password protected. when u restore the database it automatically gets unzipped and the database is restored. Can anyone help me. Thanks in advance. Regards, Amit         You can create stored procedure to perform backup/restore, then call the stored procedure from your code. For example: use mastergo CREATE PROC sp_backup @path sysname,@dbname sysname,                      @dataDevice varchar(100),@logDevice varchar(100)asDECLARE @fullFileName sysnameSET @fullFileName=@path+@dataDevice--Create the data backup device.EXEC sp_addumpdevice 'disk', @dataDevice,@fullFileName --Create the log backup device.SET @fullFileName=@path+@logDeviceEXEC sp_addumpdevice 'disk', @logDevice,@fullFileName -- Back up the full MyNwind database.EXEC('BACKUP DATABASE '+@dbname+' TO '+@dataDevice) -- Update activity has occurred since the full database backup. -- Back up the log of the MyNwind database.EXEC('BACKUP ...

Insert Stored Procedurer not writing to database
I test my stored procedurer (SP) by ifself and works. But, when I run my program and pass data to the parameter via text boxes it does not write to database. Am I missing something in my method or SP? The method: private void InsertData(string hostID, string ip, string mac)    {        try        {            using(SqlConnection cn = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]))     &nb...

Store Existing SQL Database through .Net
  Hi Anyone Knows I want to store SQL 2005 Existing Database into SQL Server Through .Net.if i give Database Name in .Net and that Database automatically stored in SQL Server 2005.P(including that Existing Database Tables and Stored Procedures).Please Help me.   Tamil  Do you mean, create a database from .net code? or maybe restore an existing database from a backup? Sorry, could you clarify.--Roberto Hernández-Pouhttp://www.rhpconsulting.net-----------------------------Don't forget to click "Mark as Answer" on the post that helped you.This credits t...

How to debug stored procedure in second database
Hello, I have a Asa network engine called 'ENG1' and is running two database called 'ENG1' and 'DB2'. The name of the server is the same as the name of the first database i.e. 'ENG1' How can I debug a stored procedure written in the second database 'DB2'. When I start the ASA Debugger from Sybase Central it only lets me view the database object in the first database i.e. 'ENG1'. I am using ASA 7.03.2046, W2K, PIII 512mb ram All help will be highly appreciated Regards Jason Davenport You need to connect to the second dat...

How can i copy database customize store procedure out and restore it to other database??
Hi, all: How can i copy database customize store procedure out and restore it to other database? 1.copy db1's customize store procedure out 2.restore the store procedure to other new database thks. saul The "defncopy" utility program found in $SYBASE/bin or $SYBASE/ASE-*/bin will extract a script to create the procedure from the source database providing sp_hidetext has not been run on it. (if sp_hidetext has been run, there is no way to extract the script, you would have to contact the author of the procedure). Defncopy will...

How to insert the first record in a database table?
 Hello,Is it possible to use any of the controls (gridview,formview, etc) if you don't have any records in the database table?  It seems I can only get them to appear in my browser if I actually have data in the table already.  Thanks in advance.  Yes it is.  For a FormView/DetailsView, if the mode is not Insert, then the EmptyDataTemplate is shown if no records are found, which is likely what you're seeing.  You could change the DefaultMode to Insert in the FormView/DetailsView declaration, but that may not be what you really want since it would come ...

How to list all tables in a database by giving parameter as database name to stored procedure.
Hi all, I need to list all tables in a database by giving parameter as database name to stored procedure. I tried the following, but it never works. Please help. ALTER Procedure [dbo].[sp_GetTables] ( @dbname nvarchar(200)--, --@tablename varchar(128) output ) As DECLARE @SQL nvarchar(1000) SET @SQL = 'Declare @dbname varchar(128);SELECT name FROM '+ '@dbname' +'..sysobjects where type =''s'' or type = ''u''' Execute sp_executesql @SQL --EXEC (@SQL) RETURN  Error while executing Msg 102, Level 15, State ...

How to write a stored procedure to copy the data from one database to another database
 I want to copy the data from one database to another database every 12 hrs.(This is variable). Say for example I have 3 applications and I want to copy the data from Parentdatabase1 and insert into CopyofParentdatabase1 for every 6 hrsParentdatabase2 and insert into CopyofParentdatabase2 for every 8 hrsParentdatabase3 and insert into CopyofParentdatabase3 for every 12 hrsI have heard that we can do this by using SQL Server Integration Services but as of now we cannot use SSIS. So I want to do this using Stored procedures. Is there a way to schedule the batch job for to run all these stored procedures at the specified time. The above mentioned times may change. So this should pull up these duration hrs from some place.If there is a way to copy all these data using stored procedures and can schedule these batch jobs using Sql Server management studio, then any one help me or guide to write  storeprocedure and creating that batch job Thanks You should Creat A DTS or SSIs Packages to do this its faster A fine is a tax for doing wrong. A tax is a fine for doing well.__________________________________________________Please remember to click “Mark as Answer” on the post that helps you.  HI,   You can create a DTS package for copy the database to another db. You can also schedule these DTS package for regular intervals.Both steps you can do it using Enterprise Manager itself.  -Sri-------------------------------------------------If this post...

error trying to insert a record into an SQL database
Im trying to use a form to insert a record into an SQL database, but im getting the following error. "Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near 'Nametxt'. Line 1: Incorrect syntax near '?'." And then highlights the following line of code. objComm.ExecuteNonQuery() I use this same type of code when working with Access Databases and not sure why its not working here. Below is the list of parameters i use. Dim SQLstring as string = "Insert INTO Messages (Name, Email, Classyr, Living, Comments, Dateposted, Status) VALUES ...

stored procedure for inserting values into database table
hi all , how i write stroed proceudre for inserting record into database table . iam using sql server 2000 as beckend database . Best Regardslife is name of learning!Mark as an answer if it helps   See if you can use following sample.  Create Proc usp_ProcName (@param1 int, @param2 varchar(10)) AS BEGIN      INSERT INTO YourTable(Col1, Col2) values(@param1, @param2) END     Thanks,santosh_maharajaPlease mark as answer if you got expected solution. This is the Systax for Insert Stored Procedure. CREATE PROCEDURE InsertValues @valu...

I have a problem with insert a record to MS-SQL Database
Dear All I have a problem in insert a record to MS-SQL Database I have 2 .aspx pages 1 for inserting and 1 for display .. both are working fine in my home PC , but when I move both to my office PC it doesn’t response to insert but displaying is working, So I can guess that the connection is fine . And the problem is only in inserting the record. What do you think the problem is? Any help will be appreciated. Thanks M A Note : I am using Visual Studio.NET 2002 + SP3 also ADO.NET for connectivity to MS-SQL server 2000 Enterprise Edition with windows XP + SP2 Wizard Wha...

Inserting data into database using store procedure
Here is my code and it's not working.protected void btnInsert_Click(object sender, EventArgs e) { SqlConnection sqlConn = new SqlConnection(); sqlConn.ConnectionString = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString; SqlCommand sqlComm = new SqlCommand(); sqlComm.Connection = sqlConn; sqlComm.CommandType = CommandType.StoredProcedure; try { //sqlConn.Open(); sqlComm.Connection.Open(); } catch (Exception x) { Cons...

Web resources about - inserting record into second database from a stored procedure in first database - asp.net.sql-datasource

Inserting Kate
jurvetson posted a photo: the speaking GPS avatar that we came to love.. more prep photos below... You can hear her voice in the video compilation ...

Inserting the Galaxy Note 5’s S Pen backwards can permanently damage the device
One of the features Samsung highlighted when it unveiled the Galaxy Note 5 was the device's new S Pen slot design. The Note 5 features a spring-loaded ...

How the Shift from Swiping to Inserting Cards Will Accelerate Mobile Payments
... this shift is to protect consumers and merchants from fraud. What the industry refers to as "dipping" and consumers and cashiers call "inserting" ...


Inserting Slavery Into The Climate Debate
Chris Hayes compares the fight against fossil fuels to the abolitionist movement. He states plainly that “there is absolutely no conceivable ...

Samsung smart TVs inserting ads into third-party apps
... playback have pissed off a number of consumers. People with smart TVs from Samsung have been complaining that the electronics maker is inserting ...

Samsung: Inserting the S Pen backwards will not break new Galaxy Note 5 units
... according to the company. "Samsung can confirm that the Note 5 internal S Pen mechanism has been changed to avoid the issue caused by inserting ...

Gawker tells Steven Crowder to "stop whining, take your licks, and accept that getting hit in the face ...
"... in the middle of an argument between billionaire-funded know-nothing ideologues and people whose livelihoods and stability are being threatened ...

Gmail's New Interface for Inserting Photos
Gmail has a new interface for adding images to a message. When you click the "insert images" icon, Gmail now shows all the photos highlighted ...

Now Samsung SmartTVs are interrupting users' videos by inserting random ads
... room. Now Samsung is dealing with a new headache: Gigaom reports that Samsung SmartTVs are interrupting users' own video content by inserting ...

Resources last updated: 3/5/2016 10:47:06 PM