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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How can Get 10,000 characters in a string varaible

Author  Topic 

Atif
Starting Member

9 Posts

Posted - 2006-07-07 : 23:36:04
Hi

I am using nvarchar(MAX) string variable. But its length is maximum upto 8,000 charaters. But I want to assign 10,000 characters. So how can I get this.

Thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-07-08 : 01:27:28
Since you are using the syntax nvarchar(max), I assume you use SQL Server 2005.

DECLARE @T NVARCHAR(MAX)

SELECT @T = REPLACE('Peter', 2000) -- 2000 times the length of 'Peter' is 10000 characters

SELECT LEN(@T), DATALENGTH(@T)


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Atif
Starting Member

9 Posts

Posted - 2006-07-08 : 01:44:16
REPLACE function use three parameters
REPLACE('String1','String2','String3')
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-07-08 : 01:47:34
quote:
Originally posted by Atif

REPLACE function use three parameters
REPLACE('String1','String2','String3')

Sorry, should be REPLICATE, not replace.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Atif
Starting Member

9 Posts

Posted - 2006-07-08 : 02:08:29
Following is code. Now u can easily understand the problem.
I want to create view using store procedure. But when I assign fileds to vaiable named "@strQuery" . It will discard some characters from the string. You can check this just copy and execute this script.


Alter procedure sp_alc_cel_wk
AS

declare @strQuery varchar(MAX)

SET @strQuery='Create View ALC_CEL_WK'
SET @strQuery=@strQuery+'AS'
SET @strQuery='SELECT Year(DATE) As Year,DatePart(wk,DATE) AS Week,MIN(Date) AS minDate,MAX(date) AS maxDate, Region, vCellID, CellID, CellName, BSCName, MSCName, MC,'

SET @strQuery=@strQuery+'SUM(MC01) AS MC01 ,SUM(MC02) AS MC02 ,SUM(MC02A) AS MC02A ,SUM(MC02B) AS MC02B ,SUM(MC02C) AS MC02C ,SUM(MC02D) AS MC02D ,SUM(MC02E) AS MC02E ,SUM(MC02F) AS MC02F ,SUM(MC02G) AS MC02G ,SUM(MC02H) AS MC02H ,SUM(MC02I) AS MC02I ,SUM(MC03) AS MC03 ,SUM(MC04) AS MC04 ,SUM(MC07) AS MC07 ,SUM(MC10) AS MC10 ,SUM(MC101) AS MC101 ,SUM(MC1040) AS MC1040 ,SUM(MC1044) AS MC1044 ,SUM(MC1050) AS MC1050 ,SUM(MC137) AS MC137 ,SUM(MC138) AS MC138 ,SUM(MC13A) AS MC13A ,SUM(MC13B) AS MC13B ,SUM(MC140A) AS MC140A ,SUM(MC140B) AS MC140B ,SUM(MC141) AS MC141 ,SUM(MC142E) AS MC142E ,SUM(MC142F) AS MC142F ,SUM(MC144E) AS MC144E ,SUM(MC144F) AS MC144F ,SUM(MC147) AS MC147 ,SUM(MC148) AS MC148 ,SUM(MC149) AS MC149 ,SUM(MC14A) AS MC14A ,SUM(MC14C) AS MC14C ,SUM(MC151) AS MC151 ,SUM(MC153) AS MC153 ,SUM(MC15A) AS MC15A ,SUM(MC15B) AS MC15B ,SUM(MC161) AS MC161 ,SUM(MC162) AS MC162 ,SUM(MC170) AS MC170 ,SUM(MC196) AS MC196 ,SUM(MC197) AS MC197 ,SUM(MC24) AS MC24 ,SUM(MC250) AS MC250 ,SUM(MC26) AS MC26 ,SUM(MC27) AS MC27 ,SUM(MC28A) AS MC28A ,SUM(MC29A) AS MC29A ,SUM(MC31) AS MC31 ,SUM(MC320A) AS MC320A ,SUM(MC320B) AS MC320B ,SUM(MC320C) AS MC320C ,SUM(MC320D) AS MC320D ,SUM(MC320E) AS MC320E ,SUM(MC34) AS MC34 ,SUM(MC370A) AS MC370A ,SUM(MC370B) AS MC370B ,SUM(MC380A) AS MC380A ,SUM(MC380B) AS MC380B ,SUM(MC380C) AS MC380C ,SUM(MC380D) AS MC380D ,SUM(MC380E) AS MC380E ,SUM(MC380F) AS MC380F ,SUM(MC381) AS MC381 ,SUM(MC390) AS MC390 ,SUM(MC400) AS MC400 ,SUM(MC41B) AS MC41B ,SUM(MC448A) AS MC448A ,SUM(MC448B) AS MC448B ,SUM(MC449) AS MC449 ,SUM(MC460A) AS MC460A ,SUM(MC461) AS MC461 ,SUM(MC462A) AS MC462A ,SUM(MC462B) AS MC462B ,SUM(MC462C) AS MC462C ,SUM(MC463A) AS MC463A ,SUM(MC463B) AS MC463B ,SUM(MC463C) AS MC463C ,SUM(MC541) AS MC541 ,SUM(MC541A) AS MC541A ,SUM(MC551) AS MC551 ,SUM(MC555) AS MC555 ,SUM(MC561) AS MC561 ,SUM(MC586A) AS MC586A ,SUM(MC586B) AS MC586B ,SUM(MC586C) AS MC586C ,SUM(MC607) AS MC607 ,SUM(MC612A) AS MC612A ,SUM(MC612B) AS MC612B ,SUM(MC612C) AS MC612C ,SUM(MC612D) AS MC612D ,SUM(MC621) AS MC621 ,SUM(MC642) AS MC642 ,SUM(MC643) AS MC643 ,SUM(MC645A) AS MC645A ,SUM(MC646) AS MC646 ,SUM(MC647) AS MC647 ,SUM(MC648) AS MC648 ,SUM(MC650) AS MC650 ,SUM(MC652) AS MC652 ,SUM(MC653) AS MC653 ,SUM(MC655A) AS MC655A ,SUM(MC656) AS MC656 ,SUM(MC657) AS MC657 ,SUM(MC658) AS MC658 ,SUM(MC660) AS MC660 ,SUM(MC662) AS MC662 ,SUM(MC663) AS MC663 ,SUM(MC667) AS MC667 ,SUM(MC670) AS MC670 ,SUM(MC671) AS MC671 ,SUM(MC672) AS MC672 ,SUM(MC673) AS MC673 ,SUM(MC674) AS MC674 ,SUM(MC675) AS MC675 ,SUM(MC676) AS MC676 ,SUM(MC677) AS MC677 ,SUM(MC678) AS MC678 ,SUM(MC679) AS MC679 ,SUM(MC701A) AS MC701A ,SUM(MC701B) AS MC701B ,SUM(MC701C) AS MC701C ,SUM(MC701D) AS MC701D ,SUM(MC701E) AS MC701E ,SUM(MC702A) AS MC702A ,SUM(MC702B) AS MC702B ,SUM(MC702C) AS MC702C ,SUM(MC703) AS MC703 ,SUM(MC704A) AS MC704A ,SUM(MC704B) AS MC704B ,SUM(MC705) AS MC705 ,SUM(MC706) AS MC706 ,SUM(MC710) AS MC710 ,SUM(MC711) AS MC711 ,SUM(MC712) AS MC712 ,SUM(MC713) AS MC713 ,SUM(MC714) AS MC714 ,SUM(MC717A) AS MC717A ,SUM(MC717B) AS MC717B ,SUM(MC718) AS MC718 ,SUM(MC736) AS MC736 ,SUM(MC739) AS MC739 ,SUM(MC746B) AS MC746B ,SUM(MC785A) AS MC785A ,SUM(MC785D) AS MC785D ,SUM(MC785E) AS MC785E ,SUM(MC785F) AS MC785F ,SUM(MC800) AS MC800 ,SUM(MC801A) AS MC801A ,SUM(MC801B) AS MC801B ,SUM(MC802A) AS MC802A ,SUM(MC802B) AS MC802B ,SUM(MC803) AS MC803 ,SUM(MC804A) AS MC804A ,SUM(MC804B) AS MC804B ,SUM(MC805A) AS MC805A ,SUM(MC805B) AS MC805B ,SUM(MC81) AS MC81 ,SUM(MC812) AS MC812 ,SUM(MC820) AS MC820 ,SUM(MC821) AS MC821 ,SUM(MC830) AS MC830 ,SUM(MC831) AS MC831 ,SUM(MC850) AS MC850 ,SUM(MC870) AS MC870 ,SUM(MC871) AS MC871 ,SUM(MC8A) AS MC8A ,SUM(MC8B) AS MC8B ,SUM(MC8C) AS MC8C ,SUM(MC8D) AS MC8D ,SUM(MC901) AS MC901 ,SUM(MC902) AS MC902 ,SUM(MC903) AS MC903 ,SUM(MC91) AS MC91 ,SUM(MC921A) AS MC921A ,SUM(MC921B) AS MC921B ,SUM(MC921C) AS MC921C ,SUM(MC921D) AS MC921D ,SUM(MC921E) AS MC921E ,SUM(MC922A) AS MC922A ,SUM(MC922B) AS MC922B ,SUM(MC922C) AS MC922C ,SUM(MC922D) AS MC922D ,SUM(MC923A) AS MC923A ,SUM(MC923B) AS MC923B ,SUM(MC923C) AS MC923C ,SUM(MC923D) AS MC923D ,MAX(MSF1) AS MSF1 ,MAX(MAX_PDCH) AS MAX_PDCH ,SUM(P1) AS P1 ,SUM(P10) AS P10 ,SUM(P105c) AS P105c ,SUM(P105d) AS P105d ,SUM(P105e) AS P105e ,SUM(P105f) AS P105f ,SUM(P105g) AS P105g ,SUM(P105h) AS P105h ,SUM(P11) AS P11 ,SUM(P13) AS P13 ,SUM(P14) AS P14 ,SUM(P146) AS P146 ,SUM(P147) AS P147 ,SUM(P15) AS P15 ,SUM(P150b) AS P150b ,SUM(P150c) AS P150c ,SUM(P16) AS P16 ,SUM(P160) AS P160 ,SUM(P161) AS P161 ,SUM(P162) AS P162 ,SUM(P163) AS P163 ,SUM(P164) AS P164 ,SUM(P165) AS P165 ,SUM(P166) AS P166 ,SUM(P167) AS P167 ,SUM(P168) AS P168 ,SUM(P169) AS P169 ,SUM(P19) AS P19 ,SUM(P20a) AS P20a ,SUM(P20b) AS P20b ,SUM(P20c) AS P20c ,SUM(P20d) AS P20d ,SUM(P20e) AS P20e ,SUM(P21a) AS P21a ,SUM(P21b) AS P21b ,SUM(P21c) AS P21c ,SUM(P21d) AS P21d ,SUM(P21e) AS P21e ,SUM(P22) AS P22 ,SUM(P24) AS P24 ,SUM(P26) AS P26 ,SUM(P27) AS P27 ,SUM(P28) AS P28 ,SUM(P29a) AS P29a ,SUM(P29b) AS P29b ,SUM(P29c) AS P29c ,SUM(P29d) AS P29d ,SUM(P302b) AS P302b ,SUM(P302c) AS P302c ,SUM(P303a) AS P303a ,SUM(P303b) AS P303b ,SUM(P30a) AS P30a ,SUM(P30b) AS P30b ,SUM(P30c) AS P30c ,SUM(P30d) AS P30d ,SUM(P310a) AS P310a ,SUM(P310b) AS P310b ,SUM(P310c) AS P310c ,SUM(P310d) AS P310d ,SUM(P335) AS P335 ,SUM(P336) AS P336 ,SUM(P35) AS P35 ,SUM(P350a) AS P350a ,SUM(P350b) AS P350b ,SUM(P351a) AS P351a ,SUM(P351b) AS P351b ,SUM(P352a) AS P352a ,SUM(P352b) AS P352b ,SUM(P36) AS P36 ,SUM(P38) AS P38 ,SUM(P385a) AS P385a ,SUM(P385b) AS P385b ,SUM(P38b) AS P38b ,SUM(P38c) AS P38c ,SUM(P38d) AS P38d ,SUM(P39) AS P39 ,SUM(P396a) AS P396a ,SUM(P396b) AS P396b ,SUM(P397) AS P397 ,SUM(P399) AS P399 ,SUM(P40) AS P40 ,SUM(P400) AS P400 ,SUM(P401) AS P401 ,SUM(P403a) AS P403a ,SUM(P403b) AS P403b ,SUM(P403c) AS P403c ,SUM(P403d) AS P403d ,SUM(P404a) AS P404a ,SUM(P404b) AS P404b ,SUM(P404c) AS P404c ,SUM(P404d) AS P404d ,SUM(P405a) AS P405a ,SUM(P405b) AS P405b ,SUM(P405c) AS P405c ,SUM(P405d) AS P405d ,SUM(P406a) AS P406a ,SUM(P406b) AS P406b ,SUM(P406c) AS P406c ,SUM(P406d) AS P406d ,SUM(P407a) AS P407a ,SUM(P407b) AS P407b ,SUM(P407c) AS P407c ,SUM(P407d) AS P407d ,SUM(P408a) AS P408a ,SUM(P408b) AS P408b ,SUM(P408c) AS P408c ,SUM(P408d) AS P408d ,SUM(P409) AS P409 ,SUM(P410) AS P410 ,SUM(P411) AS P411 ,SUM(P412) AS P412 ,SUM(P413) AS P413 ,SUM(P414) AS P414 ,SUM(P415) AS P415 ,SUM(P416) AS P416 ,SUM(P417) AS P417 ,SUM(P418) AS P418 ,SUM(P419) AS P419 ,SUM(P420) AS P420 ,SUM(P421) AS P421 ,SUM(P422) AS P422 ,SUM(P423a) AS P423a ,SUM(P423b) AS P423b ,SUM(P423c) AS P423c ,SUM(P423d) AS P423d ,SUM(P424a) AS P424a ,SUM(P424b) AS P424b ,SUM(P424c) AS P424c ,SUM(P424d) AS P424d ,SUM(P425a) AS P425a ,SUM(P425b) AS P425b ,SUM(P425c) AS P425c ,SUM(P425d) AS P425d ,SUM(P426a) AS P426a ,SUM(P426b) AS P426b ,SUM(P426c) AS P426c ,SUM(P426d) AS P426d ,SUM(P43) AS P43 ,SUM(P431a) AS P431a ,SUM(P431b) AS P431b ,SUM(P431c) AS P431c ,SUM(P432a) AS P432a ,SUM(P432b) AS P432b ,SUM(P432c) AS P432c ,SUM(P433a) AS P433a ,SUM(P433b) AS P433b ,SUM(P433c) AS P433c ,SUM(P433d) AS P433d ,SUM(P434a) AS P434a ,SUM(P434b) AS P434b ,SUM(P434c) AS P434c ,SUM(P434d) AS P434d ,SUM(P435a) AS P435a ,SUM(P435b) AS P435b ,SUM(P435c) AS P435c ,SUM(P435d) AS P435d ,SUM(P436) AS P436 ,SUM(P437a) AS P437a ,SUM(P437b) AS P437b ,SUM(P438a) AS P438a ,SUM(P438b) AS P438b ,SUM(P438c) AS P438c ,SUM(P438d) AS P438d ,SUM(P439) AS P439 ,SUM(P43a) AS P43a ,SUM(P43b) AS P43b ,SUM(P43c) AS P43c ,SUM(P43d) AS P43d ,SUM(P44) AS P44 ,SUM(P440a) AS P440a ,SUM(P440b) AS P440b ,SUM(P440c) AS P440c ,SUM(P441a) AS P441a ,SUM(P441b) AS P441b ,SUM(P441c) AS P441c ,SUM(P44a) AS P44a ,SUM(P44b) AS P44b ,SUM(P44c) AS P44c ,SUM(P44d) AS P44d ,SUM(P49) AS P49 ,SUM(P52a) AS P52a ,SUM(P52b) AS P52b ,SUM(P52c) AS P52c ,SUM(P52d) AS P52d ,SUM(P53a) AS P53a ,SUM(P53b) AS P53b ,SUM(P53c) AS P53c ,SUM(P54) AS P54 ,SUM(P55a) AS P55a ,SUM(P55b) AS P55b ,SUM(P55c) AS P55c ,SUM(P55d) AS P55d ,SUM(P55e) AS P55e ,SUM(P55f) AS P55f ,SUM(P55g) AS P55g ,SUM(P55h) AS P55h ,SUM(P55i) AS P55i ,SUM(P55j) AS P55j ,SUM(P55k) AS P55k ,SUM(P55l) AS P55l ,SUM(P55m) AS P55m ,SUM(P57a) AS P57a ,SUM(P57b) AS P57b ,SUM(P57c) AS P57c ,SUM(P57d) AS P57d ,SUM(P57e) AS P57e ,SUM(P57f) AS P57f ,SUM(P57g) AS P57g ,SUM(P57h) AS P57h ,SUM(P59) AS P59 ,SUM(P60) AS P60 ,SUM(P61) AS P61 ,SUM(P61a) AS P61a ,SUM(P61b) AS P61b ,SUM(P62a) AS P62a ,SUM(P62b) AS P62b ,SUM(P62c) AS P62c ,SUM(P62d) AS P62d ,SUM(P65) AS P65 ,SUM(P66) AS P66 ,SUM(P67) AS P67 ,SUM(P72c) AS P72c ,SUM(P72d) AS P72d ,SUM(P73c) AS P73c ,SUM(P73d) AS P73d ,SUM(P74) AS P74 ,SUM(P75) AS P75 ,SUM(P9) AS P9 ,SUM(P90a) AS P90a ,SUM(P90b) AS P90b ,SUM(P90c) AS P90c ,SUM(P90d) AS P90d ,SUM(P90e) AS P90e ,SUM(P90f) AS P90f ,SUM(P90g) AS P90g ,SUM(P91a) AS P91a ,SUM(P91b) AS P91b ,SUM(P91c) AS P91c ,SUM(P91d) AS P91d ,SUM(P91e) AS P91e ,SUM(P91f) AS P91f ,SUM(P91g) AS P91g ,SUM(P95) AS P95 ,SUM(P96) AS P96 ,SUM(P97) AS P97 ,SUM(P98a) AS P98a ,SUM(P98b) AS P98b ,SUM(P98c) AS P98c ,SUM(P98d) AS P98d ,SUM(P99) AS P99 ,MAX(GPU1) AS GPU1 ,MAX(TTP1) AS TTP1'

SET @strQuery=@strQuery+'FROM dbo.ALC_CEL_DY'

print @strQuery

EXEC sp_alc_cel_wk
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-07-08 : 02:46:49
Why in earth are you creating a view dynamically from a stored procedure?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

DustinMichaels
Constraint Violating Yak Guru

464 Posts

Posted - 2006-07-08 : 02:53:25
Looks like you need to normalize your data.
Go to Top of Page

Atif
Starting Member

9 Posts

Posted - 2006-07-08 : 02:56:05
I am getting these counters from Sybase DB. Counters are being changed dynamically. Some times add or some times remove. I have to add these counter in my Tables and views. That is really a panic. Thereby I am creating view from Store procedure.

Is there any solution
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-07-08 : 02:56:51
Run this code directly in Query Analyzer. This query has to be a nominiee for worst query ever written.
CREATE VIEW ALC_CEL_WK
AS
SELECT YEAR(Date) Year,
DATEPART(wk, Date) Week,
MIN(Date) minDate,
MAX(date) maxDate,
Region,
vCellID,
CellID,
CellName,
BSCName,
MSCName,
MC,
SUM(MC01) MC01, SUM(MC02) MC02, SUM(MC02A) MC02A, SUM(MC02B) MC02B, SUM(MC02C) MC02C, SUM(MC02D) MC02D,
SUM(MC02E) MC02E, SUM(MC02F) MC02F, SUM(MC02G) MC02G, SUM(MC02H) MC02H, SUM(MC02I) MC02I, SUM(MC03) MC03,
SUM(MC04) MC04, SUM(MC07) MC07, SUM(MC10) MC10, SUM(MC101) MC101, SUM(MC1040) MC1040, SUM(MC1044) MC1044,
SUM(MC1050) MC1050, SUM(MC137) MC137, SUM(MC138) MC138, SUM(MC13A) MC13A, SUM(MC13B) MC13B, SUM(MC140A) MC140A,
SUM(MC140B) MC140B, SUM(MC141) MC141, SUM(MC142E) MC142E, SUM(MC142F) MC142F, SUM(MC144E) MC144E,
SUM(MC144F) MC144F, SUM(MC147) MC147, SUM(MC148) MC148, SUM(MC149) MC149, SUM(MC14A) MC14A, SUM(MC14C) MC14C,
SUM(MC151) MC151, SUM(MC153) MC153, SUM(MC15A) MC15A, SUM(MC15B) MC15B, SUM(MC161) MC161, SUM(MC162) MC162,
SUM(MC170) MC170, SUM(MC196) MC196, SUM(MC197) MC197, SUM(MC24) MC24, SUM(MC250) MC250, SUM(MC26) MC26,
SUM(MC27) MC27, SUM(MC28A) MC28A, SUM(MC29A) MC29A, SUM(MC31) MC31, SUM(MC320A) MC320A, SUM(MC320B) MC320B,
SUM(MC320C) MC320C, SUM(MC320D) MC320D, SUM(MC320E) MC320E, SUM(MC34) MC34, SUM(MC370A) MC370A,
SUM(MC370B) MC370B, SUM(MC380A) MC380A, SUM(MC380B) MC380B, SUM(MC380C) MC380C, SUM(MC380D) MC380D,
SUM(MC380E) MC380E, SUM(MC380F) MC380F, SUM(MC381) MC381, SUM(MC390) MC390, SUM(MC400) MC400, SUM(MC41B) MC41B,
SUM(MC448A) MC448A, SUM(MC448B) MC448B, SUM(MC449) MC449, SUM(MC460A) MC460A, SUM(MC461) MC461,
SUM(MC462A) MC462A, SUM(MC462B) MC462B, SUM(MC462C) MC462C, SUM(MC463A) MC463A, SUM(MC463B) MC463B,
SUM(MC463C) MC463C, SUM(MC541) MC541, SUM(MC541A) MC541A, SUM(MC551) MC551, SUM(MC555) MC555, SUM(MC561) MC561,
SUM(MC586A) MC586A, SUM(MC586B) MC586B, SUM(MC586C) MC586C, SUM(MC607) MC607, SUM(MC612A) MC612A,
SUM(MC612B) MC612B, SUM(MC612C) MC612C, SUM(MC612D) MC612D, SUM(MC621) MC621, SUM(MC642) MC642,
SUM(MC643) MC643, SUM(MC645A) MC645A, SUM(MC646) MC646, SUM(MC647) MC647, SUM(MC648) MC648, SUM(MC650) MC650,
SUM(MC652) MC652, SUM(MC653) MC653, SUM(MC655A) MC655A, SUM(MC656) MC656, SUM(MC657) MC657, SUM(MC658) MC658,
SUM(MC660) MC660, SUM(MC662) MC662, SUM(MC663) MC663, SUM(MC667) MC667, SUM(MC670) MC670, SUM(MC671) MC671,
SUM(MC672) MC672, SUM(MC673) MC673, SUM(MC674) MC674, SUM(MC675) MC675, SUM(MC676) MC676, SUM(MC677) MC677,
SUM(MC678) MC678, SUM(MC679) MC679, SUM(MC701A) MC701A, SUM(MC701B) MC701B, SUM(MC701C) MC701C,
SUM(MC701D) MC701D, SUM(MC701E) MC701E, SUM(MC702A) MC702A, SUM(MC702B) MC702B, SUM(MC702C) MC702C,
SUM(MC703) MC703, SUM(MC704A) MC704A, SUM(MC704B) MC704B, SUM(MC705) MC705, SUM(MC706) MC706, SUM(MC710) MC710,
SUM(MC711) MC711, SUM(MC712) MC712, SUM(MC713) MC713, SUM(MC714) MC714, SUM(MC717A) MC717A, SUM(MC717B) MC717B,
SUM(MC718) MC718, SUM(MC736) MC736, SUM(MC739) MC739, SUM(MC746B) MC746B, SUM(MC785A) MC785A, SUM(MC785D) MC785D,
SUM(MC785E) MC785E, SUM(MC785F) MC785F, SUM(MC800) MC800, SUM(MC801A) MC801A, SUM(MC801B) MC801B,
SUM(MC802A) MC802A, SUM(MC802B) MC802B, SUM(MC803) MC803, SUM(MC804A) MC804A, SUM(MC804B) MC804B,
SUM(MC805A) MC805A, SUM(MC805B) MC805B, SUM(MC81) MC81, SUM(MC812) MC812, SUM(MC820) MC820, SUM(MC821) MC821,
SUM(MC830) MC830, SUM(MC831) MC831, SUM(MC850) MC850, SUM(MC870) MC870, SUM(MC871) MC871, SUM(MC8A) MC8A,
SUM(MC8B) MC8B, SUM(MC8C) MC8C, SUM(MC8D) MC8D, SUM(MC901) MC901, SUM(MC902) MC902, SUM(MC903) MC903,
SUM(MC91) MC91, SUM(MC921A) MC921A, SUM(MC921B) MC921B, SUM(MC921C) MC921C, SUM(MC921D) MC921D,
SUM(MC921E) MC921E, SUM(MC922A) MC922A, SUM(MC922B) MC922B, SUM(MC922C) MC922C, SUM(MC922D) MC922D,
SUM(MC923A) MC923A, SUM(MC923B) MC923B, SUM(MC923C) MC923C, SUM(MC923D) MC923D, MAX(MSF1) MSF1,
MAX(MAX_PDCH) MAX_PDCH, SUM(P1) P1, SUM(P10) P10, SUM(P105c) P105c, SUM(P105d) P105d, SUM(P105e) P105e,
SUM(P105f) P105f, SUM(P105g) P105g, SUM(P105h) P105h, SUM(P11) P11, SUM(P13) P13, SUM(P14) P14, SUM(P146) P146,
SUM(P147) P147, SUM(P15) P15, SUM(P150b) P150b, SUM(P150c) P150c, SUM(P16) P16, SUM(P160) P160, SUM(P161) P161,
SUM(P162) P162, SUM(P163) P163, SUM(P164) P164, SUM(P165) P165, SUM(P166) P166, SUM(P167) P167, SUM(P168) P168,
SUM(P169) P169, SUM(P19) P19, SUM(P20a) P20a, SUM(P20b) P20b, SUM(P20c) P20c, SUM(P20d) P20d, SUM(P20e) P20e,
SUM(P21a) P21a, SUM(P21b) P21b, SUM(P21c) P21c, SUM(P21d) P21d, SUM(P21e) P21e, SUM(P22) P22, SUM(P24) P24,
SUM(P26) P26, SUM(P27) P27, SUM(P28) P28, SUM(P29a) P29a, SUM(P29b) P29b, SUM(P29c) P29c, SUM(P29d) P29d,
SUM(P302b) P302b, SUM(P302c) P302c, SUM(P303a) P303a, SUM(P303b) P303b, SUM(P30a) P30a, SUM(P30b) P30b,
SUM(P30c) P30c, SUM(P30d) P30d, SUM(P310a) P310a, SUM(P310b) P310b, SUM(P310c) P310c, SUM(P310d) P310d,
SUM(P335) P335, SUM(P336) P336, SUM(P35) P35, SUM(P350a) P350a, SUM(P350b) P350b, SUM(P351a) P351a,
SUM(P351b) P351b, SUM(P352a) P352a, SUM(P352b) P352b, SUM(P36) P36, SUM(P38) P38, SUM(P385a) P385a,
SUM(P385b) P385b, SUM(P38b) P38b, SUM(P38c) P38c, SUM(P38d) P38d, SUM(P39) P39, SUM(P396a) P396a, SUM(P396b) P396b,
SUM(P397) P397, SUM(P399) P399, SUM(P40) P40, SUM(P400) P400, SUM(P401) P401, SUM(P403a) P403a, SUM(P403b) P403b,
SUM(P403c) P403c, SUM(P403d) P403d, SUM(P404a) P404a, SUM(P404b) P404b, SUM(P404c) P404c, SUM(P404d) P404d,
SUM(P405a) P405a, SUM(P405b) P405b, SUM(P405c) P405c, SUM(P405d) P405d, SUM(P406a) P406a, SUM(P406b) P406b,
SUM(P406c) P406c, SUM(P406d) P406d, SUM(P407a) P407a, SUM(P407b) P407b, SUM(P407c) P407c, SUM(P407d) P407d,
SUM(P408a) P408a, SUM(P408b) P408b, SUM(P408c) P408c, SUM(P408d) P408d, SUM(P409) P409, SUM(P410) P410,
SUM(P411) P411, SUM(P412) P412, SUM(P413) P413, SUM(P414) P414, SUM(P415) P415, SUM(P416) P416, SUM(P417) P417,
SUM(P418) P418, SUM(P419) P419, SUM(P420) P420, SUM(P421) P421, SUM(P422) P422, SUM(P423a) P423a, SUM(P423b) P423b,
SUM(P423c) P423c, SUM(P423d) P423d, SUM(P424a) P424a, SUM(P424b) P424b, SUM(P424c) P424c, SUM(P424d) P424d,
SUM(P425a) P425a, SUM(P425b) P425b, SUM(P425c) P425c, SUM(P425d) P425d, SUM(P426a) P426a, SUM(P426b) P426b,
SUM(P426c) P426c, SUM(P426d) P426d, SUM(P43) P43, SUM(P431a) P431a, SUM(P431b) P431b, SUM(P431c) P431c,
SUM(P432a) P432a, SUM(P432b) P432b, SUM(P432c) P432c, SUM(P433a) P433a, SUM(P433b) P433b, SUM(P433c) P433c,
SUM(P433d) P433d, SUM(P434a) P434a, SUM(P434b) P434b, SUM(P434c) P434c, SUM(P434d) P434d, SUM(P435a) P435a,
SUM(P435b) P435b, SUM(P435c) P435c, SUM(P435d) P435d, SUM(P436) P436, SUM(P437a) P437a, SUM(P437b) P437b,
SUM(P438a) P438a, SUM(P438b) P438b, SUM(P438c) P438c, SUM(P438d) P438d, SUM(P439) P439, SUM(P43a) P43a,
SUM(P43b) P43b, SUM(P43c) P43c, SUM(P43d) P43d, SUM(P44) P44, SUM(P440a) P440a, SUM(P440b) P440b,
SUM(P440c) P440c, SUM(P441a) P441a, SUM(P441b) P441b, SUM(P441c) P441c, SUM(P44a) P44a, SUM(P44b) P44b,
SUM(P44c) P44c, SUM(P44d) P44d, SUM(P49) P49, SUM(P52a) P52a, SUM(P52b) P52b, SUM(P52c) P52c, SUM(P52d) P52d,
SUM(P53a) P53a, SUM(P53b) P53b, SUM(P53c) P53c, SUM(P54) P54, SUM(P55a) P55a, SUM(P55b) P55b, SUM(P55c) P55c,
SUM(P55d) P55d, SUM(P55e) P55e, SUM(P55f) P55f, SUM(P55g) P55g, SUM(P55h) P55h, SUM(P55i) P55i, SUM(P55j) P55j,
SUM(P55k) P55k, SUM(P55l) P55l, SUM(P55m) P55m, SUM(P57a) P57a, SUM(P57b) P57b, SUM(P57c) P57c, SUM(P57d) P57d,
SUM(P57e) P57e, SUM(P57f) P57f, SUM(P57g) P57g, SUM(P57h) P57h, SUM(P59) P59, SUM(P60) P60, SUM(P61) P61,
SUM(P61a) P61a, SUM(P61b) P61b, SUM(P62a) P62a, SUM(P62b) P62b, SUM(P62c) P62c, SUM(P62d) P62d, SUM(P65) P65,
SUM(P66) P66, SUM(P67) P67, SUM(P72c) P72c, SUM(P72d) P72d, SUM(P73c) P73c, SUM(P73d) P73d, SUM(P74) P74,
SUM(P75) P75, SUM(P9) P9, SUM(P90a) P90a, SUM(P90b) P90b, SUM(P90c) P90c, SUM(P90d) P90d, SUM(P90e) P90e,
SUM(P90f) P90f, SUM(P90g) P90g, SUM(P91a) P91a, SUM(P91b) P91b, SUM(P91c) P91c, SUM(P91d) P91d, SUM(P91e) P91e,
SUM(P91f) P91f, SUM(P91g) P91g, SUM(P95) P95, SUM(P96) P96, SUM(P97) P97, SUM(P98a) P98a, SUM(P98b) P98b,
SUM(P98c) P98c, SUM(P98d) P98d, SUM(P99) P99, MAX(GPU1) GPU1, MAX(TTP1) TTP1
FROM dbo.ALC_CEL_DY
GROUP BY YEAR(Date) Year,
DATEPART(wk, Date) Week,
Region,
vCellID,
CellID,
CellName,
BSCName,
MSCName,
MC



Peter Larsson
Helsingborg, Sweden
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-07-08 : 02:58:24
WHy are you createing the view Dynamically? this is not at all effecient.. and secondly after using to variable if you are manage to create the view it will return error, since there is no group by clause used. so just check it

Chirag
Go to Top of Page

Atif
Starting Member

9 Posts

Posted - 2006-07-08 : 03:22:53
Basically, I want to display Monthly,Weekly, daily, Hourly reports based on these counters. I am getting 3,000 per hour recrods and 60,000 per day. If I put the data into different tables. Then I will have to use joins. It will take a lot of time to display the report.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-07-10 : 03:01:21
http://www.datamodel.org/NormalizationRules.html
http://weblogs.sqlteam.com/jeffs/archive/2005/05.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-07-10 : 04:14:46
is there anything that prevents you from creating the view on each of the databases?

are the counters based on the resulting rows/values of the view?

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -