Click here to Skip to main content
15,887,485 members
Home / Discussions / Database
   

Database

 
AnswerRe: deleting 1/1/1900 in SQL Server 2000 using Trigger? Pin
Dave Kreskowiak8-May-08 2:58
mveDave Kreskowiak8-May-08 2:58 
AnswerRUDE! Pin
leckey8-May-08 3:34
leckey8-May-08 3:34 
Questionhow to load data to dropdownlist? Pin
sacr837-May-08 21:00
sacr837-May-08 21:00 
AnswerRe: how to load data to dropdownlist? Pin
Christian Graus7-May-08 22:01
protectorChristian Graus7-May-08 22:01 
QuestionTransaction Processing Replication Pin
Codename477-May-08 1:57
Codename477-May-08 1:57 
AnswerRe: Transaction Processing Replication Pin
Tim Carmichael7-May-08 2:02
Tim Carmichael7-May-08 2:02 
GeneralRe: Transaction Processing Replication Pin
Codename477-May-08 2:07
Codename477-May-08 2:07 
Questionadding column names using the stored procedure.error in the @ character Pin
Pankaj Garg7-May-08 0:12
Pankaj Garg7-May-08 0:12 
i was trying to add the column names in the existing table using the stored procedure in sql server 2000.
My stored procedure is

CREATE PROCEDURE [dbo].[spInsert_Master] <br />
<br />
AS<br />
declare @les varchar(1000)<br />
<br />
delete tblmaster<br />
create table tblMaster(categoryname varchar(100) , casestudy varchar(100) ,  UnitInformation varchar(100) , locationname varchar(100)) <br />
declare les cursor for select lessonname from tblLessonMaster<br />
open les<br />
	fetch next from les into @les<br />
	while(@@fetch_status =0)<br />
	begin<br />
		fetch next from les into @les<br />
		alter table tblMaster add @less varchar(500);<br />
		select @les as lessonname<br />
	end<br />
close les<br />
deallocate les


I got the error in the following line
alter table tblMaster add @less varchar(500);
says error near @less
i think i can't add the @ expression in the column name.
any idea for the alternative ?
I want to add the column names in the existing table using stored procedure.

If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

AnswerRe: adding column names using the stored procedure.error in the @ character Pin
Krish - KP7-May-08 0:16
Krish - KP7-May-08 0:16 
QuestionRe: adding column names using the stored procedure.error in the @ character Pin
Pankaj Garg7-May-08 1:43
Pankaj Garg7-May-08 1:43 
AnswerRe: adding column names using the stored procedure.error in the @ character Pin
Krish - KP7-May-08 1:54
Krish - KP7-May-08 1:54 
QuestionRe: adding column names using the stored procedure.error in the @ character Pin
Pankaj Garg7-May-08 1:58
Pankaj Garg7-May-08 1:58 
AnswerRe: adding column names using the stored procedure.error in the @ character Pin
Ashfield7-May-08 4:42
Ashfield7-May-08 4:42 
Questionwhen to create index? Pin
PadmaPriya.S7-May-08 0:01
PadmaPriya.S7-May-08 0:01 
AnswerRe: when to create index? Pin
John_Adams7-May-08 0:34
John_Adams7-May-08 0:34 
AnswerRe: when to create index? Pin
GuyThiebaut7-May-08 10:04
professionalGuyThiebaut7-May-08 10:04 
Questiongetting the value in variable Pin
gottimukkala6-May-08 23:04
gottimukkala6-May-08 23:04 
AnswerRe: getting the value in variable Pin
Krish - KP7-May-08 0:06
Krish - KP7-May-08 0:06 
Questiondisable complexity check while creating user Pin
Denver Thomas6-May-08 21:43
Denver Thomas6-May-08 21:43 
AnswerRe: disable complexity check while creating user Pin
Dave Kreskowiak7-May-08 10:30
mveDave Kreskowiak7-May-08 10:30 
QuestionMySQL5 Duplicate entry error while row does not exit Pin
Hari Om Prakash Sharma6-May-08 21:16
Hari Om Prakash Sharma6-May-08 21:16 
AnswerRe: MySQL5 Duplicate entry error while row does not exit Pin
Rajesh R Subramanian4-Jun-08 23:38
professionalRajesh R Subramanian4-Jun-08 23:38 
AnswerRe: MySQL5 Duplicate entry error while row does not exit Pin
The Web Developer5-Jun-08 0:35
The Web Developer5-Jun-08 0:35 
Questioncounting in SQL server 2000?? Pin
Karan_TN6-May-08 20:06
Karan_TN6-May-08 20:06 
AnswerRe: counting in SQL server 2000?? Pin
Krish - KP6-May-08 20:28
Krish - KP6-May-08 20:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.