Showing posts with label time. Show all posts
Showing posts with label time. Show all posts

Wednesday, March 28, 2012

Mirroring - totally stumped, need some help.

Alright, I've been at this for some time now and I am now officially completely stumped.Tongue Tied
This is the error that I have been consistantly getting and cannot seem to resolve:
The server network address "tcp://<servername>:5022" can not be reached or does not exist. Check the network address name and reissue the command.
(Obvioulsly '<servername>' is replaced with the real name)

I just dont get it. I've tried everything I can think of.
Incoming/Outgoing TCP connections enabled? YES
T1400 flag? YES
Tried using strictly t-sql to set up mirroring? YES
Made exceptions with firewall? YES
Tried Telnet on port 5022? YES
Tried manually configuring certificates? YES
... you name it, I've probably tried it. I just cant seem to get past this and would REALLY appreciate any help any of you can provide.
BTW: this is on vers. 9.00.1399.00 (Developer...both machines).
Sorry if I am vauge on any of the details, just ask and I can provide any info you need.

Fire up profiler and turn on the Broker:Connection (no, not a typo) category of events on both machines.

|||Alright, tried that (thanks MichaelBig Smile) ... but still nothing. Here is what I'm doing:
1-Open Profiler, create new traces for the principal and mirror machine and run them (Broker:Connection).
2-Go into SQL Server Management Studio and attempt to start mirroring.
This results in the same error as before and nothing is being picked up in the trace, am I not doing something right?|||Alright, I'm pretty sure this is some sort of problem with logins...
In the error log I'm getting this:
2005-12-06 11:51:33.81 Logon Error: 18456, Severity: 14, State: 8.
2005-12-06 11:51:33.81 Logon Login failed for user 'sa'. [CLIENT: xxx.xxx.x.xxx]
This might make some sense if I was using SQL Server Authentication...but I'm not, I'm using Windows Authentication...so why would it even try to use 'sa'?
|||You mention:

(Obvioulsly '<servername>' is replaced with the real name)

Just want to make sure you have used the fully qualified name, i.e., server name and the domain name.|||You mention:
Tried using strictly t-sql to set up mirroring? YES

Can you list the exact steps you followed, including the T-SQL statements you executed and the result / error you got on each one.

Monday, March 26, 2012

minute count query

I need a query that gives me the sum of every rows (time column) with lower 'rownr'

the result:
rownr time timesum
1 10 0
2 10 10
3 10 20
4 10 30
5 10 40
6 10 50
7 10 60
8 10 70

current table looks like this:
rownr time
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10

and i want the 'timesum' column to be in format hhhh:mm
current format is rownr=int, time=datetime

thx for all help

//MrDo you have the URL or a PDF for this assignment?

-PatP|||:( no im making a database to store my divelogs in and this is the accumulated time im trying to calculate...|||I have no idea if this is what you are looking for. Nevertheless, to try and guess what the solution to your problem might be I went ahead and created a test database called MiscTests.

Now, I created a table similar to yours but instead of having the time column as datetime I've changed it to an INT. Here's the table code:

USE [MiscTests]
GO
/****** Object: Table [dbo].[Times] Script Date: 08/22/2007 17:50:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Times](
[rownr] [int] IDENTITY(1,1) NOT NULL,
[time] [int] NOT NULL CONSTRAINT [DF_Times_time] DEFAULT ((0)),
CONSTRAINT [PK_Times] PRIMARY KEY CLUSTERED
(
[rownr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

With this table in place I've made a small scalar-valued function to parse the time column. The code of the SVF is as follows:

USE [MiscTests]
GO
/****** Object: UserDefinedFunction [dbo].[parseTime] Script Date: 08/22/2007 17:53:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[parseTime]
(
@.Time AS Int
)
RETURNS VarChar(10)
AS
BEGIN
DECLARE @.hours AS Int
, @.parsedTime AS VarChar(10);

SET @.hours = 0;

WHILE (@.Time >= 60)
BEGIN
SET @.hours = (@.hours + 1);

SET @.Time = (@.Time - 60);
END

IF (@.hours = 0)
BEGIN
SET @.parsedTime = '0';
END
ELSE
BEGIN
SET @.parsedTime = CAST(@.hours AS VarChar(7));
END

SET @.parsedTime = @.parsedTime + ':';

IF (@.Time < 10)
BEGIN
SET @.parsedTime = @.parsedTime + '0'
END

SET @.parsedTime = @.parsedTime + CAST(@.Time AS VarChar(2));

return @.parsedTime;
END
GO

With this done I went ahead and filled the dbo.Times table with a couple of datarows. After that I ran a simple query to return the desired output. Here's the query SQL

SELECT
t.rownr AS rownr
, t.time AS [time]
, dbo.parseTime((
SELECT
sum(st.time)
FROM
dbo.Times st
WHERE
st.rownr <= t.rownr
)) as timesum
FROM
dbo.Times t
ORDER BY
t.rownr ASC;

The resultset should be something like this:
1 0 0:00
2 10 0:10
3 10 0:20
4 10 0:30
5 10 0:40
6 10 0:50
7 10 1:00
8 10 1:10
9 10 1:20
10 10 1:30
11 10 1:40
12 10 1:50
13 10 2:00
14 10 2:10
15 10 2:20

Hope this helps ;)|||declare @.sample table (rownr int, time int)

insert @.sample
select 1, 10 union all
select 2, 10 union all
select 3, 10 union all
select 4, 10 union all
select 5, 10 union all
select 6, 10 union all
select 7, 10 union all
select 8, 10

select s1.rownr,
s1.time,
convert(varchar(5), dateadd(minute, sum(coalesce(s2.time, 0)), 0), 108) as timesum
from @.sample as s1
left join @.sample as s2 on s2.rownr < s1.rownr
group by s1.rownr,
s1.time|||Peso, your solution is insufficiently complex. How do you ever expect to make a living at this with such concise solutions?
Obfuscate! Obfuscate! Obfuscate!|||thanks alot for all the effort you guys put into this, but i can't solve this. Its my experience that fails here... i really tryed Diabolic's solutions which im sure works but again, i can't apply that solutiuons at my database...

is it possible to make a query that gives me the result i want? or do i need a temp table or similar to accomplish my goal?

//Mr|||It appears that outer theta joins are too elementary for blindman now... :rolleyes:

Not to mention the use of temporal functions which, according to Pat are rather risky, but he's under NDA so can't tell us why...|||MRPCGuy, Peso's method is the standard solution to this common problem, and should work fine.|||declare @.sample table (rownr int, time int)

insert @.sample
select 1, 10 union all
select 2, 10 union all
select 3, 10 union all
select 4, 500 union all
select 5, 10 union all
select 6, 10 union all
select 7, 4000000 union all
select 8, 10

select s1.rownr,
s1.time,
convert(varchar, sum(coalesce(s2.time, 0)) / 60) + ':' + RIGHT('00' + cast(sum(coalesce(s2.time, 0)) % 60 as varchar(2)), 2)
from @.sample as s1
left join @.sample as s2 on s2.rownr < s1.rownr
group by s1.rownr,
s1.time
order by s1.rownr,
s1.time|||would somebody -- and i volunteer mrpcguy for this -- please post the DDL to create a table using rownr=int, time=datetime as specified in post #1

it's fine and dandy to set up test cases using ints, but mrpcguy says he's using datetimes|||im learning, im leraning, alright? Thx Peso for your help...|||don't get this... if i have 100000 rows i want to count accumulated time for each row, how can i achive that?|||don't get this... if i have 100000 rows i want to count accumulated time for each row, how can i achive that?with a query, similar to the ones you've seen in this thread

any chance you could give us some real data, not fake data? i.e. data with datetimes, not integers|||thing is that i dont have any real data yet, im building this database and gona fill it with divelogs later on. But this function to be able to count accumulated time is important. i only have fake data.
My idea was to have datetime at that columt because logg gonna look like "00:30" for 30min. Maybe its better to use int and put in "30" for 30min...
How can i achive what i wont with my first post and use int instead of datetime?|||For int you just have to log the number of mins (int), but that will turn innacurate soon enough. Since you're storing the number of minutes in integer you will soon realise that if your dive was 2.5mins you'll have to round it.

To store the time as an int it's prolly better to store the number of seconds.|||your correct about that, but since i always round it up to whole minutes i don't need seconds...|||you should be able to use the solutions presented here, namely peso's one, if you're going to use int.|||Ok,
I got this:
current table looks like this:
rownr time
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10

and I want this:
rownr time timesum
1 10 0
2 10 10
3 10 20
4 10 30
5 10 40
6 10 50
7 10 60
8 10 70

I run this:
declare @.sample table (rownr int, time int)
insert @.sample
select 1, 10 union all
select 2, 10 union all
select 3, 10 union all
select 4, 10 union all
select 5, 10 union all
select 6, 10 union all
select 7, 10 union all
select 8, 10
select s1.rownr,s1.time,convert(varchar, sum(coalesce(s2.time, 0)) / 60) + ':' + RIGHT('00' + cast(sum(coalesce(s2.time, 0)) % 60 as varchar(2)), 2)
from @.sample as s1
left join @.sample as s2 on s2.rownr < s1.rownr
group by s1.rownr,s1.time
order by s1.rownr,s1.time

What if I got a table with 10000 rows… that’s many select statements

I’m very aware that it’s my skills is the biggest problem here, so plz help…|||no, it's still only one SELECT statement, no matter how many rows|||well in my test table i have 50 rows and the output from above gives me 8 rows?!|||maybe not correct forum but anyway... is this doable in ms access? thinking of put this db in access instead? (don't want to run sql local)|||is this doable in ms access? certainly is|||maybe not correct forum but anyway... is this doable in ms access? thinking of put this db in access instead? (don't want to run sql local)

of for the love of....|||...pancakes?|||well in my test table i have 50 rows and the output from above gives me 8 rows?!

You are getting 8 rows because you are using the wrong query. If I didn't missunderstand your post, you are using the following SQL to retrieve the desired results:

declare @.sample table (rownr int, time int)
insert @.sample
select 1, 10 union all
select 2, 10 union all
select 3, 10 union all
select 4, 10 union all
select 5, 10 union all
select 6, 10 union all
select 7, 10 union all
select 8, 10
select s1.rownr,s1.time,convert(varchar, sum(coalesce(s2.time, 0)) / 60) + ':' + RIGHT('00' + cast(sum(coalesce(s2.time, 0)) % 60 as varchar(2)), 2)
from @.sample as s1
left join @.sample as s2 on s2.rownr < s1.rownr
group by s1.rownr,s1.time
order by s1.rownr,s1.time

Well, it's only natural that you are only getting 8 rows. If you look closely you'll see that you are selecting the results from the temporary table called @.sample. To retrieve your real data you should use this sql statement:

select s1.rownr,s1.time,convert(varchar, sum(coalesce(s2.time, 0)) / 60) + ':' + RIGHT('00' + cast(sum(coalesce(s2.time, 0)) % 60 as varchar(2)), 2)
from <MyTableName> as s1
left join <MyTableName> as s2 on s2.rownr < s1.rownr
group by s1.rownr,s1.time
order by s1.rownr,s1.time

Please, remember to replace <MyTableName> with the actual name of your dive logs table.|||Please, remember to replace <MyTableName> with the actual name of your dive logs table.and you will also have to change this nonsense --convert(varchar, sum(coalesce(s2.time, 0)) / 60)
+ ':' + RIGHT('00' + cast(sum(coalesce(s2.time, 0)) % 60 as varchar(2)), 2)into the equivalent ms access nonsense

:)|||thx alot it works fine... I'l take your query to another forum and get it translated into access when im have gone nuts trying to translate it myself...|||Good Lord.

It's only 12:08 PM and I am now exhausted.

and the thread is only two pages :)|||and the sarcasm and humiliation at this forum is extraordinary... so what's ur problem beside being exhausted?|||and the sarcasm and humiliation at this forum is extraordinary... so what's ur problem beside being exhausted?My problems are numerous and well documented, but are primarily out of scope in the current discussion. One of those I would consider IN scope, however, is my inability to grasp the usefulness of the term "ur" within the realm of an otherwise reasonably well-crafted sentence.

Sarcasm? Guilty as charged.
Humiliation? Nah, I've seen not one virtual wedgie applied here.

Lighten up. If you think this forum is bad, it's the first one you've been to.|||... my inability to grasp the usefulness of the term "ur" within the realm of an otherwise reasonably well-crafted sentence.then you will just have to make another visit to http://icanhascheezburger.com/

it will make sense eventually

:)|||and the sarcasm and humiliation at this forum is extraordinary...
LOL.. Thats why I keep coming back!|||http://icanhascheezburger.com/

lol @. that site :beer:|||then you will just have to make another visit to http://icanhascheezburger.com/

it will make sense eventually

:)
I must admit, I only looked at the first couple pages then got busy with *coff* work *coff* and forwarded the link to myself at home. I will catch up with the rest of the class over the weekend.

Minor Table Insert help

i have the following code, it all works how i want it to bar the first time it runs, when i run the program and insert the data the first time, it inserts the data twice, all other times only once or the update.

$dbh=mysql_connect ("localhost", "twqwwsoy_user", "iiyama") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("twqwwsoy_resources");

$count="SELECT COUNT(message) FROM Diary";
$result = mysql_query($count);
$co = mysql_result($result,$x);

if ($co == 0) {
$SQL= "INSERT INTO Diary (username, day_id, message) VALUES('$username', '$day', '$message')";
$result = @.mysql_query ($SQL) or die('query error ' . mysql_error());
}
else {

$count="SELECT COUNT(username) FROM Diary WHERE username = '$username' AND day_id = '$day'";
$result = mysql_query($count);
$co1 = mysql_result($result,$x);
echo "$co1";
}

if ($co1 == 1) {
$SQL= "UPDATE Diary SET message = '$message' WHERE username = '$username' AND day_id= '$day'";
$result = @.mysql_query ($SQL) or die('query error ' . mysql_error());
}
else {
$SQL= "INSERT INTO Diary (username, day_id, message) VALUES('$username', '$day', '$message')";
$result = @.mysql_query ($SQL) or die('query error ' . mysql_error());
}I don't speak MySQL, but it seems like this: when the table 'diary' is empty, you are running the script for the first time:co = 0 and co1 = 0

IF co = 0 (yes, it is) THEN
INSERT INTO diary ... -> this is executed
ELSE
SELECT COUNT ... -> this is not executed
END IF

IF co1 = 1 (no, it isn't) THEN
UPDATE diary ... -> this is not executed
ELSE
INSERT INTO diary ... -> this statement performs second insertRunning the script second (and every other) time:IF co = 0 (no, it isn't) THEN
INSERT INTO diary ...
ELSE
SELECT COUNT ... -> it is executed and co1 = 2
END IF

IF co1 = 1 (no, it isn't) THEN
UPDATE diary ... -> this is not executed
ELSE
INSERT INTO diary ... -> this is executed
END IFIf I'm not wrong, this is what happens. But, you didn't say what you wanted to happen ... Anyway, I guess you'll have to adjust logic a little bit.

Mining Structures

I am using the wizard to create a new mining structure and getting the error at the time of selecting the datamining technique like either microsoft decision tree or microsoft timeseries etc.,

"Unable to retrieve a list of supported data mining algorithms. Make sure you are connected to the correct Analysis Services server instance and the Analysis Services server named localhost is running and configured properly. You can continue with a default list of data mining algorithms."

What is that means?

Thanks in advance,

Got it. I need to start the AS from Control Panel/Administrative tools etc etc., before doning this.

I think the default is Manual to start the service.

|||Right-click on the Analysis Service project and select Properties - under Configuration Properties->Deployment, check what you have under Target->Server. The value of the Server property should be the name of the Analysis Services instance that you want the project to connect/deploy to. When you try to select a data mining technique, we try to connect to the Target Server to fetch the list of supported techniques. If you have "localhost" in this property, check Control Panel->Administrative Services->Services to confirm that the "SQL Server Analysis Services" service is running. If you specified a named instance (servername\instancename), check that the corresponding instance (SQL Server Analysis Services (instancename)" as well as the "SQL Server Browser" service is running.sql

Friday, March 23, 2012

mining model with time

i want create a model to predict what product i should Ads for customer at time.

example: in summer, i should show the , drinks (coca, pepsi) , ice food, bikini, sandals, glasses. in winter, i should show shoes, coats, hot food....

i have some table:

order(orderid, time,cusid...)

product(productid,..)

orderdetails(orderid, productid..)

customers(cuisid,....)

You can add the season as an input for the model, along with whatever other inputs you are interested in.

Wednesday, March 21, 2012

minimum and maximum in a time range (was "SQL query")

Hi all,
If I have the table:

Date/Time X
2/12/2004 07:23:00 100
2/12/2004 07:30:00 200
2/12/2004 09:30:00 500
2/12/2004 14:45:00 600
2/12/2004 15:02:00 100

I want to get X where it's time interval between the minimum time and the maximum time in the period 06:00:00 to 15:15:00
My target to get the minimum X and the maximum X between 06:00:00 and 15:15:00 and substarct them.

Please help
Thanksselect max(x)-min(x)
from some_table
where datetime between timestamp '2004-12-02 06:00:00' and timestamp '2004-12-02 15:15:00';

Of course, specification of dates and times varies from DBMS to DBMS, so the syntax may vary there.

minimize width

hi there,I have in my report header
text1
text2
text3
one of this text can be blank at run time I need to minimize the width of the section to the width of the textboxes thet are not blank (like supress when empty of the section) can anyone tell me how can I do it...Put a text box in the header, and then drag each field into the text box.|||But in this case the section will still have the same width,I need to minimize its width to the width of the non-empty text boxes..|||Sorry,my ques shoud be about the height and not the width of a section...Sorrysql

Monday, March 19, 2012

min/max of x minutes

I am trying to develop a sql statement that will create a recordset of the min (or max) values in x minute increments over a period of time.

e.g. over a period of 7 days, I have data that was collected in 1 minute intervals. I need to know the min (or max) value in each 10 minute interval over that same period of time.

Is there an efficient way of doing this?

Try something like this:

DECLARE @.dt_from DATETIME, @.dt_to DATETIME;
SET @.dt_from = '2006-03-21T00:00:00.000';
SET @.dt_to = '2006-03-28T00:00:00.000';

SELECT MIN(dt) AS dt,
MIN(val) AS min_val, MAX(val) AS max_val
FROM tbl
WHERE dt >= @.dt_from
AND dt < @.dt_to
GROUP BY FLOOR(DATEDIFF(MINUTE,@.dt_from,dt)/10) ;

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

|||Just recently had a chance to try this out. It worked perfectly. Thanks!

MIN and MAX strange results

I want to get the MIN and MAX value of a table column from a specified period of time. I execute a query and it return the result. The problem is that the values returned by MIN and MAX are not always correct!!

This is the result table

Date Statement From To

1 2007-01-03 00:00:00 Invoice 1 2 Correct
2 2007-01-04 00:00:00 Receipt 1 1 Correct
3 2007-01-04 00:00:00 Invoice 10 9 Wrong
4 2007-01-05 00:00:00 Receipt 2 5 Correct
5 2007-01-05 00:00:00 Invoice 100 99 Wrong
6 2007-01-08 00:00:00 Invoice 124 175 Correct
7 2007-01-09 00:00:00 Invoice 176 224 Correct
8 2007-01-10 00:00:00 Invoice 225 265 Correct

From =From Statement Number

To= To statement Number

The odd behavior happens when the number of digits changes. If the range of the column is 1 digit ie from 0 to 9 the values reported are ok. If the digits change then there is a problem as in line 3 and 5.

Any ideas why this odd behavior happens?

rectis:

I think you need to provide (1) the SQL Statement that is not working correctly and the definition of the table (or at least the relevant columns). My knee-jerk guess would be that you are coming to grief because your "From" and "To" fields are defined as varchar instead of numeric (or integer).

If in fact your "from" and "to" fields are defined as varchar you first need to make a determination to the usage of these fields -- that is see if the definition needs to be modified such that columns are reformatted into numeric (or integer) columns. You may need to compute your max as MIN(CONVERT(INTEGER, FROM)) and MAX(CONVERT(INTEGER,TO))

|||You are right. Thank you very much. I think my brain was stopped.The field was defined as varchar. Now the values are ok!

Monday, March 12, 2012

Military time

How do I format a DateTime to Military time?
--
Message posted via http://www.sqlmonster.com>How do I format a DateTime to Military time?
If you mean the "normal" 24-hour time format (that the whole world
except the US uses by default - *not* just the military!) :
string sTime = YourDateTime.ToString("HH:mm");
Marc
================================================================Marc Scheuner May The Source Be With You!
Berne, Switzerland m.scheuner -at- inova.ch

Monday, February 20, 2012

Migrating to SQL Server 2000 Standard to 2005 Express

I am working for a small company. We have an in-house web application that
was purely used by internal employees. At the time, it was cheaper to get a
per user license. Now we have application that is open to the public and so
we need to change the licensing mode to per processor mode. Right now, we
have a tight budget, so we are thinking about getting SQL Server 2005
Express. If performance is an issue, we may upgrade to other version later.
Looking at the http://msdn2.microsoft.com/en-us/library/ms143393.aspx, 2000
standard to 2005 express upgrade is not supported. Does that mean that if
I get a copy of backup of 2000 standard database and restore it to 2005
express, it will not work? If the upgrade works, will I able to use Upgrade
Advisor?
ThanksAFAIK, you *should* be able to restore your database to SQL Express.
I'd recommend doing a test migration onto a development server or
workstation and trying it out. You're going to want to migrate, instead
of upgrading, though...
JJ wrote:
> I am working for a small company. We have an in-house web application tha
t
> was purely used by internal employees. At the time, it was cheaper to get
a
> per user license. Now we have application that is open to the public and
so
> we need to change the licensing mode to per processor mode. Right now, we
> have a tight budget, so we are thinking about getting SQL Server 2005
> Express. If performance is an issue, we may upgrade to other version late
r.
> Looking at the http://msdn2.microsoft.com/en-us/library/ms143393.aspx, 200
0
> standard to 2005 express upgrade is not supported. Does that mean that i
f
> I get a copy of backup of 2000 standard database and restore it to 2005
> express, it will not work? If the upgrade works, will I able to use Upgra
de
> Advisor?
> Thanks
>
-Dave Markle
http://www.markleconsulting.com/blog|||The only thing I can think of that would prevent this is a database bigger
than 4GB. There might also be some performance differences because Express
won't use as many system resources as standard.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Dave Markle" <"dma[remove_ZZ]ZZrkle"@.gmail.dot.com> wrote in message
news:OX3yXomSHHA.4744@.TK2MSFTNGP02.phx.gbl...
> AFAIK, you *should* be able to restore your database to SQL Express. I'd
> recommend doing a test migration onto a development server or workstation
> and trying it out. You're going to want to migrate, instead of upgrading,
> though...
> JJ wrote:
>
> --
> -Dave Markle
> http://www.markleconsulting.com/blog

Migrating to SQL Server 2000 Standard to 2005 Express

I am working for a small company. We have an in-house web application that
was purely used by internal employees. At the time, it was cheaper to get a
per user license. Now we have application that is open to the public and so
we need to change the licensing mode to per processor mode. Right now, we
have a tight budget, so we are thinking about getting SQL Server 2005
Express. If performance is an issue, we may upgrade to other version later.
Looking at the http://msdn2.microsoft.com/en-us/library/ms143393.aspx, 2000
standard to 2005 express upgrade is not supported. Does that mean that if
I get a copy of backup of 2000 standard database and restore it to 2005
express, it will not work? If the upgrade works, will I able to use Upgrade
Advisor?
Thanks
AFAIK, you *should* be able to restore your database to SQL Express.
I'd recommend doing a test migration onto a development server or
workstation and trying it out. You're going to want to migrate, instead
of upgrading, though...
JJ wrote:
> I am working for a small company. We have an in-house web application that
> was purely used by internal employees. At the time, it was cheaper to get a
> per user license. Now we have application that is open to the public and so
> we need to change the licensing mode to per processor mode. Right now, we
> have a tight budget, so we are thinking about getting SQL Server 2005
> Express. If performance is an issue, we may upgrade to other version later.
> Looking at the http://msdn2.microsoft.com/en-us/library/ms143393.aspx, 2000
> standard to 2005 express upgrade is not supported. Does that mean that if
> I get a copy of backup of 2000 standard database and restore it to 2005
> express, it will not work? If the upgrade works, will I able to use Upgrade
> Advisor?
> Thanks
>
-Dave Markle
http://www.markleconsulting.com/blog
|||The only thing I can think of that would prevent this is a database bigger
than 4GB. There might also be some performance differences because Express
won't use as many system resources as standard.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Dave Markle" <"dma[remove_ZZ]ZZrkle"@.gmail.dot.com> wrote in message
news:OX3yXomSHHA.4744@.TK2MSFTNGP02.phx.gbl...
> AFAIK, you *should* be able to restore your database to SQL Express. I'd
> recommend doing a test migration onto a development server or workstation
> and trying it out. You're going to want to migrate, instead of upgrading,
> though...
> JJ wrote:
>
> --
> -Dave Markle
> http://www.markleconsulting.com/blog

Migrating to SQL Server 2000 Standard to 2005 Express

I am working for a small company. We have an in-house web application that
was purely used by internal employees. At the time, it was cheaper to get a
per user license. Now we have application that is open to the public and so
we need to change the licensing mode to per processor mode. Right now, we
have a tight budget, so we are thinking about getting SQL Server 2005
Express. If performance is an issue, we may upgrade to other version later.
Looking at the http://msdn2.microsoft.com/en-us/library/ms143393.aspx, 2000
standard to 2005 express upgrade is not supported. Does that mean that if
I get a copy of backup of 2000 standard database and restore it to 2005
express, it will not work? If the upgrade works, will I able to use Upgrade
Advisor?
ThanksAFAIK, you *should* be able to restore your database to SQL Express.
I'd recommend doing a test migration onto a development server or
workstation and trying it out. You're going to want to migrate, instead
of upgrading, though...
JJ wrote:
> I am working for a small company. We have an in-house web application that
> was purely used by internal employees. At the time, it was cheaper to get a
> per user license. Now we have application that is open to the public and so
> we need to change the licensing mode to per processor mode. Right now, we
> have a tight budget, so we are thinking about getting SQL Server 2005
> Express. If performance is an issue, we may upgrade to other version later.
> Looking at the http://msdn2.microsoft.com/en-us/library/ms143393.aspx, 2000
> standard to 2005 express upgrade is not supported. Does that mean that if
> I get a copy of backup of 2000 standard database and restore it to 2005
> express, it will not work? If the upgrade works, will I able to use Upgrade
> Advisor?
> Thanks
>
-Dave Markle
http://www.markleconsulting.com/blog|||The only thing I can think of that would prevent this is a database bigger
than 4GB. There might also be some performance differences because Express
won't use as many system resources as standard.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Dave Markle" <"dma[remove_ZZ]ZZrkle"@.gmail.dot.com> wrote in message
news:OX3yXomSHHA.4744@.TK2MSFTNGP02.phx.gbl...
> AFAIK, you *should* be able to restore your database to SQL Express. I'd
> recommend doing a test migration onto a development server or workstation
> and trying it out. You're going to want to migrate, instead of upgrading,
> though...
> JJ wrote:
>> I am working for a small company. We have an in-house web application
>> that was purely used by internal employees. At the time, it was cheaper
>> to get a per user license. Now we have application that is open to the
>> public and so we need to change the licensing mode to per processor mode.
>> Right now, we have a tight budget, so we are thinking about getting SQL
>> Server 2005 Express. If performance is an issue, we may upgrade to other
>> version later.
>> Looking at the http://msdn2.microsoft.com/en-us/library/ms143393.aspx,
>> 2000 standard to 2005 express upgrade is not supported. Does that mean
>> that if I get a copy of backup of 2000 standard database and restore it
>> to 2005 express, it will not work? If the upgrade works, will I able to
>> use Upgrade Advisor?
>> Thanks
>
> --
> -Dave Markle
> http://www.markleconsulting.com/blog

Migrating to 2005, need advice

Help. I have been tasked with upgrading a 2000 instance to 2005.

I have actually done this before, but it was a long time ago, and I
didn't do it alone. Now, the sitation is little different, and I need
to know the EXACT steps to take.

Does anyone have a FAQ or link that outlines migration steps? I found
one on sql server central, but it isn't very detailed.

One of the important things I need to know is, how do I create a
rollback plan if I am upgrading from 2000 to 2005 on the same server
(instance)?

Also, why can't I seem to find a comprehensive list of TO DO's when
upgrading? Doesn't microsoft provide this? You would think so. I will
run upgrade advisor first, but isn't there also documentation
somewhere?

I seem to recall lots of permissions issues that arose with 2005.

HELP

Thanks(tootsuite@.gmail.com) writes:

Quote:

Originally Posted by

Help. I have been tasked with upgrading a 2000 instance to 2005.
>
I have actually done this before, but it was a long time ago, and I
didn't do it alone. Now, the sitation is little different, and I need
to know the EXACT steps to take.
>
Does anyone have a FAQ or link that outlines migration steps? I found
one on sql server central, but it isn't very detailed.
>
One of the important things I need to know is, how do I create a
rollback plan if I am upgrading from 2000 to 2005 on the same server
(instance)?


It's certainly not a bad idea to install a second instance on the
same machine, and the migrate by BACKUP/RESTORE. This is great if
you run into performance issues and want ot compare query plans. The
drawback if you install a new instance is that a lot of clients will
be affected.

A second alternative is to install SQL 2005 on a new machine, and when
the install has completed, you change the names and IP-address of the
machines, so that the clients can't tell the difference. Of course,
this means that you need to shop for hardware.

This makes it sounds like an in-place upgrade should be avoided at
all cost, but it's not that bad. But I will have to admit that I
have never done one, nor do I plan to. If you have to go that path,
I recommend that you start with installing a second instance of SQL 2000,
and restore databases on this instance. Yes, I still think it is a
good idea to keep SQL 2000 for reference for a while.

In any case, you should first set up a test environment, so that you
can test doing in-place upgrades, and at least conduct some testing
of your applications.

Here is a short list of must-do:

1) Change the compatibility level of all databases to 90. If too many
things break, you may to move back to 90, but be optimistic.

2) Run sp_updatestats on all databases. Old statistics are voided by
the upgrade.

3) If you move databases from another server, you need to rematch
users with logins. (This applies even if you don't make upgrades.)
This includes setting the database owner, if the owner is not sa.

There a few things that can break. Here is a list of the most
probable cases:

* Old-style outer-join, *= and =*. Caught by the Upgrade Advisor,
and can be avoided with compat level 80.

* WITH is now required for hints with more than one work. Caught by the
Upgrade Advisor, and can be avoided with compat level 80.

* Views that uses SELECT TOP 100 PRECENT ORDER BY. In SQL 2000 a
SELECT without ORDER BY from this view seemed to get the order of
the ORDER BY in the view definition. This was mere chance, and it
does not happen that often on SQL 2005. This is *not* caught by
the Upgrade Advisor, as far as I know, and you cannot save the
day with compat level 80.

* Passwords are now always case-sensitive.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||On Feb 12, 5:52 am, tootsu...@.gmail.com wrote:

Quote:

Originally Posted by

Help. I have been tasked with upgrading a 2000 instance to 2005.
>
I have actually done this before, but it was a long time ago, and I
didn't do it alone. Now, the sitation is little different, and I need
to know the EXACT steps to take.
>
Does anyone have a FAQ or link that outlines migration steps? I found
one on sql server central, but it isn't very detailed.
>
One of the important things I need to know is, how do I create a
rollback plan if I am upgrading from 2000 to 2005 on the same server
(instance)?
>
Also, why can't I seem to find a comprehensive list of TO DO's when
upgrading? Doesn't microsoft provide this? You would think so. I will
run upgrade advisor first, but isn't there also documentation
somewhere?
>
I seem to recall lots of permissions issues that arose with 2005.
>
HELP
>
Thanks


The only reliable way to catch all issues is to script out your SQL
2000 databases and then rebuild them on a SQL 2005 database with
compatibility level 90. This method is much better than using the
Upgrade Advisor alone.

For tools that make this process easy please visit www.dbghost.com
Regards,

Malcolm|||Mork69 (mleach@.bigfoot.com) writes:

Quote:

Originally Posted by

The only reliable way to catch all issues is to script out your SQL
2000 databases and then rebuild them on a SQL 2005 database with
compatibility level 90. This method is much better than using the
Upgrade Advisor alone.


I agree that running the scripts is a good idea, because you can
catch all compilation errors.

However, for the actual migration, I strongly recommend to use
backup/restore or detach/attach. Scripting is a more complex and a
process more prone to errors.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||On Feb 13, 10:10 pm, Erland Sommarskog <esq...@.sommarskog.sewrote:

Quote:

Originally Posted by

Mork69 (mle...@.bigfoot.com) writes:

Quote:

Originally Posted by

The only reliable way to catch all issues is to script out your SQL
2000 databases and then rebuild them on a SQL 2005 database with
compatibility level 90. This method is much better than using the
Upgrade Advisor alone.


>
I agree that running the scripts is a good idea, because you can
catch all compilation errors.
>
However, for the actual migration, I strongly recommend to use
backup/restore or detach/attach. Scripting is a more complex and a
process more prone to errors.
>
--
Erland Sommarskog, SQL Server MVP, esq...@.sommarskog.se
>
Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


In fact, if both approaches are used then the migration should be
perfect. i.e. You script out and build in order to highlight and fix
all the problems. If you keep the scripts for the objects that were
fixed then you can do the detach/attach and then recreate them.