Showing posts with label plan. Show all posts
Showing posts with label plan. Show all posts

Tuesday, March 20, 2012

Planning execution of package

How can i plan the execution of a package ?

For exemple, i want to execute it every 5 minutes from 8 AM to 20 PM

ThanksSQL Agent provides scheduled execution times etc. you can use to do such things.
Right click on the Agent node in Management Studio, select new job. Select the schedule tab and note that there are ways to schedule a job daily, and then sub obtions allow you to execute every x minutes or hours.|||

Great ! it works fine

|||Out of interest, what is it actually doing?

I'm just thinking that in some circumstances maybe it might be better to execute a package when some event occurs rather than continuously executing at defined intervals waiting for something to happen (if indeed this is what it is doing).

Another option might be the WMI EventWatcher task.

Just speculating of course...

-Jamie|||I use it to download stock quotes published on http server...|||Fair enough. SQL Agent is probably your best option then. I'll shutup now Smile

|||Smile I'm beginner then i listen everyone... your remarks are welcome....

ps : excuse my french accent...|||

Coroebus wrote:

Smile I'm beginner then i listen everyone... your remarks are welcome....

ps : excuse my french accent...

Your english is alot better than that of other people I have seen on many technical forums that speak it as their first language. Don't worry about that!

Planning ahead w/ SQL Server...

With the current web app that I am writing, I am starting to plan ahead to the scalability problems that I am planning on encountering with the number of users that I may have...

My hosting plan now allows for a 50MB SQL Server database, but, I know that will not last long, each user will be using 3-5MB each of the database, so I am going to outgrow my space fast.

Would looking into (until i have enough subscribers to get a dedicated host), SQL Hosting be a good idea? Atleast to start off with something like http://www.alentus.com/hosting/sqlserver.asp ?

But then again, would a SQL Database growing to large get bad? Within a few years, i expect to have at max 5,000 users, so that could grow to a 25GB database... with millions of rows.

Would breaking it up into smaller databases for each N amount of users be a wise idea? Or would it not really matter?

Any help is much appreciated

Happy New Year
Harold.Sql Server can easily handle huge amounts of data. In the schema of things 25 Gb and millions of rows isn't that big, particularly if the data is organized correctly and you have appropriate indexes defined. Breaking it up into smaller databases won't really help you and it would create a maintenance headache.

Of greater importance would be planning for the type of database server to handle future needs. But to start off with almost any decent server will do.

planning a replication

hallo
we have a sql2000 in the headquarter, and 3 new remote branches opening in few weeks with no sql servers installed yet.
We plan to setup a merge replica. The headquarter will have the highest activity on the replicated tables.
Shall we use all SQL2000 in the remote branches? Or could we use SQL2005, using a 2005 as a publisher and distributor?
TIA

If possible, upgrade all your nodes to SQL 2005. Merge replication performs and scales much better with the new pre-computed partitions. If this is not possible, then the only supported configuration is that the version of the distributor >= version of the publisher >= version of the subscriber. You can find more info about this in topic Using Multiple Versions of SQL Server in a Replication Topology".

|||ok thanks.
we're not going to upgrade the only sql2000 server we have, but i'd prefere to use sql2005 in the remote branches: in this scenario, i could set one of the 2005 as distributor and publisher.
This would be in contrast with the network topology, that centers everything in the main plant; BTW there will not be a big traffic of replicated data: a theoretical maximum of about 10 records/minute.

Plan not using Index

Hi all, I have been running into this same issue for some time now and can't
come up with a valid reason why SQL is doing what s is doing...
In a nut shell I have three tables
t1 is a fact table
t2 is a time dimension table
t3 is a parameter table that get loaded prior to the query being executed.
Simple code
Select count (t1.stuff)
From t1
Inner join t2
On
t1.date_key = t2.date_key
Inner join t3
on
t2.date_number between t3.start_date and t3.end_date
The optimizer performs a full table scan on the fact then applies the date
range filter... Though if I were to replace the start_date and end_date
values with hardcode values then the optimizer uses the index and pulls only
those records needed from the fact.
Really weird...
Any thoughts?
Thanks
EricStatistics for the tables/index are probably out of date. Update them
using UPDATE STATISTICS command. See if that helps. Or provide an index
hints to the query to specify which index you want it to use. Like:
Select count (t1.stuff)
>From t1
Inner join t2
On
t1.date_key = t2.date_key
Inner join t3
on
t2.date_number between t3.start_date and t3.end_date
WITH (INDEX(index_name))|||Statistics for the tables/index are probably out of date. Update them
using UPDATE STATISTICS command. See if that helps. Or provide an index
hints to the query to specify which index you want it to use. Like:
Select count (t1.stuff)
>From t1
Inner join t2
On
t1.date_key = t2.date_key
Inner join t3
on
t2.date_number between t3.start_date and t3.end_date
WITH (INDEX(index_name))|||Hello Green thank you for your quick reply.
Thats the odd thing... everything looking good. here are the stats: in
addtion supplying the index hint doesn't seem to change the plan result.
DBCC SHOW_STATISTICS
Statistics for FACT INDEX
Updated Rows Rows Sampled Steps
Density Average key length
-- -- -- --
-- --
Mar 6 2006 2:40PM 71680256 304424 197
160.55275 4.0
Statistics for TIME DIMENSION INDEX .
Updated Rows Rows Sampled Steps
Density Average key length
-- -- -- --
-- --
Feb 28 2006 6:46PM 7306 7306 4
1.368738E-4 4.0
DBCC SHOWCONTIG
DBCC SHOWCONTIG scanning Fact_TABLE' table...
Table: 'Pharmacy_Data_Fact_TABLE' (421576540); index ID: 4, database ID: 29
LEAF level scan performed.
- Pages Scanned........................: 155003
- Extents Scanned.......................: 24942
- Extent Switches.......................: 90108
- Avg. Pages per Extent..................: 6.2
- Scan Density [Best Count:Actual Count]......: 21.50% [19376:90109]
- Logical Scan Fragmentation ..............: 13.55%
- Extent Scan Fragmentation ...............: 11.16%
- Avg. Bytes Free per Page................: 1143.1
- Avg. Page Density (full)................: 85.88%
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.
DBCC SHOWCONTIG scanning 'Time_Dimension' table...
Table: 'Time_Dimension' (597577167); index ID: 27, database ID: 29
LEAF level scan performed.
- Pages Scanned........................: 14
- Extents Scanned.......................: 2
- Extent Switches.......................: 1
- Avg. Pages per Extent..................: 7.0
- Scan Density [Best Count:Actual Count]......: 100.00% [2:2]
- Logical Scan Fragmentation ..............: 0.00%
- Extent Scan Fragmentation ...............: 0.00%
- Avg. Bytes Free per Page................: 268.1
- Avg. Page Density (full)................: 96.69%
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.
"Green" wrote:

> Statistics for the tables/index are probably out of date. Update them
> using UPDATE STATISTICS command. See if that helps. Or provide an index
> hints to the query to specify which index you want it to use. Like:
> Select count (t1.stuff)
> Inner join t2
> On
> t1.date_key = t2.date_key
> Inner join t3
> on
> t2.date_number between t3.start_date and t3.end_date
> WITH (INDEX(index_name))
>|||Just a guess, but I don't think the optimizer knows what is in table T3, so
it cannot make a decision based on those dates. As a result, it is unable
to use the index on the dates, since they are unknown. Again, this is just
a guess and could be totally off.
Also, I don't think the statistics on table T3 reflect the current data, but
rather the (completely unrelated) data that was present when the statistics
were generated. I am assuming that statistics on this table are either non
existent, or were generated when the table had no data in it. Try inserting
a row into the table and generating statistics on it, then removing that
row, and running your process again. It is possible that having statistics
with a single valid row in this table will cause the optimizer to choose the
correct path.
Just a couple of ideas.
"Eric" <Eric@.discussions.microsoft.com> wrote in message
news:C7CA8FC0-BD0A-4779-870E-9658E4C72084@.microsoft.com...
> Hi all, I have been running into this same issue for some time now and
can't
> come up with a valid reason why SQL is doing what s is doing...
> In a nut shell I have three tables
> t1 is a fact table
> t2 is a time dimension table
> t3 is a parameter table that get loaded prior to the query being executed.
> Simple code
> Select count (t1.stuff)
> From t1
> Inner join t2
> On
> t1.date_key = t2.date_key
> Inner join t3
> on
> t2.date_number between t3.start_date and t3.end_date
> The optimizer performs a full table scan on the fact then applies the date
> range filter... Though if I were to replace the start_date and end_date
> values with hardcode values then the optimizer uses the index and pulls
only
> those records needed from the fact.
> Really weird...
> Any thoughts?
> Thanks
> Eric
>|||Hi Jim,
I confirmed that the stats on t3 were up to date and truncated the table,
reloaded in it and once again updated the stats. Unfortunately the plan
result was the same.
I assume the optimizer know what is in a table based on the table stats
now taking what you had mentioned into count I think you may be on to
something... but the wrench is why is it if I use a SARG value or create an
additional year column in t3 and make the year column in t2 equal to year i
n
t3 the index get used.
Select count (t1.stuff)
From t1
Inner join t2
On
t1.date_key = t2.date_key
Inner join t3
on
t2.date_number between t3.start_date and t3.end_date and
t2.year_number = t3.year_number
Thanks|||Eric,
It's impossible for the optimizer to do anything but make generic rowcount
estimates for predicates that involve comparing columns from one table
with columns from another. Here, for example, the actual limiting values
of t2.date_number are unknown until run-time, so the histogram of
t2.date_number values is basically useless for plan costing.
By adding an extra superfluous condition to your join's ON clause,
you are reducing the generic rowcount estimate used by the optimizer.
With nothing else to go on, the optimizer will assume that fewer rows
match (<this condition> AND <that condition> ) than match (<this condition> ).
Assuming that fewer rows from t2 match the condition, the estimated cost
of using the index drops, while the cost of a table scan does not drop, and
the change is enough to make the plan that uses an index appear cheapter.
Steve Kass
Drew University
Eric wrote:

>Hi Jim,
>I confirmed that the stats on t3 were up to date and truncated the table,
>reloaded in it and once again updated the stats. Unfortunately the plan
>result was the same.
>I assume the optimizer know what is in a table based on the table stats
>now taking what you had mentioned into count I think you may be on to
>something... but the wrench is why is it if I use a SARG value or create an
>additional year column in t3 and make the year column in t2 equal to year
in
>t3 the index get used.
>Select count (t1.stuff)
>From t1
>Inner join t2
>On
>t1.date_key = t2.date_key
>Inner join t3
>on
>t2.date_number between t3.start_date and t3.end_date and
>t2.year_number = t3.year_number
>Thanks
>
>|||I would expect that equality is handled very different then between for
optimizational purposes. This makes perfect sense since a single value is
more exlicit and easier to determine ahead of time than a range of values.
However, you did not state whether or not this year_number column is indexed
or not. If there is an index on this field , then I would expect it to make
a difference simply because it is easier for the optimizer to know that it
is targeting a certain percentage of rows with the join. If there is no
index, then Steve Kass's explanation seems the only way to explain it.
Regardless, I find that the behavior of the optimizer never ceases to amaze
me.
"Eric" <Eric@.discussions.microsoft.com> wrote in message
news:2DC2E151-6AB0-472B-B385-3B9918F34F73@.microsoft.com...
> Hi Jim,
> I confirmed that the stats on t3 were up to date and truncated the table,
> reloaded in it and once again updated the stats. Unfortunately the plan
> result was the same.
> I assume the optimizer know what is in a table based on the table stats
> now taking what you had mentioned into count I think you may be on to
> something... but the wrench is why is it if I use a SARG value or create
an
> additional year column in t3 and make the year column in t2 equal to year
in
> t3 the index get used.
> Select count (t1.stuff)
> From t1
> Inner join t2
> On
> t1.date_key = t2.date_key
> Inner join t3
> on
> t2.date_number between t3.start_date and t3.end_date and
> t2.year_number = t3.year_number
> Thanks
>|||Try running the SQL through the SQL Optimizer for Visual Studio. It will
rewrite your statement in every possible fashion to get you the best
performing SQL. It has a free 30 day trial. You can find it at
http://www.extensibles.com/modules...=Products&op=NS
examnotes <Eric@.discussions.microsoft.com> wrote in
news:C7CA8FC0-BD0A-4779-870E-9658E4C72084@.microsoft.com:

>
The Relentless One
Debugging is a state of mind
http://www.extensibles.com/

Plan Maintenance will not execute

My plan Maintenance to Optimize, TRN Backup and Reporting
has been running for several months. A few days ago, I
started getting the following in "View Job History":
"Executed as user: domain\Administrator. sqlmaint.exe
failed. [SQLSTATE 42000] (Error 22029). The step failed."
There is no log file created, even though I requested one,
which leads me to believe the Job never actually started.
The Windows 2000 Applications Log has the following:
"SQL Server Scheduled Job 'Optimizations Job for DB
Maintenance Plan 'Test 1''
(0x529723559D047845AB998AFF9BDA397F) - Status: Failed -
Invoked on: 2004-07-14 22:30:00 - Message: The job
failed. The Job was invoked by Schedule 42 (Schedule 1).
The last step to run was step 1 (Step 1)."
When I try and run the command in Query Analyzer, I get
the following:
"Server: Msg 22029, Level 16, State 1, Line 0
sqlmaint.exe failed."
The recovery model is "Bulk-Logged"
Does anyone have any Idea what has gone wrong in this
maintenance Plan?Hi,
By any chance did you changed the recovery model for a database to SIMPLE
and then turned back to BULK_LOGGED. In this
case you have to do a FULL database backup for that database.
command:
--
BACKUP database <dbname> to disk='d:\backup\dbname.bak' with init
Thanks
Hari
MCDBA
"Ken Bitner" <anonymous@.discussions.microsoft.com> wrote in message
news:2d53601c46a17$38dd0f20$a501280a@.phx
.gbl...
> My plan Maintenance to Optimize, TRN Backup and Reporting
> has been running for several months. A few days ago, I
> started getting the following in "View Job History":
> "Executed as user: domain\Administrator. sqlmaint.exe
> failed. [SQLSTATE 42000] (Error 22029). The step failed."
> There is no log file created, even though I requested one,
> which leads me to believe the Job never actually started.
> The Windows 2000 Applications Log has the following:
> "SQL Server Scheduled Job 'Optimizations Job for DB
> Maintenance Plan 'Test 1''
> (0x529723559D047845AB998AFF9BDA397F) - Status: Failed -
> Invoked on: 2004-07-14 22:30:00 - Message: The job
> failed. The Job was invoked by Schedule 42 (Schedule 1).
> The last step to run was step 1 (Step 1)."
> When I try and run the command in Query Analyzer, I get
> the following:
> "Server: Msg 22029, Level 16, State 1, Line 0
> sqlmaint.exe failed."
> The recovery model is "Bulk-Logged"
> Does anyone have any Idea what has gone wrong in this
> maintenance Plan?
>
>|||No. The Recovery Model has always been "Bulk-Logged".
Also, I have take a full backup every day via the same
command you sent me.

>--Original Message--
>Hi,
>By any chance did you changed the recovery model for a
database to SIMPLE
>and then turned back to BULK_LOGGED. In this
>case you have to do a FULL database backup for that
database.
>command:
>--
>BACKUP database <dbname> to disk='d:\backup\dbname.bak'
with init
>
>--
>Thanks
>Hari
>MCDBA
>
>"Ken Bitner" <anonymous@.discussions.microsoft.com> wrote
in message
> news:2d53601c46a17$38dd0f20$a501280a@.phx
.gbl...
Reporting[vbcol=seagreen]
failed."[vbcol=seagreen]
one,[vbcol=seagreen]
started.[vbcol=seagreen]
1).[vbcol=seagreen]
>
>.
>

Plan Maintenance will not execute

My plan Maintenance to Optimize, TRN Backup and Reporting
has been running for several months. A few days ago, I
started getting the following in "View Job History":
"Executed as user: domain\Administrator. sqlmaint.exe
failed. [SQLSTATE 42000] (Error 22029). The step failed."
There is no log file created, even though I requested one,
which leads me to believe the Job never actually started.
The Windows 2000 Applications Log has the following:
"SQL Server Scheduled Job 'Optimizations Job for DB
Maintenance Plan 'Test 1''
(0x529723559D047845AB998AFF9BDA397F) - Status: Failed -
Invoked on: 2004-07-14 22:30:00 - Message: The job
failed. The Job was invoked by Schedule 42 (Schedule 1).
The last step to run was step 1 (Step 1)."
When I try and run the command in Query Analyzer, I get
the following:
"Server: Msg 22029, Level 16, State 1, Line 0
sqlmaint.exe failed."
The recovery model is "Bulk-Logged"
Does anyone have any Idea what has gone wrong in this
maintenance Plan?
Hi,
By any chance did you changed the recovery model for a database to SIMPLE
and then turned back to BULK_LOGGED. In this
case you have to do a FULL database backup for that database.
command:
BACKUP database <dbname> to disk='d:\backup\dbname.bak' with init
Thanks
Hari
MCDBA
"Ken Bitner" <anonymous@.discussions.microsoft.com> wrote in message
news:2d53601c46a17$38dd0f20$a501280a@.phx.gbl...
> My plan Maintenance to Optimize, TRN Backup and Reporting
> has been running for several months. A few days ago, I
> started getting the following in "View Job History":
> "Executed as user: domain\Administrator. sqlmaint.exe
> failed. [SQLSTATE 42000] (Error 22029). The step failed."
> There is no log file created, even though I requested one,
> which leads me to believe the Job never actually started.
> The Windows 2000 Applications Log has the following:
> "SQL Server Scheduled Job 'Optimizations Job for DB
> Maintenance Plan 'Test 1''
> (0x529723559D047845AB998AFF9BDA397F) - Status: Failed -
> Invoked on: 2004-07-14 22:30:00 - Message: The job
> failed. The Job was invoked by Schedule 42 (Schedule 1).
> The last step to run was step 1 (Step 1)."
> When I try and run the command in Query Analyzer, I get
> the following:
> "Server: Msg 22029, Level 16, State 1, Line 0
> sqlmaint.exe failed."
> The recovery model is "Bulk-Logged"
> Does anyone have any Idea what has gone wrong in this
> maintenance Plan?
>
>
|||No. The Recovery Model has always been "Bulk-Logged".
Also, I have take a full backup every day via the same
command you sent me.

>--Original Message--
>Hi,
>By any chance did you changed the recovery model for a
database to SIMPLE
>and then turned back to BULK_LOGGED. In this
>case you have to do a FULL database backup for that
database.
>command:
>--
>BACKUP database <dbname> to disk='d:\backup\dbname.bak'
with init
>
>--
>Thanks
>Hari
>MCDBA
>
>"Ken Bitner" <anonymous@.discussions.microsoft.com> wrote
in message[vbcol=seagreen]
>news:2d53601c46a17$38dd0f20$a501280a@.phx.gbl...
Reporting[vbcol=seagreen]
failed."[vbcol=seagreen]
one,[vbcol=seagreen]
started.[vbcol=seagreen]
1).
>
>.
>

Plan Maintenance will not execute

My plan Maintenance to Optimize, TRN Backup and Reporting
has been running for several months. A few days ago, I
started getting the following in "View Job History":
"Executed as user: domain\Administrator. sqlmaint.exe
failed. [SQLSTATE 42000] (Error 22029). The step failed."
There is no log file created, even though I requested one,
which leads me to believe the Job never actually started.
The Windows 2000 Applications Log has the following:
"SQL Server Scheduled Job 'Optimizations Job for DB
Maintenance Plan 'Test 1''
(0x529723559D047845AB998AFF9BDA397F) - Status: Failed -
Invoked on: 2004-07-14 22:30:00 - Message: The job
failed. The Job was invoked by Schedule 42 (Schedule 1).
The last step to run was step 1 (Step 1)."
When I try and run the command in Query Analyzer, I get
the following:
"Server: Msg 22029, Level 16, State 1, Line 0
sqlmaint.exe failed."
The recovery model is "Bulk-Logged"
Does anyone have any Idea what has gone wrong in this
maintenance Plan?Hi,
By any chance did you changed the recovery model for a database to SIMPLE
and then turned back to BULK_LOGGED. In this
case you have to do a FULL database backup for that database.
command:
--
BACKUP database <dbname> to disk='d:\backup\dbname.bak' with init
Thanks
Hari
MCDBA
"Ken Bitner" <anonymous@.discussions.microsoft.com> wrote in message
news:2d53601c46a17$38dd0f20$a501280a@.phx.gbl...
> My plan Maintenance to Optimize, TRN Backup and Reporting
> has been running for several months. A few days ago, I
> started getting the following in "View Job History":
> "Executed as user: domain\Administrator. sqlmaint.exe
> failed. [SQLSTATE 42000] (Error 22029). The step failed."
> There is no log file created, even though I requested one,
> which leads me to believe the Job never actually started.
> The Windows 2000 Applications Log has the following:
> "SQL Server Scheduled Job 'Optimizations Job for DB
> Maintenance Plan 'Test 1''
> (0x529723559D047845AB998AFF9BDA397F) - Status: Failed -
> Invoked on: 2004-07-14 22:30:00 - Message: The job
> failed. The Job was invoked by Schedule 42 (Schedule 1).
> The last step to run was step 1 (Step 1)."
> When I try and run the command in Query Analyzer, I get
> the following:
> "Server: Msg 22029, Level 16, State 1, Line 0
> sqlmaint.exe failed."
> The recovery model is "Bulk-Logged"
> Does anyone have any Idea what has gone wrong in this
> maintenance Plan?
>
>|||No. The Recovery Model has always been "Bulk-Logged".
Also, I have take a full backup every day via the same
command you sent me.
>--Original Message--
>Hi,
>By any chance did you changed the recovery model for a
database to SIMPLE
>and then turned back to BULK_LOGGED. In this
>case you have to do a FULL database backup for that
database.
>command:
>--
>BACKUP database <dbname> to disk='d:\backup\dbname.bak'
with init
>
>--
>Thanks
>Hari
>MCDBA
>
>"Ken Bitner" <anonymous@.discussions.microsoft.com> wrote
in message
>news:2d53601c46a17$38dd0f20$a501280a@.phx.gbl...
>> My plan Maintenance to Optimize, TRN Backup and
Reporting
>> has been running for several months. A few days ago, I
>> started getting the following in "View Job History":
>> "Executed as user: domain\Administrator. sqlmaint.exe
>> failed. [SQLSTATE 42000] (Error 22029). The step
failed."
>> There is no log file created, even though I requested
one,
>> which leads me to believe the Job never actually
started.
>> The Windows 2000 Applications Log has the following:
>> "SQL Server Scheduled Job 'Optimizations Job for DB
>> Maintenance Plan 'Test 1''
>> (0x529723559D047845AB998AFF9BDA397F) - Status: Failed -
>> Invoked on: 2004-07-14 22:30:00 - Message: The job
>> failed. The Job was invoked by Schedule 42 (Schedule
1).
>> The last step to run was step 1 (Step 1)."
>> When I try and run the command in Query Analyzer, I get
>> the following:
>> "Server: Msg 22029, Level 16, State 1, Line 0
>> sqlmaint.exe failed."
>> The recovery model is "Bulk-Logged"
>> Does anyone have any Idea what has gone wrong in this
>> maintenance Plan?
>>
>
>.
>

Plan Guide

Is it possible to do something like this with a query plan?
I want to get
Query1
select * from tableA
where col1 like '%value%'
to run like
Query2
select * from tableA
where contains(col1, "value")
using a plan_guide.
Basically what's happening is a 3rd party product is executing a query that
looks like query1, which is searching on a text field (col1).
I wanted to try a full text index, but I don't think that I can get the
vendor to change their code to use a contains instead.
Any ideas?
Tia
--
MGEgads, why isn't the vendor using stored procedures?
"Hurme" <michael.geles@.thomson.com> wrote in message
news:FD780483-2D13-4284-8911-EF08FA332560@.microsoft.com...
> Is it possible to do something like this with a query plan?
> I want to get
> Query1
> select * from tableA
> where col1 like '%value%'
> to run like
> Query2
> select * from tableA
> where contains(col1, "value")
> using a plan_guide.
> Basically what's happening is a 3rd party product is executing a query
> that
> looks like query1, which is searching on a text field (col1).
> I wanted to try a full text index, but I don't think that I can get the
> vendor to change their code to use a contains instead.
> Any ideas?
> Tia
> --
> MG|||"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eXbLZijfIHA.5560@.TK2MSFTNGP04.phx.gbl...
> Egads, why isn't the vendor using stored procedures?
LOL with SQL statements hardwired into the client-side code the customer
can't go in and make changes like this to the code

Plan Guide

Is it possible to do something like this with a query plan?
I want to get
Query1
select * from tableA
where col1 like '%value%'
to run like
Query2
select * from tableA
where contains(col1, "value")
using a plan_guide.
Basically what's happening is a 3rd party product is executing a query that
looks like query1, which is searching on a text field (col1).
I wanted to try a full text index, but I don't think that I can get the
vendor to change their code to use a contains instead.
Any ideas?
Tia
MG
Egads, why isn't the vendor using stored procedures?
"Hurme" <michael.geles@.thomson.com> wrote in message
news:FD780483-2D13-4284-8911-EF08FA332560@.microsoft.com...
> Is it possible to do something like this with a query plan?
> I want to get
> Query1
> select * from tableA
> where col1 like '%value%'
> to run like
> Query2
> select * from tableA
> where contains(col1, "value")
> using a plan_guide.
> Basically what's happening is a 3rd party product is executing a query
> that
> looks like query1, which is searching on a text field (col1).
> I wanted to try a full text index, but I don't think that I can get the
> vendor to change their code to use a contains instead.
> Any ideas?
> Tia
> --
> MG
|||"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eXbLZijfIHA.5560@.TK2MSFTNGP04.phx.gbl...
> Egads, why isn't the vendor using stored procedures?
LOL with SQL statements hardwired into the client-side code the customer
can't go in and make changes like this to the code

plan for box upgrade

sql2k sp3
Im going to be moving sql from one box to a newer one
with better hardware today. This is my plan:
Restore a backup of Master and MSDB onto the new box.
Detach and attach the user db's.
Ive used detach and attach but never in this scenario.
Does anyone see a problem with this?
TIA, ChrisYour plan is perfect, only thing is that the restored
master database will still have entries for user
databases, even if they don't exist on new server yet. I
believe you can get rid of them by issuing drop database
command.
Then start attachig user databases, and then msdb.
hth.
>--Original Message--
>sql2k sp3
>Im going to be moving sql from one box to a newer one
>with better hardware today. This is my plan:
>Restore a backup of Master and MSDB onto the new box.
>Detach and attach the user db's.
>Ive used detach and attach but never in this scenario.
>Does anyone see a problem with this?
>TIA, Chris
>
>.
>|||My plan wasnt to detach and attach msdb at all. It was to
backup/ restore it. Will this still work?
>--Original Message--
>Your plan is perfect, only thing is that the restored
>master database will still have entries for user
>databases, even if they don't exist on new server yet. I
>believe you can get rid of them by issuing drop database
>command.
>Then start attachig user databases, and then msdb.
>
>hth.
>>--Original Message--
>>sql2k sp3
>>Im going to be moving sql from one box to a newer one
>>with better hardware today. This is my plan:
>>Restore a backup of Master and MSDB onto the new box.
>>Detach and attach the user db's.
>>Ive used detach and attach but never in this scenario.
>>Does anyone see a problem with this?
>>TIA, Chris
>>
>>.
>.
>|||you can backup/restore or attach/detach msdb database. or
just rename new mdf and ldf files for msdb on new server
(just for backup) and then copy original mdf/ldf files in
their place when the sql server is not running.
You can do same for master database as well, if you don't
want to use backup/restore.
hth.
>--Original Message--
>My plan wasnt to detach and attach msdb at all. It was to
>backup/ restore it. Will this still work?
>
>>--Original Message--
>>Your plan is perfect, only thing is that the restored
>>master database will still have entries for user
>>databases, even if they don't exist on new server yet. I
>>believe you can get rid of them by issuing drop database
>>command.
>>Then start attachig user databases, and then msdb.
>>
>>hth.
>>--Original Message--
>>sql2k sp3
>>Im going to be moving sql from one box to a newer one
>>with better hardware today. This is my plan:
>>Restore a backup of Master and MSDB onto the new box.
>>Detach and attach the user db's.
>>Ive used detach and attach but never in this scenario.
>>Does anyone see a problem with this?
>>TIA, Chris
>>
>>.
>>.
>.
>