Showing posts with label creation. Show all posts
Showing posts with label creation. Show all posts

Friday, February 17, 2012

Database creation/management tools?

Can someone please tell me if there are any third-party tools that will
allow me to create/manage/diagram databases as easily for SQL Server as for
Access?
I'm currently developing a pretty complex SQL database by creating it first
in Access and using the Upsizing wizard, but I've found that certain things
get lost in the translation, and I'd prefer to not have to go through the
extra work of finding/fixing the omissions.
Thanks!I would NOT develop any "pretty complex SQL database by creating it first in
Access and using the Upsizing wizard."
--
Linchi Shea
linchi_shea@.NOSPAMml.com
"Joe Sabatini" <sabatini@.optonline.net> wrote in message
news:eg2xj3GkDHA.708@.TK2MSFTNGP10.phx.gbl...
> Can someone please tell me if there are any third-party tools that will
> allow me to create/manage/diagram databases as easily for SQL Server as
for
> Access?
> I'm currently developing a pretty complex SQL database by creating it
first
> in Access and using the Upsizing wizard, but I've found that certain
things
> get lost in the translation, and I'd prefer to not have to go through the
> extra work of finding/fixing the omissions.
> Thanks!
>|||I agree with Linchi. It should be designed in a totally SQL Server aware
and compatible tool. You might want to look at the ERD tools from
Embarcadero or Sybase but they will not be cheap. Another alternative that
is less expensive but does have many features is a tool called xcase.
http://www.xcase.com/index3.html
--
Andrew J. Kelly
SQL Server MVP
"Linchi Shea" <linchi_shea@.NOSPAMml.com> wrote in message
news:%232m6TjHkDHA.2200@.TK2MSFTNGP12.phx.gbl...
> I would NOT develop any "pretty complex SQL database by creating it first
in
> Access and using the Upsizing wizard."
> --
> Linchi Shea
> linchi_shea@.NOSPAMml.com
>
> "Joe Sabatini" <sabatini@.optonline.net> wrote in message
> news:eg2xj3GkDHA.708@.TK2MSFTNGP10.phx.gbl...
> > Can someone please tell me if there are any third-party tools that will
> > allow me to create/manage/diagram databases as easily for SQL Server as
> for
> > Access?
> >
> > I'm currently developing a pretty complex SQL database by creating it
> first
> > in Access and using the Upsizing wizard, but I've found that certain
> things
> > get lost in the translation, and I'd prefer to not have to go through
the
> > extra work of finding/fixing the omissions.
> >
> > Thanks!
> >
> >
>

Database creation with SMO in SSE

Hi there.

I tried finding any info regarding this approach and I can't find any, so here I am (again!).

I'm trying to create a database using SMO on a freshly installed SQL Server Express (not going through the advanced install, not going through the surface area configuration, so a lot of things are "wrong").

I get an error

- use SMO to try and create a database; this is the pseudo-code combo used:

1. create new Smo.Database object;

2. create new primary file group and data file for that database (using Smo.FileGroup and Smo.DataFile); add them to the database.

3. invoke Create(). catch exception with the following details:

Exception details:

Microsoft.SqlServer.Management.Smo.FailedOperationException was caught
HelpLink="http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Database&LinkId=20476"
Message="Create failed for Database 'NewDatabase'. "
Source="Microsoft.SqlServer.Smo"
Operation="Create"
StackTrace:
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImpl()
at Microsoft.SqlServer.Management.Smo.Database.Create()
at Penta.Core.Library.Sql.Classes.Penta_SqlDatabase.Create() in C:\Documents and Settings\[...]


InnerException:

{"Directory lookup for the file \"C:\\Documents and Settings\\[...]\\NewDatabase.mdf\" failed
with the operating system error 5(Access is denied.).\r\nCREATE DATABASE failed. Some file names listed could not be created. Check related
errors."}

Seems like user rights error.

Long story short, the only way the creation step works is if I change the Log on for the SQL Express service from the default Network Service to Local System (either through code or not).

Now, I know LocalSystem is not a wise idea, but it seems to be the only way.

I know it's probably something stupid, but what am I missing?

Thanks you in advance

Hi Calin,

You're right, it's a permissions error. Network Service does not have permissions to read and write files in your User Profile directorys (i.e. the stuff under %My Documents%). This is by design as SQL Express runs as Network Service is the default Service Account for SQL Express. Local System does have permissions to your user profile direcotries, so changing the Service Account results in success. You could have also...

Changed the Service Account to any other account that has permissions to the directory where you want to create your files.|||

Hi, Mike, and thank you for your reply. Your comments make perfect sense, so I'll try and circumvent the problem.

Theoretically, my app would be ran from client machines, with the database on a file server. However, it can also be used locally (small company, single user, etc.). Since more than one user can access the same data in the same time, I don't think User Instances would be a good choice for me.

I do plan on shipping SQL Express with the app, however the users can choose to get SQL Server and use it instead, so using User Instances is not an answer because of that, either.

Of all, it seems the best way would be to change the "default" folder where that data is created, the issue is that the user can choose where they want the database file(s) to be created, so they may specify My Documents :-) In the case of a real shop with someone who knows what they're doing this will most likely not happen, however, the application is suppose to be easily accessible for all users, regardless of their abilities.

Thank you again for your help,

Database creation using VB.NET Code

Hello.

I think its silly question but i expect some solution .

Is there any way to create sql sever database by using VB.NET code ? I have to create database,tables,sps and also transfer the data from one database to newly created database.

Please, if somebody have some solution then guide me in detail.

Thanks in adv.If the database you need to create is a copy of some fixed database, you can create SSIS package, and then run it from VB.NET code.
If you just need to create a database from scratch, use SMO. See Books Online, and if you need help consult SMO/DMO forum:
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=88&SiteID=1
|||

Hi,

I am trying to create a copy of some fixed database. I am wondering how creating a SSIS package will help.Is there any code for making this database replication?

Thank You!

|||

Partially it depends on exactly what your problem is. If you just want to take a database from one server and move it to another, why not issue a backup, copy, and restore using 3 SSIS tasks? You'll need to fix up any SQL Server users, but that could be scripted as well as adding any missing logins.

Another alternative if you can take the database offline, is to detach the database, copy the database files directly, and then reattach on both servers. Might be a bit faster but requires some down-time.

There's also a Transfer SQL Server Objects task if more approrpriate to your needs which might wrap most of the stuff up into one task.

If you just want to sync one database to another while they are both online, then hopefully your database is structured to do that or you'll have to truncate or delete the records from the tables in the destination and then create data flow tasks for each level of referential integrity to move the data.

You could also look at SQL Server replication or SQL Server Mirroring.

|||

Basically, what I am trying to do is within the same server, i want to create a copy of an existing database. This copy will be used for a different purpose.

|||

Backup and restore to a new name WITH MOVE sounds like the easiest. On a single server you could do it all in one SQL Task or break it into two, you won't have to fix users or add logins either.|||Is there any sample code where I can look at written in vb.net?

|||

Just standard .Net code. You'll likely have better luck over in the VB or C# forums for help with the code and in the Transact SQL forums for assistance with the SQL. Below is a fictionalized example. You might add a DROP DATABASE, you may want to kill off connections, etc. It would just be additional SQL in the code below. Change the CommandTimeout based on how long you expect it to restore (in seconds) and then maybe double it. Below is assuming it takes 30ish minutes to backup and restore.

Imports System.Text

Module Module1

Sub Main()

Using cn As New SqlClient.SqlConnection(My.Settings.Connection)

cn.Open()

Dim sql As New StringBuilder

sql.AppendLine("BACKUP DATABASE [myDatabase] TO DISK='C:\mypath\myfile.BAK';")

sql.AppendLine("RESTORE DATABASE [myDatabaseNEW] FROM DISK='C:\mypath\myfile.BAK WITH MOVE myDatabase_Data TO 'C:\mydatapath\myDatabaseNEW.MDF', MOVE myDatabase_Log TO 'C:\mydatapath\myDatabaseNEW.ldf'")

Using cmd As New SqlClient.SqlCommand(sql.ToString, cn)

cmd.CommandTimeout = 1800

cmd.ExecuteNonQuery()

End Using

End Using

End Sub

End Module

|||

Hi,

I get an error saying that 'myDatabase.mdf' cannot be overwritten because it us being used by database 'myDatabase'

|||

Your WITH MOVE isn't working, make sure the files listed are different than the files of the original database.

Such as myDatabaseNew.mdf not myDatabase.mdf.

|||

I found where the mistake was. Instead of using WITH MOVE 'myDatabase' I wrote it as WITH MOVE 'myDatabaseNew'. This was the reason for the error.

Its working well now.

Thanks !

|||Just an alternate suggestion - there is a Transfer Database task in SSIS that automates much of this.

Database creation using VB.NET Code

Hello.

I think its silly question but i expect some solution .

Is there any way to create sql sever database by using VB.NET code ? I have to create database,tables,sps and also transfer the data from one database to newly created database.

Please, if somebody have some solution then guide me in detail.

Thanks in adv.
If the database you need to create is a copy of some fixed database, you can create SSIS package, and then run it from VB.NET code.
If you just need to create a database from scratch, use SMO. See Books Online, and if you need help consult SMO/DMO forum:
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=88&SiteID=1
|||

Hi,

I am trying to create a copy of some fixed database. I am wondering how creating a SSIS package will help.Is there any code for making this database replication?

Thank You!

|||

Partially it depends on exactly what your problem is. If you just want to take a database from one server and move it to another, why not issue a backup, copy, and restore using 3 SSIS tasks? You'll need to fix up any SQL Server users, but that could be scripted as well as adding any missing logins.

Another alternative if you can take the database offline, is to detach the database, copy the database files directly, and then reattach on both servers. Might be a bit faster but requires some down-time.

There's also a Transfer SQL Server Objects task if more approrpriate to your needs which might wrap most of the stuff up into one task.

If you just want to sync one database to another while they are both online, then hopefully your database is structured to do that or you'll have to truncate or delete the records from the tables in the destination and then create data flow tasks for each level of referential integrity to move the data.

You could also look at SQL Server replication or SQL Server Mirroring.

|||

Basically, what I am trying to do is within the same server, i want to create a copy of an existing database. This copy will be used for a different purpose.

|||

Backup and restore to a new name WITH MOVE sounds like the easiest. On a single server you could do it all in one SQL Task or break it into two, you won't have to fix users or add logins either.|||Is there any sample code where I can look at written in vb.net?

|||

Just standard .Net code. You'll likely have better luck over in the VB or C# forums for help with the code and in the Transact SQL forums for assistance with the SQL. Below is a fictionalized example. You might add a DROP DATABASE, you may want to kill off connections, etc. It would just be additional SQL in the code below. Change the CommandTimeout based on how long you expect it to restore (in seconds) and then maybe double it. Below is assuming it takes 30ish minutes to backup and restore.

Imports System.Text

Module Module1

Sub Main()

Using cn As New SqlClient.SqlConnection(My.Settings.Connection)

cn.Open()

Dim sql As New StringBuilder

sql.AppendLine("BACKUP DATABASE [myDatabase] TO DISK='C:\mypath\myfile.BAK';")

sql.AppendLine("RESTORE DATABASE [myDatabaseNEW] FROM DISK='C:\mypath\myfile.BAK WITH MOVE myDatabase_Data TO 'C:\mydatapath\myDatabaseNEW.MDF', MOVE myDatabase_Log TO 'C:\mydatapath\myDatabaseNEW.ldf'")

Using cmd As New SqlClient.SqlCommand(sql.ToString, cn)

cmd.CommandTimeout = 1800

cmd.ExecuteNonQuery()

End Using

End Using

End Sub

End Module

|||

Hi,

I get an error saying that 'myDatabase.mdf' cannot be overwritten because it us being used by database 'myDatabase'

|||

Your WITH MOVE isn't working, make sure the files listed are different than the files of the original database.

Such as myDatabaseNew.mdf not myDatabase.mdf.

|||

I found where the mistake was. Instead of using WITH MOVE 'myDatabase' I wrote it as WITH MOVE 'myDatabaseNew'. This was the reason for the error.

Its working well now.

Thanks !

|||Just an alternate suggestion - there is a Transfer Database task in SSIS that automates much of this.

database creation in XP

I am an SQL beginer, and have installed SQL 2000 in Windows XP SP2. Only the client components of SQL were installed by default in XP. SQL query analyser doesnot detect any servers (I already have IIS installed). In such a scenario how do I create a Database and gain access to it ?Do you know SQL server name?|||

Quote:

Originally Posted by iburyak

Do you know SQL server name?


No. The SQL Query analyser doesnot show any available servers. Also I am not connected to any networked PC. I wish to connect to the local/virtual server in IIS in C drive. I have an ASP.Net application in my wwwroot forlder for which I need to create a database to store and access data. Please note that while installing SQL server in XP I was prompted with the following message: "Microsoft SQL Server 2000 Enterprise Edition server component is not suported on this operating system. Only client components will be available for installation". Also due to this reason the MSSQL server service has not been installed.|||IIS server is a web server and not SQL server.
As far as I understand you didn't install SQL server at all and this is why you can't connect to it.

The only option you have is to use Access database instead. Go to Microsoft Office and you will be able to find it.|||

Quote:

Originally Posted by iburyak

IIS server is a web server and not SQL server.
As far as I understand you didn't install SQL server at all and this is why you can't connect to it.

The only option you have is to use Access database instead. Go to Microsoft Office and you will be able to find it.


Yes you were right. Although SQL was installed the server components were not installed. I have added the server components and now its working fine.
Thanks a lot.

Database Creation Help

Hi All,
I am trying to build a prototype in vb with sql server backend, I have a que
stion regarding the database , due to time constraints i am in a dilema whet
her to build a normalized database or to build a denormalized database and n
ormalize it later'
Which will be a good decision?
Thanks for any help
Sudha.If you don't have time to do it right, where are you going to find the time
to do it over? At least Normalize the biggest pieces.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
"sudha" <anonymous@.discussions.microsoft.com> wrote in message
news:47AACA23-7420-4BF2-9B10-5F37F44123C5@.microsoft.com...
quote:

> Hi All,
> I am trying to build a prototype in vb with sql server backend, I have a

question regarding the database , due to time constraints i am in a dilema
whether to build a normalized database or to build a denormalized database
and normalize it later'
quote:

> Which will be a good decision?
>
> Thanks for any help
> Sudha.
>
|||I meant total Normalization ofcourse.Apllication comes into picture only aft
er approval for the project .
Thanks.|||Usual industry practice is to throw away the prototype code when you are
building it for production.
If that is what you anticipate, I guess either way is fine.
But if you want to prove your design concept and if that is the reason you
are building a prototype, then I would do it right the first way, which is
normalized way.
Keep in mind in certain hybrid systems of OLTP/OLAP, the data is
denormalized deliberately for optimum performance between OLTP and Reporting
operations.
HTH
Satish Balusa
Corillian Corp.
"sudha" <anonymous@.discussions.microsoft.com> wrote in message
news:47AACA23-7420-4BF2-9B10-5F37F44123C5@.microsoft.com...
quote:

> Hi All,
> I am trying to build a prototype in vb with sql server backend, I have a

question regarding the database , due to time constraints i am in a dilema
whether to build a normalized database or to build a denormalized database
and normalize it later'
quote:

> Which will be a good decision?
>
> Thanks for any help
> Sudha.
>
|||Thanks for the advice.
sudha
quote:

>--Original Message--
>Usual industry practice is to throw away the prototype

code when you are
quote:

>building it for production.
>If that is what you anticipate, I guess either way is

fine.
quote:

>But if you want to prove your design concept and if that

is the reason you
quote:

>are building a prototype, then I would do it right the

first way, which is
quote:

>normalized way.
>Keep in mind in certain hybrid systems of OLTP/OLAP, the

data is
quote:

>denormalized deliberately for optimum performance between

OLTP and Reporting
quote:

>operations.
>--
>HTH
>Satish Balusa
>Corillian Corp.
>
>"sudha" <anonymous@.discussions.microsoft.com> wrote in

message
quote:

>news:47AACA23-7420-4BF2-9B10-5F37F44123C5@.microsoft.com...
backend, I have a[QUOTE]
>question regarding the database , due to time constraints

i am in a dilema
quote:

>whether to build a normalized database or to build a

denormalized database
quote:

>and normalize it later'
>
>.
>

Database Creation Help

Hi All,
I am trying to build a prototype in vb with sql server backend, I have a question regarding the database , due to time constraints i am in a dilema whether to build a normalized database or to build a denormalized database and normalize it later'
Which will be a good decision?
Thanks for any help
Sudha.If you don't have time to do it right, where are you going to find the time
to do it over? At least Normalize the biggest pieces.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
"sudha" <anonymous@.discussions.microsoft.com> wrote in message
news:47AACA23-7420-4BF2-9B10-5F37F44123C5@.microsoft.com...
> Hi All,
> I am trying to build a prototype in vb with sql server backend, I have a
question regarding the database , due to time constraints i am in a dilema
whether to build a normalized database or to build a denormalized database
and normalize it later'
> Which will be a good decision?
>
> Thanks for any help
> Sudha.
>|||I meant total Normalization ofcourse.Apllication comes into picture only after approval for the project .
Thanks.|||Usual industry practice is to throw away the prototype code when you are
building it for production.
If that is what you anticipate, I guess either way is fine.
But if you want to prove your design concept and if that is the reason you
are building a prototype, then I would do it right the first way, which is
normalized way.
Keep in mind in certain hybrid systems of OLTP/OLAP, the data is
denormalized deliberately for optimum performance between OLTP and Reporting
operations.
--
HTH
Satish Balusa
Corillian Corp.
"sudha" <anonymous@.discussions.microsoft.com> wrote in message
news:47AACA23-7420-4BF2-9B10-5F37F44123C5@.microsoft.com...
> Hi All,
> I am trying to build a prototype in vb with sql server backend, I have a
question regarding the database , due to time constraints i am in a dilema
whether to build a normalized database or to build a denormalized database
and normalize it later'
> Which will be a good decision?
>
> Thanks for any help
> Sudha.
>|||Thanks for the advice.
sudha
>--Original Message--
>Usual industry practice is to throw away the prototype
code when you are
>building it for production.
>If that is what you anticipate, I guess either way is
fine.
>But if you want to prove your design concept and if that
is the reason you
>are building a prototype, then I would do it right the
first way, which is
>normalized way.
>Keep in mind in certain hybrid systems of OLTP/OLAP, the
data is
>denormalized deliberately for optimum performance between
OLTP and Reporting
>operations.
>--
>HTH
>Satish Balusa
>Corillian Corp.
>
>"sudha" <anonymous@.discussions.microsoft.com> wrote in
message
>news:47AACA23-7420-4BF2-9B10-5F37F44123C5@.microsoft.com...
>> Hi All,
>> I am trying to build a prototype in vb with sql server
backend, I have a
>question regarding the database , due to time constraints
i am in a dilema
>whether to build a normalized database or to build a
denormalized database
>and normalize it later'
>> Which will be a good decision?
>>
>> Thanks for any help
>> Sudha.
>
>.
>

Database creation from inside of Visual C#

When I create a database from inside of Visual C# Express, why can't I view it with the manager from the SQL Server Express Edition? I mean, it does not appear at all. Is there any problem?

hi,

chances are you are using a User Instance, so that you can usually not "browse" your database using a "standard" connection via SQL Server Management Studio.. the article explains how to connect to User Instance databases via other clients than the calling application..

regards

|||

Hi

Well, I followed the article closely and retrieved the pipe and ran the command "sqlcmd -S np:\\.\pipe\010E053B-3912-43\tsql\query" and I received the following error:

"HResult 0x2, Level 16, State 1
Named Pipes Provider: Could not open a connection to SQL Server [2].
Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establi
shing a connection to the server. When connecting to SQL Server 2005, this failu
re may be caused by the fact that under the default settings SQL Server does not
allow remote connections..
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired."

I enabled Remote Connections from Surface Area Controll, stoped the service, restarted it, and it gives me the same error. How can I connect to a User Instance with the SQL Server Management? I did not saw such option ...

Also I want to ask if there are some resources to learn for an absolute beginner SQL Server Express. Some recomandations would be nice.

|||

hi,

try the SQL Server Configuration Manager as well... there you can enable the desired nework protocol..

regards

|||

Check out the FAQ at the top of this forum, you will find instructions on connecting Management Studio to a User Instance.

Enabling remote connections is not required, particularly since User Instances only support local connections. If you bravely read through the entire error you got, you'll see that the problem you're having is a timeout. This is a particularly bad error message that gets throwen for basically every connection problem (hey, I wasn't here when they wrote it). The important bit is usually at the end in parenthasis.

In your case I'll bet your User Instance isn't started so you're timing out trying to connect. The FAQ explains the details of how to get this to work.

Mike

database creation durations

Trying to bring up a server at a DR site and running into what I think are
excessive durations for .mdf / .ndf file creation. It takes SQL server 1.5
hours to grab each 50 GB file. Disk subsystem at the site is a local
Ultra-Wide SCSI. RAID5 array.
Is 1.5 hours for a 50 GB excessive? What metrics can I use to monitor?
Oscar ElleseffIs this a 3 disk Raid 5? If so that is the worst performing Raid array you
can have for write intensive operations. Depending on the processors and
disks this may not be out of the question. If you upgrade to SQL2005 you
can take advantage of the zero-initialization feature for data files and
this will be cut down to probably a minute or less.
--
Andrew J. Kelly SQL MVP
"Oscar" <Oscar@.discussions.microsoft.com> wrote in message
news:B9334E0E-8AF1-4C79-9E0D-5E909C541E54@.microsoft.com...
> Trying to bring up a server at a DR site and running into what I think are
> excessive durations for .mdf / .ndf file creation. It takes SQL server
> 1.5
> hours to grab each 50 GB file. Disk subsystem at the site is a local
> Ultra-Wide SCSI. RAID5 array.
> Is 1.5 hours for a 50 GB excessive? What metrics can I use to monitor?
>
> Oscar Elleseff
>
>
>

database creation durations

Trying to bring up a server at a DR site and running into what I think are
excessive durations for .mdf / .ndf file creation. It takes SQL server 1.5
hours to grab each 50 GB file. Disk subsystem at the site is a local
Ultra-Wide SCSI. RAID5 array.
Is 1.5 hours for a 50 GB excessive? What metrics can I use to monitor?
Oscar Elleseff
Is this a 3 disk Raid 5? If so that is the worst performing Raid array you
can have for write intensive operations. Depending on the processors and
disks this may not be out of the question. If you upgrade to SQL2005 you
can take advantage of the zero-initialization feature for data files and
this will be cut down to probably a minute or less.
Andrew J. Kelly SQL MVP
"Oscar" <Oscar@.discussions.microsoft.com> wrote in message
news:B9334E0E-8AF1-4C79-9E0D-5E909C541E54@.microsoft.com...
> Trying to bring up a server at a DR site and running into what I think are
> excessive durations for .mdf / .ndf file creation. It takes SQL server
> 1.5
> hours to grab each 50 GB file. Disk subsystem at the site is a local
> Ultra-Wide SCSI. RAID5 array.
> Is 1.5 hours for a 50 GB excessive? What metrics can I use to monitor?
>
> Oscar Elleseff
>
>
>

database creation durations

Trying to bring up a server at a DR site and running into what I think are
excessive durations for .mdf / .ndf file creation. It takes SQL server 1.5
hours to grab each 50 GB file. Disk subsystem at the site is a local
Ultra-Wide SCSI. RAID5 array.
Is 1.5 hours for a 50 GB excessive? What metrics can I use to monitor?
Oscar ElleseffIs this a 3 disk Raid 5? If so that is the worst performing Raid array you
can have for write intensive operations. Depending on the processors and
disks this may not be out of the question. If you upgrade to SQL2005 you
can take advantage of the zero-initialization feature for data files and
this will be cut down to probably a minute or less.
Andrew J. Kelly SQL MVP
"Oscar" <Oscar@.discussions.microsoft.com> wrote in message
news:B9334E0E-8AF1-4C79-9E0D-5E909C541E54@.microsoft.com...
> Trying to bring up a server at a DR site and running into what I think are
> excessive durations for .mdf / .ndf file creation. It takes SQL server
> 1.5
> hours to grab each 50 GB file. Disk subsystem at the site is a local
> Ultra-Wide SCSI. RAID5 array.
> Is 1.5 hours for a 50 GB excessive? What metrics can I use to monitor?
>
> Oscar Elleseff
>
>
>

Database Creation

Hello...

I want to develop a web site having two features

1. Online Shopping
2. Forums

Im using SQL Server, ASP.NET and C#. Now the problem is that how do I configure the Databases. Whether I create new database for each or I marge the both things into one database. if i create saperate databases for each of the feature then users have to register for two times, first for forums and second for shopping. I dont want to do this...! I want users to register just for once.

____________
Thanks in adv
Nauman Ahmed

Creating of 2 separated DB will be better.

You can use the registration info in one DB table and to use this DB table for authentication. So, registrations will be one time only

regards

database creation

hi

if i open the management studio express and trying to create a database by right clicking the server name and trying in the new query window,im getting error as

CREATE DATABASE permission denied in database 'master'.

can anyone help me in rectifying this error?

Thanks in advance

It seems as though your login does not have permission to create a new database.

Log in as the administrator, and give your login the appropriate priviledges.

|||

hi arnie

thank you for your answer

I found another error as

when i opened the management express in windows authentication mode and tried to create table thats also did'nt work

after that i saw that i did'nt install the service pack 2

now the problem is solved after installing the SP2

i created my login and its working fine

thank you for ur response

thanks,

Poorani

Database creation

I downloaded the sample database AdventureWorks from microsoft . When I run the download it created the data and log files under data folder in MSQLalong with other data and log files of master databases etc. However I do not see this database in SQLserver management studio. Can some one help me how to fix this so that I will be able to see this database in management studio.

I am downloading this for SQL server reporting purpose

Hi Kash,

The sample database installation delivers the database files to your machine, but does not "attach" the database to a specific SQL instance.

To attach the database you could do one of the following:

(1) Execute the following query:

USE master
GO
EXEC sp_attach_db 'AdventureWorksDW', '<path to your MDF file>AdventureWorksDW_Data.mdf', '<path to your LDF file>AdventureWorksDW_Log.ldf'

(you could use whatever name you like and also - make sure the MDF and LDF file names are correct, too)

(2) In SQL Management Studio, right-click the Databases folder, select "Attach". Navigate to the folder where the MDF file is installed and select it.

With either steps, the database is attached, recovered and comes online. BTW - this is a good way to move or rename a database: detach, move, attach (possibly under different name).

HTH,

Jivko Dobrev - MSFT
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Database Creation

I believe that I have a performance issue with one of my new servers. The
server is a dedicated SQL box. It's running Windows2003 and SQLServer2000.
I'm in the early stages of preping the server for production use. I notice
when I create a database, it takes 5 - 6 minutes. The same statement of my
laptop takes 30 - 45 seconds. Any ideas on what the issue could be? I
certainly have more disk and memory available on the server than my old
laptop. The database creation statement is as follows:
CREATE DATABASE [Test] ON (NAME='TestData', FILENAME='d:\sqldata\Test.mdf',
SIZE =999, FILEGROWTH=20%) LOG ON (NAME='TestLog',
FILENAME='d:\sqldata\Test.ldf' , SIZE = 10, FILEGROWTH = 30%)
--
TomRAID 5?
(Seems to bit too much of a slow down even for RAID 5, but who knows...).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
news:AFDF9C49-0D9D-4453-8F66-2C9972559A54@.microsoft.com...
>I believe that I have a performance issue with one of my new servers. The
> server is a dedicated SQL box. It's running Windows2003 and SQLServer2000.
> I'm in the early stages of preping the server for production use. I notice
> when I create a database, it takes 5 - 6 minutes. The same statement of my
> laptop takes 30 - 45 seconds. Any ideas on what the issue could be? I
> certainly have more disk and memory available on the server than my old
> laptop. The database creation statement is as follows:
> CREATE DATABASE [Test] ON (NAME='TestData', FILENAME='d:\sqldata\Test.mdf',
> SIZE =999, FILEGROWTH=20%) LOG ON (NAME='TestLog',
> FILENAME='d:\sqldata\Test.ldf' , SIZE = 10, FILEGROWTH = 30%)
> --
> Tom

DataBase Creation

I am developing and application which requires a database and 7 tables.
I am trying to figure out how to do the installation of this database and
what approach to installing a database is appropriate, as I have never
installed an application which requires the installation of database.
I was hoping someone could point me in the direction of the "appropriate
way to do this".
Should I create the script files for the database and tables ind then
execute that SQL to build the tables, possibly prompting the user for the
location as to where the tables should be installed?
Should I do a Database backup of an "empty" database structure (database
and tables) and then do some sort of restore of the database through my
application?
What is the appropriate technique to this type of installation?
Thanks in advance for your assistance!!!!!!If you want to supply your database with some pre-defined values are some
data records, sending a backup of the database might be a good option, since
all the users have to do is to restore the database at their end using
Enterprise Manager. If you want to avoid this hazzle, you can create the
scripts for the database along with table creation and data insertion
scripts and then have it execute. The "pubs" database of SQL Server is done
in this way. If you have SQL Server installed, you can see how this script
is structured, by navigating to: C:\Program Files\Microsoft SQL
Server\MSSQL\Install\instpubs.sql
--
HTH,
SriSamp
Please reply to the whole group only!
http://www32.brinkster.com/srisamp
"Jim Heavey" <JimHeavey@.nospam.com> wrote in message
news:Xns946EDAE2F587DJimHeaveyhotmailcom@.207.46.248.16...
> I am developing and application which requires a database and 7 tables.
> I am trying to figure out how to do the installation of this database and
> what approach to installing a database is appropriate, as I have never
> installed an application which requires the installation of database.
> I was hoping someone could point me in the direction of the "appropriate
> way to do this".
> Should I create the script files for the database and tables ind then
> execute that SQL to build the tables, possibly prompting the user for the
> location as to where the tables should be installed?
> Should I do a Database backup of an "empty" database structure (database
> and tables) and then do some sort of restore of the database through my
> application?
> What is the appropriate technique to this type of installation?
>
> Thanks in advance for your assistance!!!!!!|||I have seen companies do both... The problem I have with delivering mdf and
ldf files or backup files, is that
1. These files may have a limited life span, since MS could change the
file format
2. You would have pre-selected collation and initial file sizes and
layout
I prefer using scripts, then you are covered... Then high end user can then
create the database in any way they see fit and run your scripts to setup
the tables and data...
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Jim Heavey" <JimHeavey@.nospam.com> wrote in message
news:Xns946EDAE2F587DJimHeaveyhotmailcom@.207.46.248.16...
> I am developing and application which requires a database and 7 tables.
> I am trying to figure out how to do the installation of this database and
> what approach to installing a database is appropriate, as I have never
> installed an application which requires the installation of database.
> I was hoping someone could point me in the direction of the "appropriate
> way to do this".
> Should I create the script files for the database and tables ind then
> execute that SQL to build the tables, possibly prompting the user for the
> location as to where the tables should be installed?
> Should I do a Database backup of an "empty" database structure (database
> and tables) and then do some sort of restore of the database through my
> application?
> What is the appropriate technique to this type of installation?
>
> Thanks in advance for your assistance!!!!!!|||One of our 10 commandments here is "Always script".
We script table creation - index creation - table format
changes - everything. We script BULK INSERT's from .txt
files to pre-fill tables with data. We script the
dropping and re-creation of stored procedures.
We script the "GRANT" of access/rights/etc.
If someone makes a change in Enterprise Manager we would
never know to get it into production. That would be a
disaster.
Been working very well for us. We are simultaneously
developing three large enterprise apps - migrating from
mainframes (VAX's) that have been in use since 1980's
>--Original Message--
>If you want to supply your database with some pre-
defined values are some
>data records, sending a backup of the database might be
a good option, since
>all the users have to do is to restore the database at
their end using
>Enterprise Manager. If you want to avoid this hazzle,
you can create the
>scripts for the database along with table creation and
data insertion
>scripts and then have it execute. The "pubs" database of
SQL Server is done
>in this way. If you have SQL Server installed, you can
see how this script
>is structured, by navigating to: C:\Program
Files\Microsoft SQL
>Server\MSSQL\Install\instpubs.sql
>--
>HTH,
>SriSamp
>Please reply to the whole group only!
>http://www32.brinkster.com/srisamp
>"Jim Heavey" <JimHeavey@.nospam.com> wrote in message
>news:Xns946EDAE2F587DJimHeaveyhotmailcom@.207.46.248.16...
>> I am developing and application which requires a
database and 7 tables.
>> I am trying to figure out how to do the installation
of this database and
>> what approach to installing a database is appropriate,
as I have never
>> installed an application which requires the
installation of database.
>> I was hoping someone could point me in the direction
of the "appropriate
>> way to do this".
>> Should I create the script files for the database and
tables ind then
>> execute that SQL to build the tables, possibly
prompting the user for the
>> location as to where the tables should be installed?
>> Should I do a Database backup of an "empty" database
structure (database
>> and tables) and then do some sort of restore of the
database through my
>> application?
>> What is the appropriate technique to this type of
installation?
>>
>> Thanks in advance for your assistance!!!!!!
>
>.
>

DataBase Creation

I am developing and application which requires a database and 7 tables.
I am trying to figure out how to do the installation of this database and
what approach to installing a database is appropriate, as I have never
installed an application which requires the installation of database.
I was hoping someone could point me in the direction of the "appropriate
way to do this".
Should I create the script files for the database and tables ind then
execute that SQL to build the tables, possibly prompting the user for the
location as to where the tables should be installed?
Should I do a Database backup of an "empty" database structure (database
and tables) and then do some sort of restore of the database through my
application?
What is the appropriate technique to this type of installation?
Thanks in advance for your assistance!!!!!!If you want to supply your database with some pre-defined values are some
data records, sending a backup of the database might be a good option, since
all the users have to do is to restore the database at their end using
Enterprise Manager. If you want to avoid this hazzle, you can create the
scripts for the database along with table creation and data insertion
scripts and then have it execute. The "pubs" database of SQL Server is done
in this way. If you have SQL Server installed, you can see how this script
is structured, by navigating to: C:\Program Files\Microsoft SQL
Server\MSSQL\Install\instpubs.sql
--
HTH,
SriSamp
Please reply to the whole group only!
http://www32.brinkster.com/srisamp
"Jim Heavey" <JimHeavey@.nospam.com> wrote in message
news:Xns946EDAE2F587DJimHeaveyhotmailcom
@.207.46.248.16...
quote:

> I am developing and application which requires a database and 7 tables.
> I am trying to figure out how to do the installation of this database and
> what approach to installing a database is appropriate, as I have never
> installed an application which requires the installation of database.
> I was hoping someone could point me in the direction of the "appropriate
> way to do this".
> Should I create the script files for the database and tables ind then
> execute that SQL to build the tables, possibly prompting the user for the
> location as to where the tables should be installed?
> Should I do a Database backup of an "empty" database structure (database
> and tables) and then do some sort of restore of the database through my
> application?
> What is the appropriate technique to this type of installation?
>
> Thanks in advance for your assistance!!!!!!
|||I have seen companies do both... The problem I have with delivering mdf and
ldf files or backup files, is that
1. These files may have a limited life span, since MS could change the
file format
2. You would have pre-selected collation and initial file sizes and
layout
I prefer using scripts, then you are covered... Then high end user can then
create the database in any way they see fit and run your scripts to setup
the tables and data...
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Jim Heavey" <JimHeavey@.nospam.com> wrote in message
news:Xns946EDAE2F587DJimHeaveyhotmailcom
@.207.46.248.16...
quote:

> I am developing and application which requires a database and 7 tables.
> I am trying to figure out how to do the installation of this database and
> what approach to installing a database is appropriate, as I have never
> installed an application which requires the installation of database.
> I was hoping someone could point me in the direction of the "appropriate
> way to do this".
> Should I create the script files for the database and tables ind then
> execute that SQL to build the tables, possibly prompting the user for the
> location as to where the tables should be installed?
> Should I do a Database backup of an "empty" database structure (database
> and tables) and then do some sort of restore of the database through my
> application?
> What is the appropriate technique to this type of installation?
>
> Thanks in advance for your assistance!!!!!!
|||One of our 10 commandments here is "Always script".
We script table creation - index creation - table format
changes - everything. We script BULK INSERT's from .txt
files to pre-fill tables with data. We script the
dropping and re-creation of stored procedures.
We script the "GRANT" of access/rights/etc.
If someone makes a change in Enterprise Manager we would
never know to get it into production. That would be a
disaster.
Been working very well for us. We are simultaneously
developing three large enterprise apps - migrating from
mainframes (VAX's) that have been in use since 1980's
quote:

>--Original Message--
>If you want to supply your database with some pre-

defined values are some
quote:

>data records, sending a backup of the database might be

a good option, since
quote:

>all the users have to do is to restore the database at

their end using
quote:

>Enterprise Manager. If you want to avoid this hazzle,

you can create the
quote:

>scripts for the database along with table creation and

data insertion
quote:

>scripts and then have it execute. The "pubs" database of

SQL Server is done
quote:

>in this way. If you have SQL Server installed, you can

see how this script
quote:

>is structured, by navigating to: C:\Program

Files\Microsoft SQL
quote:

>Server\MSSQL\Install\instpubs.sql
>--
>HTH,
>SriSamp
>Please reply to the whole group only!
>http://www32.brinkster.com/srisamp
>"Jim Heavey" <JimHeavey@.nospam.com> wrote in message
> news:Xns946EDAE2F587DJimHeaveyhotmailcom
@.207.46.248.16...
database and 7 tables.[QUOTE]
of this database and[QUOTE]
as I have never[QUOTE]
installation of database.[QUOTE]
of the "appropriate[QUOTE]
tables ind then[QUOTE]
prompting the user for the[QUOTE]
structure (database[QUOTE]
database through my[QUOTE]
installation?[QUOTE]
>
>.
>

Database Creation

I believe that I have a performance issue with one of my new servers. The
server is a dedicated SQL box. It's running Windows2003 and SQLServer2000.
I'm in the early stages of preping the server for production use. I notice
when I create a database, it takes 5 - 6 minutes. The same statement of my
laptop takes 30 - 45 seconds. Any ideas on what the issue could be? I
certainly have more disk and memory available on the server than my old
laptop. The database creation statement is as follows:
CREATE DATABASE [Test] ON (NAME='TestData', FILENAME='d:\sqldata\Test.md
f',
SIZE =999, FILEGROWTH=20%) LOG ON (NAME='TestLog',
FILENAME='d:\sqldata\Test.ldf' , SIZE = 10, FILEGROWTH = 30%)
TomRAID 5?
(Seems to bit too much of a slow down even for RAID 5, but who knows...).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
news:AFDF9C49-0D9D-4453-8F66-2C9972559A54@.microsoft.com...
>I believe that I have a performance issue with one of my new servers. The
> server is a dedicated SQL box. It's running Windows2003 and SQLServer2000
.
> I'm in the early stages of preping the server for production use. I notic
e
> when I create a database, it takes 5 - 6 minutes. The same statement of m
y
> laptop takes 30 - 45 seconds. Any ideas on what the issue could be? I
> certainly have more disk and memory available on the server than my old
> laptop. The database creation statement is as follows:
> CREATE DATABASE [Test] ON (NAME='TestData', FILENAME='d:\sqldata\Test.
mdf',
> SIZE =999, FILEGROWTH=20%) LOG ON (NAME='TestLog',
> FILENAME='d:\sqldata\Test.ldf' , SIZE = 10, FILEGROWTH = 30%)
> --
> Tom