
March 25th, 2004, 10:55 AM
|
|
Registered User
|
|
Join Date: Mar 2004
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
ADD COLUMN on the fly.
Hi, I have a page that displays company procedures and has a check box at the bottom of the page which squirts the date that the page was "read" and sticks a "Y" in a column which has a name relevant the page.
e.g.
ProcedureName varchar 30 {contains a "Y"}
ProcedureName R varchar 30 {contains date}
This all works well, and I manually add two columns each time they give me a new document to display...
I now have been told that one of the directors wants to add the pages himself, which means I now need to add 2 columns dynamically based on the contents of a form. It will determin the name of the new columns.
how?
I started playing with stored procedures ...
PHP Code:
CREATE PROCEDURE [dbo].[sp_CreateColumns] AS
ALTER TABLE dbProcedures ADD COLUMN '" & ColumnName & "' varchar(30);
I'm just going around in circles now, maybe its the coffee! just need to create a table from a form and the accompanying twin column but with the suffix R... in ASP!
P.
*sigh*
|