Showing posts with label monitor. Show all posts
Showing posts with label monitor. Show all posts

Friday, March 23, 2012

Query for taking each word in a string, and putting a comma after it?

Hey all, i'm making the pages meta keywords on my site dynamic, and i was wondering is there is a string, for example "Dell 17" Monitor Brand New", that would split it into each word for the meta keywords. example "Dell, 17", Monitor, Brand, New" (and possibly to not put a comma on the last word?)

update myTable
set myField = Replace(myField, ' ', ' ,')

This will replace each space in your string and replace the space with a space + a comma.

I do the same thing (allowing for dynamic meta data) in my sites. However, I keep each word or phrase as a separate record in my db.
Then when I query for them I save them into an array and print array[0] + ", " array[1] + " ,"...

If you need to keep your data in it's original state than I suggest creating a temp table and modifying the temp table.

sql

Monday, March 12, 2012

Query Duration

When I run a procedure and monitor in Profiler, and add up the milliseconds
from the Duration column, it comes to approximately 28000 (28 seconds). Yet
the true elapased time is about 48 seconds.
I have run SET STATISTICS TIME and the cumulative duration of the individual
statements is still far less than the actual elapsed time.
Is there a way to account for vast discrepancy between the cumulative
duration in Profiler and the actual elapsed time?
NOTE:
I have "Include Actual Execution Plan" turned off in Management Studio just
to make sure it was not the overhead of creating this graphical plan when I
am performing these duration tests.
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums.aspx/sql-server/200707/1
If you're running Management Studio / Profiler locally against SQL Server on
another server, then you need to account for network latency, I/O, your
side's ability to render the results, etc.
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"cbrichards via droptable.com" <u3288@.uwe> wrote in message
news:7496c0e253cde@.uwe...
> When I run a procedure and monitor in Profiler, and add up the
> milliseconds
> from the Duration column, it comes to approximately 28000 (28 seconds).
> Yet
> the true elapased time is about 48 seconds.
> I have run SET STATISTICS TIME and the cumulative duration of the
> individual
> statements is still far less than the actual elapsed time.
> Is there a way to account for vast discrepancy between the cumulative
> duration in Profiler and the actual elapsed time?
> NOTE:
> I have "Include Actual Execution Plan" turned off in Management Studio
> just
> to make sure it was not the overhead of creating this graphical plan when
> I
> am performing these duration tests.
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forums.aspx/sql-server/200707/1
>
|||Not to mention the fact that Profiler's reported duration is totally out of
sync with reality in many cases

Adam Machanic
SQL Server MVP - http://sqlblog.com
Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:%23Hb$pYPvHHA.4520@.TK2MSFTNGP02.phx.gbl...
> If you're running Management Studio / Profiler locally against SQL Server
> on another server, then you need to account for network latency, I/O, your
> side's ability to render the results, etc.
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.sqlblog.com/
> http://www.aspfaq.com/5006
>
>
> "cbrichards via droptable.com" <u3288@.uwe> wrote in message
> news:7496c0e253cde@.uwe...
>

Query Duration

When I run a procedure and monitor in Profiler, and add up the milliseconds
from the Duration column, it comes to approximately 28000 (28 seconds). Yet
the true elapased time is about 48 seconds.
I have run SET STATISTICS TIME and the cumulative duration of the individual
statements is still far less than the actual elapsed time.
Is there a way to account for vast discrepancy between the cumulative
duration in Profiler and the actual elapsed time?
NOTE:
I have "Include Actual Execution Plan" turned off in Management Studio just
to make sure it was not the overhead of creating this graphical plan when I
am performing these duration tests.
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200707/1If you're running Management Studio / Profiler locally against SQL Server on
another server, then you need to account for network latency, I/O, your
side's ability to render the results, etc.
--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"cbrichards via SQLMonster.com" <u3288@.uwe> wrote in message
news:7496c0e253cde@.uwe...
> When I run a procedure and monitor in Profiler, and add up the
> milliseconds
> from the Duration column, it comes to approximately 28000 (28 seconds).
> Yet
> the true elapased time is about 48 seconds.
> I have run SET STATISTICS TIME and the cumulative duration of the
> individual
> statements is still far less than the actual elapsed time.
> Is there a way to account for vast discrepancy between the cumulative
> duration in Profiler and the actual elapsed time?
> NOTE:
> I have "Include Actual Execution Plan" turned off in Management Studio
> just
> to make sure it was not the overhead of creating this graphical plan when
> I
> am performing these duration tests.
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200707/1
>|||Are you collecting StartTime / EndTime? If so, what's the difference between
the two?
Regards,
Greg Linwood
SQL Server MVP
http://blogs.sqlserver.org.au/blogs/greg_linwood
Benchmark your query performance
http://www.SQLBenchmarkPro.com
"cbrichards via SQLMonster.com" <u3288@.uwe> wrote in message
news:7496c0e253cde@.uwe...
> When I run a procedure and monitor in Profiler, and add up the
> milliseconds
> from the Duration column, it comes to approximately 28000 (28 seconds).
> Yet
> the true elapased time is about 48 seconds.
> I have run SET STATISTICS TIME and the cumulative duration of the
> individual
> statements is still far less than the actual elapsed time.
> Is there a way to account for vast discrepancy between the cumulative
> duration in Profiler and the actual elapsed time?
> NOTE:
> I have "Include Actual Execution Plan" turned off in Management Studio
> just
> to make sure it was not the overhead of creating this graphical plan when
> I
> am performing these duration tests.
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200707/1
>|||Not to mention the fact that Profiler's reported duration is totally out of
sync with reality in many cases :)
Adam Machanic
SQL Server MVP - http://sqlblog.com
Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:%23Hb$pYPvHHA.4520@.TK2MSFTNGP02.phx.gbl...
> If you're running Management Studio / Profiler locally against SQL Server
> on another server, then you need to account for network latency, I/O, your
> side's ability to render the results, etc.
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.sqlblog.com/
> http://www.aspfaq.com/5006
>
>
> "cbrichards via SQLMonster.com" <u3288@.uwe> wrote in message
> news:7496c0e253cde@.uwe...
>> When I run a procedure and monitor in Profiler, and add up the
>> milliseconds
>> from the Duration column, it comes to approximately 28000 (28 seconds).
>> Yet
>> the true elapased time is about 48 seconds.
>> I have run SET STATISTICS TIME and the cumulative duration of the
>> individual
>> statements is still far less than the actual elapsed time.
>> Is there a way to account for vast discrepancy between the cumulative
>> duration in Profiler and the actual elapsed time?
>> NOTE:
>> I have "Include Actual Execution Plan" turned off in Management Studio
>> just
>> to make sure it was not the overhead of creating this graphical plan when
>> I
>> am performing these duration tests.
>> --
>> Message posted via SQLMonster.com
>> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200707/1
>

Query Duration

When I run a procedure and monitor in Profiler, and add up the milliseconds
from the Duration column, it comes to approximately 28000 (28 seconds). Yet
the true elapased time is about 48 seconds.
I have run SET STATISTICS TIME and the cumulative duration of the individual
statements is still far less than the actual elapsed time.
Is there a way to account for vast discrepancy between the cumulative
duration in Profiler and the actual elapsed time?
NOTE:
I have "Include Actual Execution Plan" turned off in Management Studio just
to make sure it was not the overhead of creating this graphical plan when I
am performing these duration tests.
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200707/1If you're running Management Studio / Profiler locally against SQL Server on
another server, then you need to account for network latency, I/O, your
side's ability to render the results, etc.
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"cbrichards via droptable.com" <u3288@.uwe> wrote in message
news:7496c0e253cde@.uwe...
> When I run a procedure and monitor in Profiler, and add up the
> milliseconds
> from the Duration column, it comes to approximately 28000 (28 seconds).
> Yet
> the true elapased time is about 48 seconds.
> I have run SET STATISTICS TIME and the cumulative duration of the
> individual
> statements is still far less than the actual elapsed time.
> Is there a way to account for vast discrepancy between the cumulative
> duration in Profiler and the actual elapsed time?
> NOTE:
> I have "Include Actual Execution Plan" turned off in Management Studio
> just
> to make sure it was not the overhead of creating this graphical plan when
> I
> am performing these duration tests.
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200707/1
>|||Are you collecting StartTime / EndTime? If so, what's the difference between
the two?
Regards,
Greg Linwood
SQL Server MVP
http://blogs.sqlserver.org.au/blogs/greg_linwood
Benchmark your query performance
http://www.SQLBenchmarkPro.com
"cbrichards via droptable.com" <u3288@.uwe> wrote in message
news:7496c0e253cde@.uwe...
> When I run a procedure and monitor in Profiler, and add up the
> milliseconds
> from the Duration column, it comes to approximately 28000 (28 seconds).
> Yet
> the true elapased time is about 48 seconds.
> I have run SET STATISTICS TIME and the cumulative duration of the
> individual
> statements is still far less than the actual elapsed time.
> Is there a way to account for vast discrepancy between the cumulative
> duration in Profiler and the actual elapsed time?
> NOTE:
> I have "Include Actual Execution Plan" turned off in Management Studio
> just
> to make sure it was not the overhead of creating this graphical plan when
> I
> am performing these duration tests.
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200707/1
>|||Not to mention the fact that Profiler's reported duration is totally out of
sync with reality in many cases
Adam Machanic
SQL Server MVP - http://sqlblog.com
Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in mess
age
news:%23Hb$pYPvHHA.4520@.TK2MSFTNGP02.phx.gbl...
> If you're running Management Studio / Profiler locally against SQL Server
> on another server, then you need to account for network latency, I/O, your
> side's ability to render the results, etc.
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.sqlblog.com/
> http://www.aspfaq.com/5006
>
>
> "cbrichards via droptable.com" <u3288@.uwe> wrote in message
> news:7496c0e253cde@.uwe...
>