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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 updating date in column

Author  Topic 

WebCrab
Starting Member

8 Posts

Posted - 2009-08-14 : 18:01:48
hello i want to use stored procedures to change the date in a column where the column BookId = (@BookId).
i don't know the syntax. the table's name is "BookTable" and the date column is called "Date" (obviously).
10x.

Click! Click!

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-08-14 : 18:41:39
sorry, I can't tell if you want to call an existing procedure, create a new procedure, or simply do the update in a query window with t-sql.

Be One with the Optimizer
TG
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-08-14 : 18:46:17
--to create the proc:
create proc BookTable_UpdateDate
@bookid int
,@newDate datetime
as
update BookTable set [date] = @newDate where bookid = @bookid
go

--to call the SP:
exec BookTable_UpdateDate @bookid = 1, @newDate = '2009-08-12'

Be One with the Optimizer
TG
Go to Top of Page

WebCrab
Starting Member

8 Posts

Posted - 2009-08-14 : 18:53:47
i needed to create a sproc, sorry for disinforming. youv'e helped a lot. thank you.

Click! Click!
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2009-08-14 : 22:34:23
Reserved words do [not] make good [column] [name]s





Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -