Showing posts with label master. Show all posts
Showing posts with label master. Show all posts

Monday, March 19, 2012

Detaching system databases...

I need to detach (in order to move the datafiles) MASTER,
MSDB, MODEL, TEMPDB. I am using EM and the sp_detach
options om SQL Server 2000 but it's saying "Can't detach
system databases". Am I missing a step?
Do I need to end all connections?
Thanks,
Todd
Why are you detaching the system databases? Are you planning on moving them
to another server? Here is some information about moving system databases,
that might help.
http://support.microsoft.com/default...&Product=sql2k
----
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Todd" <anonymous@.discussions.microsoft.com> wrote in message
news:f1c901c43db7$4ed332f0$a401280a@.phx.gbl...
> I need to detach (in order to move the datafiles) MASTER,
> MSDB, MODEL, TEMPDB. I am using EM and the sp_detach
> options om SQL Server 2000 but it's saying "Can't detach
> system databases". Am I missing a step?
> Do I need to end all connections?
> Thanks,
> Todd
|||Ugh, you can go through everything in KB #224071 and cross your fingers that
it all works well. Or, you can detach your *user* databases (or hopefully
you already have valid backups you can simply restore), uninstall SQL
Server, and then reinstall - placing the data directory where you should
have.
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Todd" <anonymous@.discussions.microsoft.com> wrote in message
news:f1c901c43db7$4ed332f0$a401280a@.phx.gbl...
> I need to detach (in order to move the datafiles) MASTER,
> MSDB, MODEL, TEMPDB. I am using EM and the sp_detach
> options om SQL Server 2000 but it's saying "Can't detach
> system databases". Am I missing a step?
> Do I need to end all connections?
> Thanks,
> Todd
|||I want to move the datafiles because I put them on the C:\
(only 3GB) by mistake when I installed the SQL Server. I
want to move everything to another drive with 50GB+. I
have moved the user databases successfully but the system
databases don't want to go.
I reinstall would not be bad but I would prefer not to;)
=20
>--Original Message--
>Why are you detaching the system databases? Are you
planning on moving them
>to another server? Here is some information about moving
system databases,
>that might help.
>http://support.microsoft.com/default...24071&Product=
=3Dsql2k
>--=20
>---=
--
>---=
--
>--
>Need SQL Server Examples check out my website at
>http://www.geocities.com/sqlserverexamples
>"Todd" <anonymous@.discussions.microsoft.com> wrote in message
>news:f1c901c43db7$4ed332f0$a401280a@.phx.gbl...
>
>.
>
|||>> I reinstall would not be bad but I would prefer not to;)
Why? It's much cleaner, IMHO.
|||KB 224071, which Aaron suggested, describes moving files for system databases.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<anonymous@.discussions.microsoft.com> wrote in message news:f40501c43dc5$006531a0$a101280a@.phx.gbl...
I want to move the datafiles because I put them on the C:\
(only 3GB) by mistake when I installed the SQL Server. I
want to move everything to another drive with 50GB+. I
have moved the user databases successfully but the system
databases don't want to go.
I reinstall would not be bad but I would prefer not to;)

>--Original Message--
>Why are you detaching the system databases? Are you
planning on moving them
>to another server? Here is some information about moving
system databases,
>that might help.
>http://support.microsoft.com/default...&Product=sql2k
>--
>----
>----
>--
>Need SQL Server Examples check out my website at
>http://www.geocities.com/sqlserverexamples
>"Todd" <anonymous@.discussions.microsoft.com> wrote in message
>news:f1c901c43db7$4ed332f0$a401280a@.phx.gbl...
>
>.
>

Detaching system databases...

I need to detach (in order to move the datafiles) MASTER,
MSDB, MODEL, TEMPDB. I am using EM and the sp_detach
options om SQL Server 2000 but it's saying "Can't detach
system databases". Am I missing a step?
Do I need to end all connections'
Thanks,
ToddWhy are you detaching the system databases? Are you planning on moving them
to another server? Here is some information about moving system databases,
that might help.
http://support.microsoft.com/default.aspx?scid=kb;en-us;224071&Product=sql2k
--
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Todd" <anonymous@.discussions.microsoft.com> wrote in message
news:f1c901c43db7$4ed332f0$a401280a@.phx.gbl...
> I need to detach (in order to move the datafiles) MASTER,
> MSDB, MODEL, TEMPDB. I am using EM and the sp_detach
> options om SQL Server 2000 but it's saying "Can't detach
> system databases". Am I missing a step?
> Do I need to end all connections'
> Thanks,
> Todd|||Ugh, you can go through everything in KB #224071 and cross your fingers that
it all works well. Or, you can detach your *user* databases (or hopefully
you already have valid backups you can simply restore), uninstall SQL
Server, and then reinstall - placing the data directory where you should
have.
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Todd" <anonymous@.discussions.microsoft.com> wrote in message
news:f1c901c43db7$4ed332f0$a401280a@.phx.gbl...
> I need to detach (in order to move the datafiles) MASTER,
> MSDB, MODEL, TEMPDB. I am using EM and the sp_detach
> options om SQL Server 2000 but it's saying "Can't detach
> system databases". Am I missing a step?
> Do I need to end all connections'
> Thanks,
> Todd|||I want to move the datafiles because I put them on the C:\
(only 3GB) by mistake when I installed the SQL Server. I
want to move everything to another drive with 50GB+. I
have moved the user databases successfully but the system
databases don't want to go.
I reinstall would not be bad but I would prefer not to;)
>--Original Message--
>Why are you detaching the system databases? Are you
planning on moving them
>to another server? Here is some information about moving
system databases,
>that might help.
>http://support.microsoft.com/default.aspx?scid=3Dkb;en-us;224071&Product=
=3Dsql2k
>-- >---=--
>---=--
>--
>Need SQL Server Examples check out my website at
>http://www.geocities.com/sqlserverexamples
>"Todd" <anonymous@.discussions.microsoft.com> wrote in message
>news:f1c901c43db7$4ed332f0$a401280a@.phx.gbl...
>> I need to detach (in order to move the datafiles) MASTER,
>> MSDB, MODEL, TEMPDB. I am using EM and the sp_detach
>> options om SQL Server 2000 but it's saying "Can't detach
>> system databases". Am I missing a step?
>> Do I need to end all connections'
>> Thanks,
>> Todd
>
>.
>|||>> I reinstall would not be bad but I would prefer not to;)
Why? It's much cleaner, IMHO.|||KB 224071, which Aaron suggested, describes moving files for system databases.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<anonymous@.discussions.microsoft.com> wrote in message news:f40501c43dc5$006531a0$a101280a@.phx.gbl...
I want to move the datafiles because I put them on the C:\
(only 3GB) by mistake when I installed the SQL Server. I
want to move everything to another drive with 50GB+. I
have moved the user databases successfully but the system
databases don't want to go.
I reinstall would not be bad but I would prefer not to;)
>--Original Message--
>Why are you detaching the system databases? Are you
planning on moving them
>to another server? Here is some information about moving
system databases,
>that might help.
>http://support.microsoft.com/default.aspx?scid=kb;en-us;224071&Product=sql2k
>--
>----
>----
>--
>Need SQL Server Examples check out my website at
>http://www.geocities.com/sqlserverexamples
>"Todd" <anonymous@.discussions.microsoft.com> wrote in message
>news:f1c901c43db7$4ed332f0$a401280a@.phx.gbl...
>> I need to detach (in order to move the datafiles) MASTER,
>> MSDB, MODEL, TEMPDB. I am using EM and the sp_detach
>> options om SQL Server 2000 but it's saying "Can't detach
>> system databases". Am I missing a step?
>> Do I need to end all connections'
>> Thanks,
>> Todd
>
>.
>

Detaching system databases...

I need to detach (in order to move the datafiles) MASTER,
MSDB, MODEL, TEMPDB. I am using EM and the sp_detach
options om SQL Server 2000 but it's saying "Can't detach
system databases". Am I missing a step?
Do I need to end all connections'
Thanks,
ToddWhy are you detaching the system databases? Are you planning on moving them
to another server? Here is some information about moving system databases,
that might help.
http://support.microsoft.com/defaul...1&Product=sql2k
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Todd" <anonymous@.discussions.microsoft.com> wrote in message
news:f1c901c43db7$4ed332f0$a401280a@.phx.gbl...
> I need to detach (in order to move the datafiles) MASTER,
> MSDB, MODEL, TEMPDB. I am using EM and the sp_detach
> options om SQL Server 2000 but it's saying "Can't detach
> system databases". Am I missing a step?
> Do I need to end all connections'
> Thanks,
> Todd|||Ugh, you can go through everything in KB #224071 and cross your fingers that
it all works well. Or, you can detach your *user* databases (or hopefully
you already have valid backups you can simply restore), uninstall SQL
Server, and then reinstall - placing the data directory where you should
have.
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Todd" <anonymous@.discussions.microsoft.com> wrote in message
news:f1c901c43db7$4ed332f0$a401280a@.phx.gbl...
> I need to detach (in order to move the datafiles) MASTER,
> MSDB, MODEL, TEMPDB. I am using EM and the sp_detach
> options om SQL Server 2000 but it's saying "Can't detach
> system databases". Am I missing a step?
> Do I need to end all connections'
> Thanks,
> Todd|||I want to move the datafiles because I put them on the C:\
(only 3GB) by mistake when I installed the SQL Server. I
want to move everything to another drive with 50GB+. I
have moved the user databases successfully but the system
databases don't want to go.
I reinstall would not be bad but I would prefer not to;)
=20
>--Original Message--
>Why are you detaching the system databases? Are you
planning on moving them
>to another server? Here is some information about moving
system databases,
>that might help.
>http://support.microsoft.com/defaul...224071&Product=
=3Dsql2k
>--=20
>---=
--
>---=
--
>--
>Need SQL Server Examples check out my website at
>http://www.geocities.com/sqlserverexamples
>"Todd" <anonymous@.discussions.microsoft.com> wrote in message
>news:f1c901c43db7$4ed332f0$a401280a@.phx.gbl...
>
>.
>|||>> I reinstall would not be bad but I would prefer not to;)
Why? It's much cleaner, IMHO.|||KB 224071, which Aaron suggested, describes moving files for system database
s.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<anonymous@.discussions.microsoft.com> wrote in message news:f40501c43dc5$006
531a0$a101280a@.phx.gbl...
I want to move the datafiles because I put them on the C:\
(only 3GB) by mistake when I installed the SQL Server. I
want to move everything to another drive with 50GB+. I
have moved the user databases successfully but the system
databases don't want to go.
I reinstall would not be bad but I would prefer not to;)

>--Original Message--
>Why are you detaching the system databases? Are you
planning on moving them
>to another server? Here is some information about moving
system databases,
>that might help.
>]
>--
>----
-
>----
-
>--
>Need SQL Server Examples check out my website at
>[url]http://www.geocities.com/sqlserverexamples" target="_blank">http://support.microsoft.com/defaul...lserverexamples
>"Todd" <anonymous@.discussions.microsoft.com> wrote in message
>news:f1c901c43db7$4ed332f0$a401280a@.phx.gbl...
>
>.
>

Friday, February 24, 2012

Design question SQL Server 2005

I am very new to SQL Server 2005. I have a database of criminal records consisting of a master table of names where the primary key is a case number and 3 related minor tables: violations, charges, and appeals. They are linked by the case number with a one-to-many relationship. Not all of these tables have a record for every master record.

I am designing a simple lookup program in VB 2005 in which info from all tables will be on one screen. A search will be done on either name or case number.

What is the best way so set up views and/or stored procs for such a program? Do I need a stored proc for each minor table or is there a way to set up one proc to pull all of the info? Did I mention I was new at this? I have worked a lot with Access and recognize just enough things in SQL Server to be really confused.

Thanks for the help!

To get you started, you can get all the info with a single query. eg if we assume case number:

SELECT m.col1, v.col1, c.col1, a.col1
FROM masterTable
LEFT JOIN violations v
ON m.caseid = v.caseid
LEFT JOIN charges c
ON m.caseid = c.caseid
LEFT JOIN appeals a
ON m.caseid = a.caseid
WHERE m.caseid = @.caseid

Depending on how your app should work, you may not want to display all details if name is serached for, but rather use name as a way to look up the case number first, then go query for the details.

/Kenneth

Friday, February 17, 2012

Design Help - How to get the Best Design

Dear Experts
Originally in about 1986/87 I was a cobol programmer and was used to doing
things the Master Transaction way. After a long gap i am currently in a
situation of
working with SQL Server 7.0 but somehow i feel my design leans on Master
Transaction Style where i increment the balance in master after every
transaction. MY Question is As Follows:
1. What is the yard stick for a great DB Design.?
2. What kind of Book Should i Read?
3. Any Pointers and Help on Database Design Sample or
courses i can take would be greatly appreciated.
Thanks in Advance and i apologize for this post if it is not in the right
forum.
Manish
Three Cheers to Technet for the Help!
Look at
http://www.databaseanswers.org/data_models/index.htm
for some samples:
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
"Manish Sawjiani" <ManishSawjiani@.discussions.microsoft.com> schrieb im
Newsbeitrag news:27506C1E-A756-4506-AF2D-368E757A82B5@.microsoft.com...
> Dear Experts
> Originally in about 1986/87 I was a cobol programmer and was used to doing
> things the Master Transaction way. After a long gap i am currently in a
> situation of
> working with SQL Server 7.0 but somehow i feel my design leans on Master
> Transaction Style where i increment the balance in master after every
> transaction. MY Question is As Follows:
> 1. What is the yard stick for a great DB Design.?
> 2. What kind of Book Should i Read?
> 3. Any Pointers and Help on Database Design Sample or
> courses i can take would be greatly appreciated.
> Thanks in Advance and i apologize for this post if it is not in the right
> forum.
> Manish
>
> --
> Three Cheers to Technet for the Help!

Design Help - How to get the Best Design

Dear Experts
Originally in about 1986/87 I was a cobol programmer and was used to doing
things the Master Transaction way. After a long gap i am currently in a
situation of
working with SQL Server 7.0 but somehow i feel my design leans on Master
Transaction Style where i increment the balance in master after every
transaction. MY Question is As Follows:
1. What is the yard stick for a great DB Design.?
2. What kind of Book Should i Read?
3. Any Pointers and Help on Database Design Sample or
courses i can take would be greatly appreciated.
Thanks in Advance and i apologize for this post if it is not in the right
forum.
Manish
--
Three Cheers to Technet for the Help!Look at
http://www.databaseanswers.org/data_models/index.htm
for some samples:
--
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"Manish Sawjiani" <ManishSawjiani@.discussions.microsoft.com> schrieb im
Newsbeitrag news:27506C1E-A756-4506-AF2D-368E757A82B5@.microsoft.com...
> Dear Experts
> Originally in about 1986/87 I was a cobol programmer and was used to doing
> things the Master Transaction way. After a long gap i am currently in a
> situation of
> working with SQL Server 7.0 but somehow i feel my design leans on Master
> Transaction Style where i increment the balance in master after every
> transaction. MY Question is As Follows:
> 1. What is the yard stick for a great DB Design.?
> 2. What kind of Book Should i Read?
> 3. Any Pointers and Help on Database Design Sample or
> courses i can take would be greatly appreciated.
> Thanks in Advance and i apologize for this post if it is not in the right
> forum.
> Manish
>
> --
> Three Cheers to Technet for the Help!

Design Help - How to get the Best Design

Dear Experts
Originally in about 1986/87 I was a cobol programmer and was used to doing
things the Master Transaction way. After a long gap i am currently in a
situation of
working with SQL Server 7.0 but somehow i feel my design leans on Master
Transaction Style where i increment the balance in master after every
transaction. MY Question is As Follows:
1. What is the yard stick for a great DB Design.?
2. What kind of Book Should i Read?
3. Any Pointers and Help on Database Design Sample or
courses i can take would be greatly appreciated.
Thanks in Advance and i apologize for this post if it is not in the right
forum.
Manish
Three Cheers to technet for the Help!Look at
http://www.databaseanswers.org/data_models/index.htm
for some samples:
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Manish Sawjiani" <ManishSawjiani@.discussions.microsoft.com> schrieb im
Newsbeitrag news:27506C1E-A756-4506-AF2D-368E757A82B5@.microsoft.com...
> Dear Experts
> Originally in about 1986/87 I was a cobol programmer and was used to doing
> things the Master Transaction way. After a long gap i am currently in a
> situation of
> working with SQL Server 7.0 but somehow i feel my design leans on Master
> Transaction Style where i increment the balance in master after every
> transaction. MY Question is As Follows:
> 1. What is the yard stick for a great DB Design.?
> 2. What kind of Book Should i Read?
> 3. Any Pointers and Help on Database Design Sample or
> courses i can take would be greatly appreciated.
> Thanks in Advance and i apologize for this post if it is not in the right
> forum.
> Manish
>
> --
> Three Cheers to technet for the Help!