Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jaybee
Yak Posting Veteran
72 Posts |
Posted - 2007-06-17 : 09:24:37
|
| Hi all,Could someone explain the code in red for me??Thanks,Jaybee.create proc SalesCopyInsert @SalesOrderID int, @SalesOrderDetailID int, @CarrierTrackingNumber nvarchar(25), @OrderQty smallint, @ProductID int, @SpecialOfferID int, @UnitPrice money, @UnitPriceDiscount money, @LineTotal money, @ModifiedDate datetime asinsert into SalesCopy (SalesOrderID, SalesOrderDetailID, CarrierTrackingNumber, OrderQty, ProductID, SpecialOfferID, UnitPrice, UnitPriceDiscount, LineTotal, ModifiedDate)values (@SalesOrderID, @SalesOrderDetailID, @CarrierTrackingNumber, @OrderQty, @ProductID, @SpecialOfferID, @UnitPrice, @UnitPriceDiscount, @LineTotal, @ModifiedDate) |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-06-17 : 09:59:33
|
that just declaration of the variable parameter list for the stored procedure SalesXopyInsert KH |
 |
|
|
jaybee
Yak Posting Veteran
72 Posts |
Posted - 2007-06-17 : 11:59:59
|
quote: Originally posted by khtan that just declaration of the variable parameter list for the stored procedure SalesXopyInsert KH
Perhaps I should rephrase, what reasons might there be for the use of global variables in the values list?My understanding is that this code creates a stored procedure, which will then be used for insertions into the SalesCopyInsert. If that's correct, why are the values prefaced by variables??Cheers,Jaybee. |
 |
|
|
Jeff Moden
Aged Yak Warrior
652 Posts |
Posted - 2007-06-18 : 08:41:16
|
| Take a look at Books Online and the rest of the code... the GUI will call the proc passing values to these variables to be inserted.--Jeff Moden |
 |
|
|
pootle_flump
1064 Posts |
Posted - 2007-06-18 : 08:51:51
|
quote: Originally posted by jaybeePerhaps I should rephrase, what reasons might there be for the use of global variables in the values list?
There are no global variables in the proc. I think Jeff's suggestion is best. The perfect entry will be under CREATE PROCEDURE and you will quickly get the idea. |
 |
|
|
|
|
|
|
|