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 |
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2009-04-28 : 06:00:01
|
| I want to populate a basic orders table or an excerise.the table isCreate table dbo.orders (order ID int identity(1.1), orderDate datetime not null, orderAmount money not nullConstraint pk_orders Primary Kry Clustered (Orderdate, OrderAmount))on partscheme(orderID)The popuate statement isset nocount ondeclare @month int, @day intset @month = 1set @day = 1while @month <= 12begin while @day <= 28 begin insert dbo.orders (orderDate,orderAmount) select cast(@month as varchar (2)) + '/' + cast(@day as varchar (2)) + '2005',@day * 20 set @day = @day + 1 end set @day = 1 set @month = @month + 1end goand my result isconversion failed when converting datetime from character stringcould someone tell where i am going wrong pleaseRegardsRobMCTS certified |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-04-28 : 06:05:32
|
select cast(@month as varchar (2)) + '/' + cast(@day as varchar (2)) + '/' + '2005', E 12°55'05.63"N 56°04'39.26" |
 |
|
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2009-04-28 : 06:08:41
|
| o my god,you really have to develop a good eye for this dont you.Im studying for my MCITP at the moment.thank you for your helpRegardsRobMCTS certified |
 |
|
|
|
|
|