显示标签为“helloi”的博文。显示所有博文
显示标签为“helloi”的博文。显示所有博文

2012年3月11日星期日

Fixed header

Hello!

I have a report that the users reach from an url. In the url I have rc:parameters = false. That part works fine. But when I use rc:parameters = false, the property fixed header doesn't seem to work. If I run the report from the report server it works fine, but not from the url.

Any ideas?

/C

Fixed headers don't work if the url access displays more than one page at the same time. The best way to ensure that fixed headers work is to run with rc:toolbar=true|||

Ok, I see...
I tried with "rc:toolbar=true" and set all parameters to "hidden" instead. It works fine, even though it feels a little bit slower when the report is rendering.
Another problem I faced before when I had rc:Parameters = false was that when I did a user sort on any column, the ability to go to next page was gone.
Before the user sort, I could scroll down to next page but when I sorted a column, I could only scroll the first page.
Is it a bug?

2012年3月9日星期五

Fix Replace function plz!

Hello!
I need to replace a string which starts from "DBX:" and ends to "Addr1:"
with a word "APPLE". The cloumn is Name in #temp table. I am captuting
it correctly but not using the replace function the right way. It is
replacing eveywhere which I dont want.
Thanks for your help.
create table #temp
(ID int, Name varchar(80))
insert into #temp values(23, 'Name: Smith Black Jones DBX: Smith Jones
Addr1: 1234')
insert into #temp values(27, 'Name: John Doe DBX: John Doe Addr1: 9999')
insert into #temp values(25, 'Name: Batman DBX: Robin Addr1: 1234')
select
--ID,
--Captured = substring(Name, charindex('DBX:', Name) + 4,
--charindex('Addr1:', Name) - charindex('DBX:', Name)-4),
Final = replace(Name, substring(Name, charindex('DBX:', Name) + 4,
charindex('Addr1:', Name) - charindex('DBX:', Name)-4), ' APPLE ')
from #temp
I am getting this:
Name: Smith Black Jones DBX: APPLE Addr1: 1234
Name: APPLE DBX: APPLE Addr1: 9999
Name: Batman DBX: APPLE Addr1: 1234
And I want this:
Name: Smith Black Jones DBX: APPLE Addr1: 1234
Name: John Doe DBX: APPLE Addr1: 9999
Name: Batman DBX: APPLE Addr1: 1234
*** Sent via Developersdex http://www.examnotes.net ***Test,
Try:
SELECT SUBSTRING([NAME],7,DATALENGTH([NAME])) AS 'NAME'
FROM #TEMP
HTH
Jerry
"Test Test" <farooqhs_2000@.yahoo.com> wrote in message
news:OwySQyZ1FHA.3864@.TK2MSFTNGP12.phx.gbl...
> Hello!
> I need to replace a string which starts from "DBX:" and ends to "Addr1:"
> with a word "APPLE". The cloumn is Name in #temp table. I am captuting
> it correctly but not using the replace function the right way. It is
> replacing eveywhere which I dont want.
> Thanks for your help.
> create table #temp
> (ID int, Name varchar(80))
> insert into #temp values(23, 'Name: Smith Black Jones DBX: Smith Jones
> Addr1: 1234')
> insert into #temp values(27, 'Name: John Doe DBX: John Doe Addr1: 9999')
> insert into #temp values(25, 'Name: Batman DBX: Robin Addr1: 1234')
> select
> --ID,
> --Captured = substring(Name, charindex('DBX:', Name) + 4,
> --charindex('Addr1:', Name) - charindex('DBX:', Name)-4),
> Final = replace(Name, substring(Name, charindex('DBX:', Name) + 4,
> charindex('Addr1:', Name) - charindex('DBX:', Name)-4), ' APPLE ')
> from #temp
> I am getting this:
> Name: Smith Black Jones DBX: APPLE Addr1: 1234
> Name: APPLE DBX: APPLE Addr1: 9999
> Name: Batman DBX: APPLE Addr1: 1234
> And I want this:
> Name: Smith Black Jones DBX: APPLE Addr1: 1234
> Name: John Doe DBX: APPLE Addr1: 9999
> Name: Batman DBX: APPLE Addr1: 1234
>
> *** Sent via Developersdex http://www.examnotes.net ***|||Nothing wrong with the replace function, basically what you asked for was
this:
REPLACE('Name: John Doe DBX: John Doe Addr1: 9999', 'John Doe', 'APPLE')
This is what you're looking for I think:
select
--ID,
--Captured = substring(Name, charindex('DBX:', Name) + 4,
--charindex('Addr1:', Name) - charindex('DBX:', Name)-4),
--Final = replace(Name, substring(Name, charindex('DBX:', Name) + 4,
--charindex('Addr1:', Name) - charindex('DBX:', Name)-4), ' APPLE '),
Correct = Left(Name, charindex('DBX:', Name) + 3) +
replace(substring(Name, charindex('DBX:', Name) + 4, LEN(Name)),
substring(Name, charindex('DBX:', Name) + 4,
charindex('Addr1:', Name) - charindex('DBX:', Name)-4), ' APPLE ')
from #temp
By the way, wouldn't it be much a bit cleaner to have separate columns for
Name, DBX and Addr1?
"Test Test" <farooqhs_2000@.yahoo.com> wrote in message
news:OwySQyZ1FHA.3864@.TK2MSFTNGP12.phx.gbl...
> Hello!
> I need to replace a string which starts from "DBX:" and ends to "Addr1:"
> with a word "APPLE". The cloumn is Name in #temp table. I am captuting
> it correctly but not using the replace function the right way. It is
> replacing eveywhere which I dont want.
> Thanks for your help.
> create table #temp
> (ID int, Name varchar(80))
> insert into #temp values(23, 'Name: Smith Black Jones DBX: Smith Jones
> Addr1: 1234')
> insert into #temp values(27, 'Name: John Doe DBX: John Doe Addr1: 9999')
> insert into #temp values(25, 'Name: Batman DBX: Robin Addr1: 1234')
> select
> --ID,
> --Captured = substring(Name, charindex('DBX:', Name) + 4,
> --charindex('Addr1:', Name) - charindex('DBX:', Name)-4),
> Final = replace(Name, substring(Name, charindex('DBX:', Name) + 4,
> charindex('Addr1:', Name) - charindex('DBX:', Name)-4), ' APPLE ')
> from #temp
> I am getting this:
> Name: Smith Black Jones DBX: APPLE Addr1: 1234
> Name: APPLE DBX: APPLE Addr1: 9999
> Name: Batman DBX: APPLE Addr1: 1234
> And I want this:
> Name: Smith Black Jones DBX: APPLE Addr1: 1234
> Name: John Doe DBX: APPLE Addr1: 9999
> Name: Batman DBX: APPLE Addr1: 1234
>
> *** Sent via Developersdex http://www.examnotes.net ***|||Thanks but this is not what I am looking for. I need this:
Name: Smith Black Jones DBX: APPLE Addr1: 1234
Name: John Doe DBX: APPLE Addr1: 9999
Name: Batman DBX: APPLE Addr1: 1234
The APPLE has been updated in between the DBX: and Addr1: in the Name
column. My SQL is not working in John Doe case but John Doe is in two
places and I want to see the replacement in one place only (which is
from DBX: to Addr1:).
Hope this information helps.
*** Sent via Developersdex http://www.examnotes.net ***|||I don't know what to tell you, but my query returned me this (which is what
you say you're looking for) :
Name: Smith Black Jones DBX: APPLE Addr1: 1234
Name: John Doe DBX: APPLE Addr1: 9999
Name: Batman DBX: APPLE Addr1: 1234
Copy and paste this (just to verify that there wasn't a copy / paste mistake
when you ran it last time) :
___
create table #temp
(ID int, Name varchar(80))
insert into #temp values(23, 'Name: Smith Black Jones DBX: Smith Jones
Addr1: 1234')
insert into #temp values(27, 'Name: John Doe DBX: John Doe Addr1: 9999')
insert into #temp values(25, 'Name: Batman DBX: Robin Addr1: 1234')
select
--ID,
--Captured = substring(Name, charindex('DBX:', Name) + 4,
--charindex('Addr1:', Name) - charindex('DBX:', Name)-4),
--Final = replace(Name, substring(Name, charindex('DBX:', Name) + 4,
--charindex('Addr1:', Name) - charindex('DBX:', Name)-4), ' APPLE '),
Correct = Left(Name, charindex('DBX:', Name) + 3) +
replace(substring(Name, charindex('DBX:', Name) + 4, LEN(Name)),
substring(Name, charindex('DBX:', Name) + 4,
charindex('Addr1:', Name) - charindex('DBX:', Name)-4), ' APPLE ')
from #temp
___
"Test Test" <farooqhs_2000@.yahoo.com> wrote in message
news:%23YMaCDa1FHA.3816@.TK2MSFTNGP14.phx.gbl...
> Thanks but this is not what I am looking for. I need this:
> Name: Smith Black Jones DBX: APPLE Addr1: 1234
> Name: John Doe DBX: APPLE Addr1: 9999
> Name: Batman DBX: APPLE Addr1: 1234
> The APPLE has been updated in between the DBX: and Addr1: in the Name
> column. My SQL is not working in John Doe case but John Doe is in two
> places and I want to see the replacement in one place only (which is
> from DBX: to Addr1:).
> Hope this information helps.
>
> *** Sent via Developersdex http://www.examnotes.net ***|||Sorry test...misread the data requirements prior to posting this query.
"Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
news:u6EPH3Z1FHA.2792@.tk2msftngp13.phx.gbl...
> Test,
> Try:
> SELECT SUBSTRING([NAME],7,DATALENGTH([NAME])) AS 'NAME'
> FROM #TEMP
>
> HTH
> Jerry
> "Test Test" <farooqhs_2000@.yahoo.com> wrote in message
> news:OwySQyZ1FHA.3864@.TK2MSFTNGP12.phx.gbl...
>|||Thanks ESPNSTI! It works fine! Sorry I missed the solution in your
initial posting. Thanks!
*** Sent via Developersdex http://www.examnotes.net ***|||ESPN! I have one more condiction to take care of which is to replace
anything after "Name:" and before "DBX:" with a word ' XXXX '.
so I tried it but again my SQL is not working for John Doe bc it is in
two place.
Now,
select replace(Name, substring(Name, charindex(':', Name)+2,
charindex('DBX:', Name)- charindex(':', Name)-2), ' XXXXX ')
from #temp
I am getting this:
Name: XXXXX DBX: Smith Jones Addr1: 1234
Name: XXXXX DBX: XXXXX Addr1: 9999
Name: XXXXX DBX: Robin Addr1: 1234
An I want this:
Name: XXXXX DBX: Smith Jones Addr1: 1234
Name: XXXXX DBX: John Doe Addr1: 9999
Name: XXXXX DBX: Robin Addr1: 1234
I would appreciate your help! Thanks.
*** Sent via Developersdex http://www.examnotes.net ***

2012年2月26日星期日

First post to SQL server

Hello!

I am programming with a SQL backend and have noticed something I can't seem to explain and it appears to be on the SQL backend and not my program. I have two tables which are very large (100K + records). When posting a change for the first time to each of them, the SQL server took 5-10 minutes to commit the change. After the change finally commits, I can add and edit without any problem or speed lag. It almost seemed like the sql server was doing something in the background, like building a list or gathering info it didn't have until the first time the table was posted to. Does anyone know why this type of situation would occur? I notice a bit of a slowdown in posting with other table the first time as well, but not as long of a time because they are smaller tables. Thanks!

RichardYes, you're right. SQLServer does something in background. It's called execution plan. In a few words SQLServer analyse your query and determine the fastest way to complete it. Second time it already has the exec plan cached so it simply use the plan.

You also have to pay attention to the fact that SQLServer write almost everything that it does (execept a few commands like bulk insert or bulk copy - see Books on Line, it might be interesting for you) to its logs, so if you insert a large amount of data on a row-by-row basis (instead of a batch) SQLServer will write a line in the log for every record that , so there's another bottleneck of your application.

ionut|||That explains it, thanks for your help!

Originally posted by ionut calin
Yes, you're right. SQLServer does something in background. It's called execution plan. In a few words SQLServer analyse your query and determine the fastest way to complete it. Second time it already has the exec plan cached so it simply use the plan.

You also have to pay attention to the fact that SQLServer write almost everything that it does (execept a few commands like bulk insert or bulk copy - see Books on Line, it might be interesting for you) to its logs, so if you insert a large amount of data on a row-by-row basis (instead of a batch) SQLServer will write a line in the log for every record that , so there's another bottleneck of your application.

ionut|||5-10 minutes still seems like an awfully long time to create an execution plan and log a transaction, unless he's updating all of the records or something.

Are you doing an insert or an update that first time? How many records are being affected? Does it take as long if you execute the same query in QueryAnalyzer instead of through your application?|||If we are talking about inserting (or updating for thet matter) 100K+ rows and if this is done on a row by row basis, I don't think 5-10 mins it's a long time. Of course in this discution hardware of the server plays an important role too.

ionut|||I believe that is how many rows are in the table rather than how many rows are being inserted/updated. Perhaps I'm reading it wrong, though.

It's true, though, that if it's not a bulk-insert and 100,000 rows are being inserted, depending on hardware 5-10 minutes is reasonable. I read it, however, to be inserting a single row into a 100k+ row table.

Perhaps Thread77 can clarify if there is still an issue.|||That is how many rows are in the table, there was only one row being inserted/edited at the time of the slowdown. Another factor though was the server we were using to test on. It had a low amount of memory, so when the larger tables were first posted to the memory spiked and also attributed to the slowdown. We ran the same test on another server and although there was a slowdown the first time, it wasn't nearly as bad.

Thanks for all your replies!

Originally posted by loach
I believe that is how many rows are in the table rather than how many rows are being inserted/updated. Perhaps I'm reading it wrong, though.

It's true, though, that if it's not a bulk-insert and 100,000 rows are being inserted, depending on hardware 5-10 minutes is reasonable. I read it, however, to be inserting a single row into a 100k+ row table.

Perhaps Thread77 can clarify if there is still an issue.

2012年2月19日星期日

Firewall and Ports

Hello
I would like to know which ports need to be open to enable SQL server 2000
connectivity by default.
ThanksHi
If using SQL Server authentication, 1433 (If you server is listening on it's
default port).
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Alekhine" <Alekhine@.discussions.microsoft.com> wrote in message
news:7D5AE212-2225-4837-A528-C38F8099456F@.microsoft.com...
> Hello
> I would like to know which ports need to be open to enable SQL server 2000
> connectivity by default.
> Thanks|||287932 INF: TCP Ports Needed for Communication to SQL Server Through a
Firewall
http://support.microsoft.com/?id=287932
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.