Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 25th, 2004, 10:55 AM
paulmc paulmc is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 paulmc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy 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"}
ProcedureNameR 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*

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > ADD COLUMN on the fly.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT