Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 26th, 2003, 03:17 PM
Authorized User
 
Join Date: Jun 2003
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default SPROC multipe inderts in tables

Hello, here's what I want to do:

In my Sproc I declare a parameter, and then I want to insert the value of this parameter in 4 different tables (one after another, just in one field, the other fields will accept default values).

Can I do this easily in ONE Stored Proc???

Thanks in advance

Nick
 
Old July 26th, 2003, 04:10 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Can I do this easily in ONE Stored Proc???
Sure. You just place the INSERT statements one after another:

Code:
INSERT INTO Table1 (T1Col)
    VALUES (@Parameter);

INSERT INTO Table2 (T2Col)
    VALUES (@Parameter);

INSERT INTO Table3 (T3Col)
    VALUES (@Parameter);

etc.
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with sproc Bob Bedell SQL Server 2005 10 January 20th, 2008 08:52 AM
dynamic sproc sabry SQL Language 1 August 25th, 2006 06:23 AM
Multipe Virtual Directory to point one folder ghari ASP.NET 1.0 and 1.1 Professional 4 January 25th, 2006 09:56 AM
When a sproc or table was Last Used dlandolin SQL Server 2000 1 September 29th, 2005 08:09 PM
Question of Combining Multipe Related Tables mariushung VB Databases Basics 0 January 12th, 2005 03:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.