September 14, 2011 at 1:12 pm
I HAVE TABLE SOMETHING LIKE THIS:
CREATE TABLE #Parm_Filter
(
[Parm] [varchar](50) NULL,
[PRMLabel] [varchar](200) NULL,
[PRMValue] [varchar](200) NULL,
[PRMOrder] [int] NULL
)
WANT TO INSERT SOMETHING LIKE THIS:
PRMLabelPRMValueParmPRMOrder
January1Month1
February2Month2
March3Month3
April4Month4
May5Month5
June6Month6
July7Month7
August8Month8
September9Month9
October10Month10
November11Month11
December12Month12
1st1Quarter1
2nd2Quarter2
3rd3Quarter3
4th4Quarter4
September 14, 2011 at 1:18 pm
What exactly is your question?
And what is the purpose of this table? To me it seems a little strange....
September 14, 2011 at 1:29 pm
I have to do something in report using this table.
September 14, 2011 at 2:38 pm
komal145 (9/14/2011)
I have to do something in report using this table.
That doesn't really answer the questions.
There are several things wrong with the table design as well as the concept in general:
1) Why would a column that would hold max. 9 character (September) be specified as varchar(200)?
2) PRMValue seems to hold tinyint values only. Why is it varchar(200)?
3) What is the primary key and the clustered index?
4) What would you do in case of the requirement to display the month name in a different language (e.g. Spanish)?
5) If this is some sort of listbox, why isn't it hardcoded in the app? (What are the chances to have a 5th quarter or a 13th month?)
Until we have more details what you're trying to approach, all I can say is: it should be possible to insert the values presented into the posted target table design. But I currently don't see a reason for doing so.
September 14, 2011 at 4:38 pm
komal145 (9/14/2011)
I HAVE TABLE SOMETHING LIKE THIS:CREATE TABLE #Parm_Filter
(
[Parm] [varchar](50) NULL,
[PRMLabel] [varchar](200) NULL,
[PRMValue] [varchar](200) NULL,
[PRMOrder] [int] NULL
)
WANT TO INSERT SOMETHING LIKE THIS:
PRMLabelPRMValueParmPRMOrder
January1Month1
February2Month2
March3Month3
April4Month4
May5Month5
June6Month6
July7Month7
August8Month8
September9Month9
October10Month10
November11Month11
December12Month12
1st1Quarter1
2nd2Quarter2
3rd3Quarter3
4th4Quarter4
Here I'm inserting a sample row into the table... I understand the question as you have to insert the data into the table
CREATE TABLE #Parm_Filter
(
[Parm] [varchar](50) NULL,
[PRMLabel] [varchar](200) NULL,
[PRMValue] [varchar](200) NULL,
[PRMOrder] [int] NULL
)
GO
Insert into #Parm_Filter(PRMLabel,PRMValue,Parm,PRMOrder)
Values('January','1','Month','1')
GO
SELECT PRMLabel,PRMValue,Parm,PRMOrder FROM #Parm_Filter
GO
September 14, 2011 at 7:24 pm
komal145 (9/14/2011)
I HAVE TABLE SOMETHING LIKE THIS:CREATE TABLE #Parm_Filter
(
[Parm] [varchar](50) NULL,
[PRMLabel] [varchar](200) NULL,
[PRMValue] [varchar](200) NULL,
[PRMOrder] [int] NULL
)
WANT TO INSERT SOMETHING LIKE THIS:
PRMLabelPRMValueParmPRMOrder
January1Month1
February2Month2
March3Month3
April4Month4
May5Month5
June6Month6
July7Month7
August8Month8
September9Month9
October10Month10
November11Month11
December12Month12
1st1Quarter1
2nd2Quarter2
3rd3Quarter3
4th4Quarter4
Ummmm... I suggest that you tell us what you actually want to use the table for... whatever it is you want to do, there might be a better way. Please don't take this as a slam... it's just an observation. If you don't know how to do this simple table population, I'm thinking you might be in over your head for whatever else you might need to do and, if we knew what it was, we might be able to help.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply