.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Create a database in a different path

Posted By:      Posted Date: September 12, 2010    Points: 0   Category :Sql Server
Hello, I want to add a database that will be stored in a different path than the default path. Is it possible or must I install a whole new instance of the SQL server and create the database there? Thanks.  

View Complete Post

More Related Resource Links

Connestion string create any database server

This links important to how to create connection string to any data base sever.

Create/add table from code to database



I create table:

                  DataSet data=new DataSet();

                  DataTable myTable = new DataTable("NewTable");

                   DataColumn[] keys = new DataColumn[1];

                   // create column
                   keys[0] = new DataColumn();
                   keys[0].DataType = System.Type.GetType("System.String");
                   keys[0].ColumnName = "PointID";
                   myTable.Columns.Add(keys[0]);    &nb

how create database?????


I want to make databas? that will send daily to all members that leave email?Please if you can help me

Yukon Basics: XML, T-SQL, and the CLR Create a New World of Database Programming


The next version of SQL Server, code-named "Yukon," includes quite a few enhancements and expanded language support. For example, Transact-SQL now conforms more closely to the ANSI-99 SQL specification and makes querying more flexible and expressive. Yukon can execute user-defined functions, stored procedures, and triggers written in CLR-targeted languages, including Visual Basic .NET and C#. It supports a subset of the W3C standard XQuery language, and has native XML support.In this article, the author outlines the most significant language features and builds an order-entry sample app.

Eric Brown

MSDN Magazine February 2004

Metadata: Create a Database Schema Repository with Meta Data Services in SQL Server 2000


SQL Server 2000 Meta Data Services is a repository technology that stores and manages metadata for SQL Server. Instead of building database schemas over and over, Meta Data Services allows you to freeze an entire schema for use in other projects. You can also use these schemas for training, testing, or debugging. In this article, the authors will review the various components of Meta Data Services and show how it can be programmed using a Visual Basic client, XML, and XSLT. They will also show you how to manage and manipulate your metadata by generating a simple database schema using a SQL Server repository.

Alok Mehta and Ricardo Rodriguez

MSDN Magazine May 2003

Create table in the database using management studio


 I have database already on the server. However, when I created new table, the new created table Schema is not dbo. it is my user name. How to solve this?

It shows the new created table Schema is my username but not dbo.

Even though I rename it, it couldn't change. I can see this in table property.



VS2010 Express ASP.net and database file with SQL Authentication - How to create database file with


Hi, I have installed Visual Studio 2010 Express in my local system.

Steps 1. File->New Website

 2.Open datbase explorer, right click on dataconnection

 3.Select Create new connection

 4.use Microsoft SQL Server Database file

5. Type new databse filename

6. Now i want to use SQL authentication which is not working

 7.If we use windows authentication its wokring without any problem

8.But i need sql authentication to be used.

 9.I have not installed SQL studio.

 I am only using the one which is packaged in VisualStudio 2010 SQLClient. Let me know how can we create a new database file with userID and password. So that i can host it in other systems as well without any windows authentication.  I know that VS2010 setup also installs the SQL client which is requiredto create and manage sql databse files/quries etc


i dont know the default userID and password for SQLauthentication. As the express setup did not asked any credentials while installing SQL components


Thanks and regards

 Mahesh kotekar


Create user is creating aspxxxx.mdf database in my app_data folder


I had already setup roles for my pages and requirements call for ability to manage and create users.

So i was looking at code that allows you to do so using membership, even though i got the page to work, it was creating a database in my app_data folder.. i already have SQLExpress setup with the asp schema, but cant figure out how to get my application to use that instead of creating the db in the folder?

What am i missing or doing wrong?

I have the following setup in my web.config file..

		<authentication mode="Windows"/>
			<deny users="?"/>
        <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

How to create a view in my database from a table in another server/database

Is there a way to create a view in my database referencing a table in another server/database if I have the connection information.  I know how to do it in Oracle, simply create a database link, but have never done so in sqlserver.

Windows 7 CREATE DATABASE permission denied in database 'master'. (Microsoft SQL Server, Error: 26

Hi I have migrated to a new computer using Windows 7, 6 gig memory, I7 chip (old machine had xp) and have installed Visual Studio 2008 and  SQL Server 2008 R2.  I get CREATE DATABASE permission denied in database 'master'. (Microsoft SQL Server, Error: 262) when I try to create a new database.  Other posts (example:http://social.msdn.microsoft.com/forums/en-US/sqltools/thread/28fee0ed-c7e2-40df-8f79-f513c9848f09/) work for Vista but I cannot find how to grant permissions.  Run as administrator (vista fix) does not work. I have admin privaleges on my machine.  There are no other accounts.    What do I need to do to update privaleges? Thanks and have a nice day.    

SQL Database Creation Path

Declare   @Path as varchar(500); Declare @mdfpath as varchar(500); Declare   @ldfpath as varchar(500); Set   @Path=(SELECT SUBSTRING(physical_name, 1,CHARINDEX(N'master.mdf',LOWER(physical_name)) -21) DataFileLocation FROM master.sys.master_files WHERE database_id = 1 AND FILE_ID = 1) set   @mdfpath=@Path+'\MSSQL.1\MSSQL\DATA\jjjj3.mdf'; set   @ldfpath=@Path+'\MSSQL.1\MSSQL\DATA\jjjj3_log.ldf';     CREATE DATABASE [jjjj3] ON PRIMARY ( NAME = 'jjjj3', FILENAME = @mdfpath , SIZE = 2048KB , FILEGROWTH = 1024KB )   LOG ON (   NAME = 'jjjj3_log', FILENAME = @mdfpath , SIZE = 1024KB , FILEGROWTH = 10%) The Above procedure creation error b'use of dynamic path of SQL, How to select Dynamic path to file name Thanks K. Govindaraj


I'm doing a VERY simple CREATE DATABASE, but for some reason it's failing. I go int SSMS and try to create a database called 'TEST'. No frills, nothing fancy. I accept all the defaults. I click okay, but then within a couple of seconds, an error is thrown. Here's the T-SQL: CREATE DATABASE [test123] ON PRIMARY ( NAME = N'test', FILENAME = N'H:\SQLData\test.mdf' , SIZE = 3072KB , FILEGROWTH = 1024KB ) LOG ON ( NAME = N'test_log', FILENAME = N'G:\SQLLog\test_log.ldf' , SIZE = 44032KB , FILEGROWTH = 10%) The error is stating "incorrect syntax near hte keyword 'on' "?!?!? Huh?!?!? When I run the exact same command on a different server, it works fine. What is going on?    A. M. Robinson

pull from database and create an increment value

What i want to do is read from a database where the catalog = 12 and then have a button on the page  to add a new catalog named 13 so it takes the 12 and adds 1 to it  so everytime they click the button they will get a message saying "are you sure you want to create anoter catalog?" and if yes then it executes.   thanks for the help guys!

Cannot Create Database Diagrams - SQL Server 2008 Management Studio

I cannot create a database diagram with my client-side SQL Server Management Studio.  I can do this if I am on the actual db server itself.  Please help.

Create SQLCompact 40 Database.

Feeling reallly stupid right now but I can't seem to create a version 4 database. Running Windows 7 Ult 64. I've downloaded the latest version tools from CodePlex but everytime I create a database it's still seen as v3.5. I did do the 64 bit runtime install first. Any idea's anyonekuh

Create new database as a user instance

Hello...Is there any way to create a new database directly as a user instance. I guess this means creating a new mdf/ldf pair which is detached from the server after its created.Thank you...

Create database at network drive?

Is it possible to create a SqlServer database at a network drive? Thanks, Ben
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend