Creating Databases

Nov 2, 2004

Ok I have the Sql all written and I was going to use MYSql but it wasn't working. I was told that MSSQL worked with the files but I can't for the life of me figure out how to use it. I installed the desktop version so it is running but now how do I create and edit databases and tables and so forth. Help is greatly apprieciated as the only other sql I have done is for php forums. Thanks and If you could tell me if I need to download another program to do it graphically or something that would be awesome.

EDIT: I am using Windows Server 2003 Enterprise if that makes any difference. ISS 6.0 (kind of understand some of it)

View 1 Replies


ADVERTISEMENT

Creating Databases On The Fly

Jun 29, 2006

hello,

i am trying to create a database by using a store procedure. This stored procedure takes two input parameters. i want to assign these parameters to the 'Filename' attributes when i'm creating the database both for the .mdf and .ldf files. However i keep getting an error.

These work -------
FILENAME ='c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctes tdblog.mdf',

FILENAME ='c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctes tdblog.ldf',

These do'nt work--------
FILENAME = @Databasepath,
FILENAME = @Databaselogpath,

Here is my code:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CREATE PROCEDURE rico_dbasescript
@Databasepath varchar(100) = 'c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctes tdb.mdf' , @Databaselogpath varchar(100)= 'c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctes tdblog.ldf'
AS
IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'Sardonyxrioctestdb')
DROP DATABASE [Sardonyxrioctestdb]



CREATE DATABASE Sardonyxrioctestdb
ON
( NAME = 'Sardonyxrioctestdb_dat',
FILENAME = @Databasepath,
--FILENAME ='c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctes tdb.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = 'Sardonyxrioctestdb_log',
FILENAME = @Databaselogpath,
--FILENAME ='c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctes tdblog.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB )
GO


I am still researching my problem but i would appreciate any help. Thanks guys.

JamaicanGuy
**I am a newbie .net developer.
Jah Bless!!!!!!!!!!!!

View 1 Replies View Related

Creating Databases

Oct 13, 2007

When i create a database and later on want to add a file in it

Alter database db1
Add File
(Size = 2MB,
Maxsize = 5MB,
Filegrowth = 20%)

this gives me an error because there's no filename.
I would like to know if filename is mandatory?
Thanks as i got an error when running saying no filename.

View 2 Replies View Related

Creating Over 100-databases.

Apr 21, 2007

Hi,

I'm using SQL Server 2005 Express for an application.



SQL Server 2005 Express supports 4GB user data per database. Because need over 4GB(may be 20GB ~ 30GB) data space, I should split database which each max size up to 200 MB. And create 100 databases.



Is it reasonable? If true, what about the performance or system's overhead?



Thank you.

View 1 Replies View Related

Creating Databases Under Master

Mar 20, 2007

 When creating databases is it a good idea to use the master.dbo.sysdatabases database and then create databases under this.

View 4 Replies View Related

Creating Databases From .mdf File?

Apr 23, 2001

how do you create a database from an .mdf file?

View 2 Replies View Related

Creating Reporting Databases

Sep 11, 2002

I have a reporting server with 5 databases which are currently being updated via log shipping. These databases need to be (read) accessed by the users. All users have System Admin perms due in order to access the databases. I need to tighten security on the server and remove SA perms from the users. The largest database is about 8gb and is growing slowly. What is the best way to move the databases efficiently from the source server to the reporting server? The log shipped databases can't be backed up and restored due to the standby mode. DTS is an option but may pose time issues due to database size especially as the databases grow in the future. Replication is another option but i have heard it has alot of issues. Any help is welcome. Thanks.

View 2 Replies View Related

Creating Databases On Network Drives?

Jul 11, 2001

Is this possible? I seem to remember doing it with SQL Server 7 a long time ago. The Microsoft Knowledgebase says it's not possible with 4.2 through 6.5, but nothing about 7.0 and up.

View 2 Replies View Related

Creating Duplicate Databases Daily

Nov 6, 2005

I want to be able to create a duplicate database and update / refresh it daily automatically. This database copy would be used for testing purposes so I don't want it to write back to the original database. Is replication of some kind the answer?

View 4 Replies View Related

Changing 'Filename' Attri. When Creating Databases

Jul 13, 2006

Obadiah writes "hello,

I am a newbie to developing .net applications unfortunately my boss and my colleaques think i am a pro (interview went too well) and i would like to get at least this months paycheck before am fired....so i here's my dumb question:

I want to create a SQL database from my vb.net application using stored procedures, however i want to be able to set the Filename attribute ('Filename = C:Program FilesMicrosoft SQL ServerMSSQL$SARDONYXINSTANCEData estdb.mdf') by means of a input parameter to the stored procedure. like so...
Filename = @databasepath.

HERE is what i have:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CREATE PROCEDURE rico_dbasescript
@Databasepath varchar(100) = 'c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctestdb.mdf' , @Databaselogpath varchar(100)= 'c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctestdblog.ldf'
AS

IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'Sardonyxrioctestdb')
DROP DATABASE [Sardonyxrioctestdb]



CREATE DATABASE Sardonyxrioctestdb
ON
( NAME = 'Sardonyxrioctestdb_dat',
FILENAME = @Databasepath,
--FILENAME ='c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctestdb.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = 'Sardonyxrioctestdb_log',
FILENAME = @Databaselogpath,
--FILENAME ='c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctestdblog.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB )
GO


The above procedure works fine when Filename = 'c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctestdb.mdf'
but bombs out when Filename = @Databaselogpath.

Thank you in advance."

View 2 Replies View Related

Creating Multiple Databases From A Single Backup F

Nov 9, 2006

Hi,
I want to create two databases by restoring from a
single backup file in sql server. I am using 2005-sqlexpress .Is it possible?

Thanx in advance..

View 3 Replies View Related

Alternative To Creating View With Union In Two Databases?

Jul 20, 2005

I attempted to create a view in SQL Server 2000 that Unions twoqueries. The first part of the query gets data from the local server,the second part gets info from a linked server. (The query works finein Query Analyzer.)I received this error when I tried to save the query:ODBC error: [Microsoft][ODBC SQL Server Driver] The operation couldnot be performed because the OLE DB provider 'SQLOLEDB' was unable tobegin a distributed transaction.[Microsft][ODBC SQL Server Driver][SQL Server][OLE/DB providerreturned message: New transaction cannot enlist in the specifiedtransaction coordinator.]After a little reading I discovered the "Database limitation":"A view can be created on a table only in the database the viewcreator is accessing".That's my problem... is there a simple solution or alternative tocreating a view?Thanks,Matt

View 2 Replies View Related

Creating A Query That Access Multiply Databases

Dec 10, 2007


Dear Readers,
Is it possible to create a query that access multiple sql express databases? Or is it possible to link a table in one database from another?

View 1 Replies View Related

Errors Creating Databases (visual Studios)

Apr 14, 2008

I have VB2008 express edition and SQL server 2005. When i try to create a new local datasource in my project, the datasource seems to be created just fine however an error message comes up. If i try to create the datasource by selecting it on the 'add new item' menu, an error message says

"The data provider required to connect to the local data file could not be found. The file will be added to the project but the typed Dataset associated with the project will not be created."

If I try to create the datasource by selecting 'add new datasource' from the datasources pane, i can create the connection to a new or existing database but when i click next to proceed to the page defining the dataset, an error message says

"An error occured while converting this connection:
Data provided identified by guid ' 7c602b5b-accb-4acd-9dc0-ca66388c1533 ' could not be loaded"

PLEASE HELP!!
I have no idea how to fix it

thanks,
jordan

View 3 Replies View Related

Creating User And Giving Permission To All Databases

Feb 27, 2008



Hi,

Any body please give me some TSQL Stored procedure for

creating an SQL user and to give db access permission to all the databases available on a the server.

Mujeeb

View 5 Replies View Related

Creating Databases On WinXP SP2 With SQL Server 2005 CE RC

Nov 28, 2006

Hi,

For various reasons a new desktop application I am developing is using the SQL Server 2005 Compact Edition Release Candidate to store local data. On my development machine (XP SP2, VS2005, SQL Server 2005 Developer Edition) the software is able to create the database file, and read and write to it fine.

However on our test machine, which does not have any of the development tools the software is unable to create the database. A System.Data.SqlServerCe.SqlCeException is thrown. The message is: "SQL Mobile usage is restricted on this platform. To use SQL Mobile, you must install SQL Server 2005, Visual Studio 2005, or the Tablet PC SKU." Obviously this goes somewhat against the blurb for SQL Server CE.

Is this something that will be fixed shortly? Or is it the intention that databases can't be created on machines that do not SQL Server or Visual Studio installed? (Incidentally the reason for creating the database on the fly is that we are encrypting it, using the users credentials, so that only they can open the database.)

Thanks, Steve

View 4 Replies View Related

Creating Report Based On Multiple Databases?

May 6, 2008

My application uses 2 databases from 2 different server. When i create a report model in business intellegence development studio I can only create 1 datasource for each database, and 1 datasource view for each datasource. Then when I create a new report, I can only use one datasource.

Is it possible that my report can be built on more than one databases?

thanks in advance

View 4 Replies View Related

Creating Relational Databases(Primary/Foreign Key?)

Jul 16, 2007

Hey everyone,
I have just started getting into to SQL and am completely brand new to the whole concepts of relational databases. Someone on this forum pointed to the MSDN videos on LEARNVISUALSTUDIO.NET which have been very helpful. Unfortunately while learning about relational databases and looking at the program that I want to design and make using them, I have run into a pretty big wall, concerning the primary key and foreign key.
For my program, I am trying to save an object, and lets say the base class is SLIDE. Now SLIDE will store basically most of the information that I will ever want to store, such as timeCreated and mainText and slideID(primarykey). But there are other classes that derive from slide that will store just a bit more information than that because of what they are. Lets say there is a class derived from SLIDE called PERSON that stores its parentNode, which is to say something that this slide specifically belongs to and has a reference to. Now the tricky part is that in this program, every single slide can have a reference to another slide, that you would see displayed and that you could just click on and view if you wanted to.
Now relating what I just told about the classes in my program to a relation database standpoint is what confuses me. If I make a table SLIDE, it would hold incomplete data about the PERSON object, because that object has more data than SLIDE has. The answer to this was to make another table called PERSON, which would have more columns. But now we arrive at the big problem: The primary key called maybe SLIDEID would be different in this new PERSON table than in the other table called SLIDE (or any other derived class). Therefore the link between these tables is messed up. In my object orientated mind I am thinking of static class variables that would still stay constant for derived classes, so that when I make a PERSON slide it will increment off of the primary key of the SLIDE table. In other words, is there some sort of super TABLE that you can derive from, like an abstract class, where the primary keys of other tables can build off of because they will be used as the same type of reference to eachother.
If none of this made sense to the reader, I am greatly sorry. I do not really know what else I can say to convey to you the problem I have. Maybe its because I am so used to object orientated languages that this is making it so difficult to explain. If however you do understand what I am talking about, please think about it and help me find a solution to this problem. I am not an experienced programmer, but I do very much enjoy it and I am very excited about starting to make this program, and I have learned that before I start coding it is very important to have a very firm design in mind first.
Thank your for reading,
Jeremy

View 5 Replies View Related

Creating Multiple Databases Running Off The Same Data Engine

Aug 23, 2005

Hi, I have looked and loked for the answer to this question and made no progress.  I want to install MSDE on one of our servers, however, when I went to install it, I found that there was another MSDE already installed and running (it was an agent running with our backup software Veritas).  Is it alright to create another database and have 2 running simultaneous on the same data engine?  Is there any type of limitations that I sould know about - such as number of allowed accesses at one time?  Any help is greatly appreicated.

View 1 Replies View Related

Creating Databases Under MS SQL 2005 Server (SP-2): Dbo User Role

Jun 9, 2007

Good Day,



I am having a problem with creating databases in MS SQL 2005 Server. When I attempt to assign an User Mapping for my SQL user account to the newly created database, the "dbo" user and schema is already assigned. When I try to drop this user in favor of my own, I receive an error message: Cannot alter the user "dbo" (Microsoft SQL Server, Error: 15150). I am connected to my database engine through the "sa" account.



Regards,

Keith

View 6 Replies View Related

Creating Sql Server 2005 Express Databases Via VS2005 Std.

Dec 5, 2007



This post is an extension onto the one below....
Please read my question at the bottom... cheers

---------------------------------------------------------------------------------------------------------------------------------------
Sept. 26th 2006




Hello all,

I use Visual Studio 2005 Standard. I would like to know the best way that I can create Sql Server 2005 Express databases visually since VS2005 Std. does not allow me to do it.
Any help is appreciated and thanks in advance,

- Noble Bell






I'd be interested in knowing how VS doesn't allow you to create a database. What error are you getting?
There are two ways to create databases, depending on your goal:

To just create a database on your server, do the following:


Open the Server Explorer
Right-click on Data Connections
Click Create New SQL Server Database
Specify Server Name and Database Name



Your database will be created and you can start working with it.

Embed a database in your project:


On the Project menu, click Add New Item.
Select SQL Database from the list and give it a name.
Click OK

This will run you thorugh a wizard to create the database.
If your having problems doing either of these, you may not have SQL Server installed on your computer or VS might be pointing to the wrong Instance Name. Check out the Option dialog under Database Tools:ata Connection and verify that the correct instance is specified.

- Mike Wachel - MSFT

---------------------------------------------------------------------------------------------------------------------------------------


I am trying to create a similar project and I also recieve an error while trying to create a database...

"An error has occured while establishing a connection to the server. When connecting to SQL Server 2005, this
failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could Not Open A Connection to SQL Server."


Now let me explain what i am trying to do ...
I am trying to create a web interface for the data that I want to store in the SQL database. I have installed VS2005 & SQL Server Express 2005 on my local machine. I want to develope this project on my local machine and then transfer it to a server once i have finished the project.

If i am doing this all wrong, please let me know !

View 2 Replies View Related

Creating And Using SQL Server 2005 Compact Edition Databases

Jan 17, 2007

OK I think I am missing something here. I have installed the newly released SQL Compact Edition, Server Tools, and Tools for VS SP1. According to the documentation you can do the following to create a SQL Compact Edition DB:

Creating a SQL Server Compact Edition database on the server




In SQL Server Management Studio, open Object Explorer.


In Object Explorer, click Connect, and then choose SQL Server Compact Edition.


In the Connect to Server dialog box, select <New Database€¦> from the Database file drop-down list.


In the Create New SQL Server Compact Edition Database dialog box, type a file path and file name for the new database file. You can optionally select the default sort order and choose whether you want to encrypt or password-protect the database. If you choose to encrypt or password-protect the database, type a password, and then click OK.


Click Connect to connect to the new SQL Server Compact Edition database. The database is now displayed in Object Explorer.

I see no reference to or any option to create or connect to a SQL Server Compact Edition database in SQL Mgmt Studio. I had SQL 2005 Mobile installed previously and this still shows as an option. What I am missing here? Is SQL Mobile now SQL Compact Editon?

Thanks in advance,

Jack

View 5 Replies View Related

Creating Sql Server 2005 Express Databases Via VS2005 Std.

Sep 27, 2006

Hello all,

I use Visual Studio 2005 Standard. I would like to know the best way that I can create Sql Server 2005 Express databases visually since VS2005 Std. does not allow me to do it.

Any help is appreciated and thanks in advance,

View 1 Replies View Related

Creating Databases Using The Sql Server Shiped With Visual Studio

Nov 19, 2007



Dear Reader,

I'm having some problems writing T-sql statement in visual studio 2005 because i cant find either the query analyzer or enterprise manager in the version of sql server installed. Please kindly put me through that or do i need to create the database outside visual studio. Please will be greatful for this if u can help.

View 1 Replies View Related

Creating A Database From Multiple Databases Accross Multiple Servers

Sep 13, 2007

Hi,

I'm trying to create a database that takes specific information from a number of databases on different servers to make some reporting that we have much easier.

I'm pretty new to SQL so I'm not sure of the best way to proceed. I read an article that suggested I use the OPENROWSET command. The problem is, the version of SQL that came with one of the programmes we use is limited and will not allow you to turn on the allow "Ad Hoc distributed Queries" so the SLQ statement will not execute.

I'm confused why it won't let me to connect through ODBC as I've created a web page that selects data from this database with no problems!

Here is the SQL statement that I've written to make sure it is the correct one (on the msdn library page it said that this was the ODBC connection):

SELECT a.*
FROM OPENROWSET('MSDASQL','DRIVER=(SQL Server);SERVER=APPOLOACT7;UID=sa;PWD=***************',
'SELECT * FROM MDCTestAndDev.dbo.TBL_CONTACT') AS a



I've also created the ODBC connection using the tool on Administration Tools>Data Sources ODBC

Any help would be greatly appreciated (also any ways of selecting from one database and inserting it into another will be helpfull)

Thanks

View 8 Replies View Related

Linking Tables From Different Databases Or Querying From Multiple Databases

Dec 10, 2007

Dear Readers,Is it possible, like in Access, to link to tables in other SQL databases that are on the same server? I have a query that I originally had in Access that queered from multiply databases. It did this by having those other tables in the other databases linked to the database that had the query. 
 

View 3 Replies View Related

Service Broker Not Working For Restored Databases (SQL 2000 Databases Restored On 2005)

Jan 24, 2006

I just restored my SQL server 2000 database on the SQL server 2005. after this i ran the Service broker sample ("Hello World") on this database by changing the AdventureWorks name to the new database name. The "setup.sql" runs fine. When i run the "SendMessage.sql" i was not getting any rows in the output (The message was not getting inserted into the queue). I checked the Service broker is enabled on this databased using the query "select is_broker_enabled from sys.databases where name = 'newdbname' " It was 1. I even tried the ALTER DATABASE SET ENABLE_BROKER. but it didnt work.

When i tried the sample on a newly created database it worked fine.

Is there any solution to make the restored database to work for service broker.

Thanks

Prashanth

View 3 Replies View Related

Creating Trigger On Creating Table

Jan 28, 2008



Hi,

If I want to automatically insert a record which has default value in a table,
how can I create the trigger?

View 5 Replies View Related

Copying Databases Between Databases

Feb 8, 2000

hi from France !!!

i would like how to duplicate a database to another server with all datas, constraints, keys, indexes...
should i use sp_attach_db, dts, backup/restore, sql scripts... ???

thanks to all, nico

View 1 Replies View Related

Creating A New User For Sp Execution Say Sa (to Whom I Am In Need Of Creating Under My User Defined Db )

Jul 11, 2007

I am in need of creating a new user for stored procedures execution say sa (to whom i am in need of creating under my user defined db)

View 1 Replies View Related

Connect From Databases In 1st Instance To Databases In 2nd Instance

Mar 13, 2007

This is the scenario. Is it possible to create views or something (like Oracle DB Links) in a database in Instance 1 which can show data from another database in 2nd Instance ?


I want to do this to create reports.

View 2 Replies View Related

Two Databases

Sep 24, 2006

I have created a site which now has two databases. Firstly is the ASPNETDB.MDF which I beleives get set to manage the security, logon/Roles that I have on my site. The second dataabase "MyDatabase" is one that I have created for all my data withing the site. I would like to combine this to one Database for simplicity and cost. Now I can't see the  ASPNETDB.MDF when I use SQL Manager 2005 and I can't see how to change the set up of ASP.Net Configuration if I was to just use mydatabase. Any suggestions

View 1 Replies View Related

Two Databases?

Sep 25, 2006

Hi, I have my site set up, but have had difficulty using the data gathered by the aspnet.mdf. I wanted to use the email and username columns from the membership table to send newsletters automatically from the database(but that's a whole other post)I also have my own databse, which will be populated by information gathered from the website, so is currently empty. I'd like to take this opportunity to say that i don't think there's enough information given on how to populate a blank database from a website application. Most tuorials etc are concentrated on retrieving and displaying data, which is all well and good, once you actually have data to play with!I don't need two databases, so can I add tables to the aspnet.mdf ? But then what about relationships etc? I won't damage the current relationships by adding new ones? On the other hand can i copy the aspnet.mdf into my own database, and then assign the relevant permissions to that db? Any help would be greatly appreciated-in language for newbies please! I am relatively new to .asp.net/Visual Basic/ and SQL. It's a steep learning curve!Also....I have used create user wizard, login, password recovery etc within my site, the data is inserted into the correct db tables-without using an sql datasource for some reason...? is that right?I have also created a wizard to collect some more data (because i couldn't work out how to insert the data from the extra steps in create user wizard, into my own database)  but when i click submit the data is not inserting into the specified table - (yes the connection string is fine, insert and update has been selected from the advance tab in connections wizard). Would this/could this be because i have assigned a 'finishbutton url'? should i use a Response.Redirect("blahblah.aspx") instead? 

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved