Showing posts with label express. Show all posts
Showing posts with label express. Show all posts

Friday, March 30, 2012

How to create SQL Server Express server (INSTANCENAME) programmatically?

In deploying SQL Express, how do I create a new server (INSTANCENAME)
programmatically?
What would be the best approach to accomplish this.

Thank you so much,(ianicbass@.yahoo.com) writes:
> In deploying SQL Express, how do I create a new server (INSTANCENAME)
> programmatically?
> What would be the best approach to accomplish this.

You should look in Books Online under installing SQL Server, and
particularly unattended installation.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

how to create sql server 2005 instance(after uninstalling sql server express)

I have uninsttaled sql server 2005 express then installed sql server 2005 developer edition.All things are installed and working fine like management studio,BOL,reporting services ,e.t.c.

But there is no instance of sql server 2005.I can connect to sql server 2000 instance from management studio.

I have check from all ways but there isn't any instance.

Could I create a instance of sql server 2005 from some where if yes the how.

You can also check my post at sqlteam forum http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=63600

If you run setup again you can create another instance of SQL Server on the same machine. Just give it a new instance name when you run setup.

|||

Thanks Alexander.

I achieve it exactly the same way a week earlier.What I were trying to find is that is there any way we can create an instance without reinstalling full sql server 2005.As at that time when there isn't any instance but i can connect from management studion to sql server 2000.

|||No You need to go through installation again to install a new instance. For speed you can limit what you install to only a new DB Engine which is quicker than installing all the sql server 2005 components again.|||

Thanks alexander.

That indeed increased my knowledge

Wednesday, March 28, 2012

how to create new login account in MS-SQL Server 2005 Express Edition?

Hi all,

I am new to MS SQL Server.
I have downloaded and installed SQL Server 2005 Express Edition.

I am just learning database programming with this.

But when I read MSDN documents - role, user-name, login-name confuses me.

I tried as following,
1. create database 'eg_database'
2. exec sp_addlogin 'eg_login', 'eg_loginpasswd', 'eg_database'
3. exec sp_adduser 'eg_login', 'eg_user'
after these 3 steps, I tried
sqlcmd -S .\SQLExpress -U 'eg_login'
I was asked for pass word and entered correctly. But I get error only.

Password: Msg 4064, Level 11, State 1, Server SYS1\SQLEXPRESS, Line 1
Cannot open user default database. Login failed.
Msg 18456, Level 14, State 1, Server SURASYS1\SQLEXPRESS, Line 1
Login failed for user 'eg_login'.

What I want to know is,
1. I want to create one new database
2. a new user account to access that database with table create, select, update, delete, alter, insert permission.
3. Any server permissions/configurations have to be done to access from another machine in network? or simply "sqlcmd -S sys1\SQLExpress -U username -P password " (how to specify IP address in this syntax instead system name(i.e. sys1).

pls guide me with steps to finish the above things.

Regards,
Purusothaman A
Finally I found answers for my questions 1 and 2 with the help of MS SQL Server Management Studio Express.

CREATE DATABASE [db1] ON PRIMARY
( NAME = N'db1', FILENAME = N'E:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\db1.mdf' , SIZE = 2048KB , FILEGROWTH = 1024KB )
LOG ON
( NAME = N'db1_log', FILENAME = N'E:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\db1_log.ldf' , SIZE = 1024KB , FILEGROWTH = 10%)
GO

USE [master]
GO
CREATE LOGIN [db1_user] WITH PASSWORD=N'db1_passwd', DEFAULT_DATABASE=[db1], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [db1]
GO
CREATE USER [db1_user] FOR LOGIN [db1_user]
GO

Still searching answer for question 3.

Regards,
Purusothaman A
sql

Monday, March 26, 2012

How to create INSERT query for contents of table

Using Sql Server 2005 Express and Management Studio I need to createa SQL insert statement for the contents of a table (FullDocuments) sothat I can run the query on another server with that same table schema(FullDocuments) and the contents will automatically be inserted intothe new instance of the FullDocuments table.

In Management StudioI have used "Script Table as" for the create table query. Thesecond instance of FullDocuments has been created on the remoteserver. Now how do I generate an insert query for the contents ofFullDocuments so that the contents can be moved/inserted to the newinstance of the table?

Thanks for any help provided.

Why not just do something like :

insert into fulldocuments2

select * from server1.fulldocuments1

|||

Hi Partha. Thanks for the suggestion.

The problem is that the fulldocuments2 is on a web server whilefulldocuments1 is on my local machine which does not allow me to uploada table or db directly. I need to transfer the data by SQL querybut don't how to generate a sql insert statement that contains all thedata from fulldocuments1 without manually typing it. For smalldata inserts I can do that. But this time it involves thousandsof lines of text, so I am hoping for a simple automated way to createthe sql insert statement to move the data.

|||

Just export the data in fulldocuments1 to a flat file and import into fulldocuments2 using Export Import wizard

|||

I can't find the Export Import Wizard. I am using the Express version of SQL Server 2005 and Management Studio.

|||

use bcp to copy out the data and copy it back in the web server

http://msdn2.microsoft.com/en-us/library/ms162802.aspx

|||

The web server admin to which i need to import data only allows dataimport via Query Analyzer (hence sql insert statement) or via CSVfile. Since I am having no luck generating a sql insert statementthat contains the data, it looks like I need to focus on how to createa CSV file with the data content. I have been studying the BCPdocumentation from your link, but don't see any means for generating aCSV file using BCP.

What are my options for creating a CSV file containing the data from the source table?

|||

See this link for an example of bcp to create csv file

http://www.simple-talk.com/sql/database-administration/creating-csv-files-using-bcp-and-stored-procedures/

|||

Consider writing a very short app (20 lines or so) using SqlBulkCopy. It's incredibly easy and incredibly fast.

http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx

http://davidhayden.com/blog/dave/archive/2006/01/13/2692.aspx

|||

Hi Buddha. Thanks for the links. The first one uses VB so I have tried that for my app. I like theconcept of uploading directly to the web server db but am getting thiserror message when I click the button to upload the data:

An error has occurred 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)

Iam a novice at this and realize I am bumping up against a securityissue, but don't know how to solve it. Any help would beappreciated. Here is the VB code for my app:

Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page

Dim connectionString1 As String = "Data Source=_x_connection string to local db_x_"
Dim connectionString2 As String = "Data Source=_x_connection string to web server db_x_"

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

' Open a connection to the source database.
Using sourceConnection As SqlConnection = _
New SqlConnection(connectionString1)
sourceConnection.Open()

' Perform an initial count on the destination table.
Dim commandRowCount As New SqlCommand( _
"SELECT COUNT(*) FROM dbo.Category;", _
sourceConnection)
Dim countStart As Long = _
System.Convert.ToInt32(commandRowCount.ExecuteScalar())
Console.WriteLine("Starting row count = {0}", countStart)

' Get data from the source table as a SqlDataReader.
Dim commandSourceData As SqlCommand = New SqlCommand( _
"SELECT * " & _
"FROM Category;", sourceConnection)
Dim reader As SqlDataReader = commandSourceData.ExecuteReader

' Open the destination connection.
Using destinationConnection As SqlConnection = _
New SqlConnection(connectionString2)
destinationConnection.Open()

' Set up the bulk copy object.
' The column positions in the source data reader
' match the column positions in the destination table,
' so there is no need to map columns.
Using bulkCopy As SqlBulkCopy = _
New SqlBulkCopy(destinationConnection)
bulkCopy.DestinationTableName = _
"Category"

Try
' Write from the source to the destination.
bulkCopy.WriteToServer(reader)

Catch ex As Exception
Console.WriteLine(ex.Message)

Finally
' Close the SqlDataReader. The SqlBulkCopy
' object is automatically closed at the end
' of the Using block.
reader.Close()
End Try
End Using

' Perform a final count on the destination table
' to see how many rows were added.
Dim countEnd As Long = _
System.Convert.ToInt32(commandRowCount.ExecuteScalar())
Console.WriteLine("Ending row count = {0}", countEnd)
Console.WriteLine("{0} rows were added.", countEnd - countStart)

Console.WriteLine("Press Enter to finish.")
Console.ReadLine()
End Using
End Using
End Sub
End Class

|||

Although I would have liked to have gotten the app approach to work so that I could learn more, the practical solution to my problem is the free Database Publishing Wizard provided by Microsoft. Amongst the various options it provides is one that creates a sql file with complete insert query for all the data in the db, etc. Thanks for the input which has gotten me thinking about new possibilities for future projects.

How to create full text index by SQL Server Express?

Hi all..

I tried too much to create FULL TEXT INDEX by using SQL Server 2005 Management Studio Express, it returns this ERR MSG:

Informational: No full-text supported languages found.

Informational: No full-text supported languages found.

Msg 7680, Level 16, State 1, Line 1

Default full-text index language is not a language supported by full-text search

This problem dos not come when I use Microsoft SQL Server 2005 Management Studio, to create FULL TEXT INDEX!

My DB collation is: "Arabic_CI_AS"

But I don’t need this, I can use English Language.

Please, what can I do?

Full Text Indexing is not available in the 'basic' SQL Server 2005 Express.

You must download and install SQL Server 2005 Express Edition with Advanced Services.

Overview

Microsoft SQL Server 2005 Express Edition with Advanced Services (SQL Server Express) is a new, free, easy-to-use version of SQL Server Express that includes a new graphical management tool and powerful features for reporting and advanced text-based searches. SQL Server Express provides powerful and reliable data management tools and rich features, data protection, and fast performance. It is ideal for embedded application clients, light Web applications, and local data stores.

SQL Server Express with Advanced Services has all of the features in SQL Server 2005 Express Edition, plus you can:

Easily manage and administer SQL Server Express with a new easy-to-use graphical management tool -- SQL Server 2005 Management Studio Express (SSMSE).

Issue full-text queries against plain character-based data in SQL Server tables. Full-text queries can include words and phrases, or multiple forms of a word or phrase.

Run SQL Server Reporting Services reports on local relational data.|||

Of course I'm using sql server with advanced edition, and this problem appears only with it, you may see this URL:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1109200&SiteID=1

In that URL there is no correct answer, so he changed his mind, and as I think, decided to use SQL- Server 2005 Trial instead of (SQL SERVER EXPRESS ADV).

However; as we (me & my friend Ibrahim) understood this ERR message:

Informational: No full-text supported languages found.

Informational: No full-text supported languages found.

Msg 7680, Level 16, State 1, Line 1

Default full-text index language is not a language supported by full-text search

My friend thought that the correct question is about: how to add languages to support full-text, so he wrote the other question as a correction to this one, not as a repetition.

Thank you very much.

|||


See the follwing links for clarification:

default full-text language Option
"The default value of this option is the language of the server."
http://msdn2.microsoft.com/en-us/library/ms180854.aspx

Setting Server Configuration Options

http://msdn2.microsoft.com/en-us/library/ms189631.aspx


sys.fulltext_languages (Transact-SQL)
http://msdn2.microsoft.com/en-us/library/ms176076.aspx

Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

Hi…

When I execute this query:

select * from sys.fulltext_languages

It returns 0 rows, nothing…

Also when I tried to update sys.fulltext_languages or sys.configurations by using UPDATE or sp_configure it returns this msg:

Ad hoc update to system catalogs is not supported

Also when I tried to enable 'allow updates' it returns same error msg.

Any way, thank you so much…

I will buy SQL Server 2005 Developer edition.

Thank you.

sql

How to create databases in SQL Express

Autofreak wrote:

Hi All,

I have installed the SQL Server 2005 Express edition and its running fine.

I like to connect to the server and create database. Should I do it

through command prompt only or any tool is available like

Enterprise manager for this ?

You can use SQL Server Express Managment Studio which can be downloaded from here:

http://msdn.microsoft.com/vstudio/express/sql/download/


HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Wednesday, March 21, 2012

How to create an installer for deploying Sql Server Express

Hi,

I have created an installer for deploying Sql Server Express. My installer will start the process of installing Sql Server Express. However the installation of SqlServer Express will fail because it says another installer is currently running (which is my installer). Is there anyway to work around this problem?

The reason why I would like to create an installer for the installation of Sql Server Express is because I would like to configure the SqlServerExpress without the user fiddling with the ini file.

Thanks

Theses sources should help:

SQL Server 2005 UnAttended Installations
http://msdn2.microsoft.com/en-us/library/ms144259.aspx
http://msdn2.microsoft.com/en-us/library/bb264562.aspx
http://www.devx.com/dbzone/Article/31648

Deploy Database with MSI
http://msdn.microsoft.com/msdnmag/issues/04/09/customdatabaseinstaller/

Deploy Database with Application

http://www.codeproject.com/useritems/Deploy_your_database.asp

How to create Add Inn for SSMS Express Edition ?

How to create Add In for SSMS non-Express is clear.

How to do it for Express?

Thank you.

I don't believe that SSMSE is as extensible as the 'paid' editions.

|||

Ocherk wrote:

How to create Add In for SSMS non-Express is clear.

How is this clear? Microsoft doesn't support this and it's not officially documented any where. :-)

Ocherk wrote:

How to do it for Express?

Management Studio Express could be locked down more than Management Studio since we distribute it differently.

For either SSMS or SSMS Express, Microsoft does not recommend using undocumented and unsupported features.

Samples like this: http://www.codeproject.com/useritems/enisey.asp could break at any time.

We are still using the Visual Studio shell for our next release, SQL Server codename 'Katmai'.

Paul A. Mestemaker II

Program Manager

Microsoft SQL Server Manageability

http://blogs.msdn.com/sqlrem/

Monday, March 19, 2012

how to create a sql database in the server?

Hi,

I want to create a new database in the server using SQL express,not in the local machine. so what can I do?

Thank you

hi,

databases are always created on the server machine and not in the eventual "remote clients"..

just perform a CREATE DATABASE dbName; statement

regards

|||thank you.
but I want to know where the location is after performing this statement: CREATE DATABASE dbName. in the server? Do I need to connect to the server using express first?
|||

hi,

dophine wrote:

thank you.
but I want to know where the location is after performing this statement: CREATE DATABASE dbName. in the server?

yes... traditionally in the

C:\Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\Data

folder...

Do I need to connect to the server using express first?

yes as no statement can be executed if not against a SQL Server instance...

regards

|||

HI,

as stated you may find it in Drive:\Program Files\Microsoft SQL Server\MSSQL\Data

and after login in SQL Server you may run sp_helpdb yourdbname , which will gives you detail of the data/log files .

Hemantgiri S. Goswami

|||

Hi all,

When I try to connect to the server using sql express, I cannot find the name of the server instance. So does it mean the sql express should be installed in the server?

Thank you

|||

Hi,

by dfault SQL Express creats named instance so your SQL Server's name would be yourpcname\sqlexpress. And to connect to SQL Server it must be installed in your system or another system on network to get connected.

Hemantgiri S. Goswami

|||

Hi

when I open the SQL express and browser the network servers, there are some server instances. That means the SQL can connect to the remote machine, right? However, I cannot find the server instance I want. And I try to connect to the server by typing the command in the command promt. The following message shown.

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

Thank you.

|||

HI,

Yes it can connect to remote machine but ensure that Remote Connections are enabled for Named Piped and TCP/IP under Surface Area Configuration ,

refer below KBs for more

http://support.microsoft.com/kb/905618 & http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx

HTH

Hemantgiri S. Goswami

|||

Hi,

I would like to know whether one of the causes of such error is that sql express is not installed in the network server side.

Thank you.

|||

hi,

this exception is always raised when a connection can not be established with the "target server", be it local or remote..

causes could be a mispelling of the instance name or incomplete name in case of named instance (ServerName\InstanceName), as long as additional network problems, or even the network protocols not being enabled for the remote instance...

obviously the computer you are connecting to has to have a SQL Server/SQLExpress instance installed...

regards

How to create a RTF field ?

How can I save the text of a rich text box in a sql express 2005 datatable ?

Of course I'd like to save the string and the format of the text (bold, color etc...).

Which column type I have to use for this RTF field ?

Thank you.

hi,

I'd guess nvarchar(MAX)

this data type can host up to 2gb of text data, in national format thus including chars other than the ones present in the traditional alphabet, like chinese, cyrillic and the like..
http://msdn2.microsoft.com/en-us/library/a1904w6t.aspx
http://msdn2.microsoft.com/en-us/library/ms186939.aspx

http://msdn2.microsoft.com/en-us/library/ms187752.aspx for the complete list of supprted data types..

regards

|||

hi,

Thank you for your response.

In fact, my problem was I directly bind the text property and not the Rtf property of my rich text box to the sql field.

It's strange that the Rtf property is not available for binding in the designer so I have to code the binding !

Me.RichTextBox1.DataBindings.Add(New System.Windows.Forms.Binding("Rtf", Me.TbTextBindingSource, "colText", True))

But now it's working !

regards

Monday, March 12, 2012

How to create a new schema

How can I create a new schema inside a database from Managment studio express.

Also can someone explain me the concept of schema clearly. If database is like a house, then is schema like a room in it ?

if you use the metaphor House, you could say that the house is the database, the appartments are the schemas, though they can be owned by someone on have kinds of objects in them (tables, views --> rooms). If the owner of the appartment or the actual person who rent the appartment wants to quit the contract, you will first have to find another owner / contract partner vefore moving out of the appartment.

http://msdn2.microsoft.com/en-us/library/ms190387.aspx

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Thanks. Have another question. When we create a new schema is some part of database memory allocated to it and hence having too many schemas... leads to memory fragmentation problems and hence not efficient ?

how to create a mdf db with sql server 2005 ctp?

hi,

i have installed the sql server 2005 ctp cause i couldn't install the sql server 2005 express on my computer. when i now create a database under the sql server 2005 management studio and connect from vs 2005 beta1 everything works fine for me.

but i want to create and work with the single mdf files wich are created by sql server express edition via ADD NEW ITEM -> DATABASE -> DB.MDF .

is it possible to create such a db file for xcopy deploayment use?

thanks
Yavuz BogazciYavuz,

The functionality you speak of is only available with SQL Server Express. What problems did you encounter while installing Express?

Dan

How to create a login userid and password for Ms SQL Server 2005 Express?

My PC is Window XP Pro and I'm using Microsoft SQL Server 2005 Express and Microsoft SQL Server Management Studio Express.

My question is how to create a login userid and password under "SQL Server Authentication"? (as shown inhttp://www.findingsteve.net/print_screen.jpg)

Any tutorial about this I can read?

by using

Aspnet_regsql.exe
and here how to use ithttp://msdn2.microsoft.com/en-us/library/ms229862(VS.80).aspx
 

hope this well help

|||

Hi mobi88, thanks for the reply.

Just wondering is your way the only way to create a user account for "SQL Server Authentication"?

Can that be done in Microsoft SQL Server Management Studio Express? Sorry if I ask stupid question. I just have no idea how it works.

When I choose "Window Authentication", I don't need to key in any username and password. So, I press Connect. And I went to "Security" > "Logins" to create a user id. Then, I went to login using that user id but it doesn't work. It says,

Cannot connnect to ...

Additional information:
--> Login failed for user 'xxx'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)

Any guide?

|||

sorry for the misunderstanding. the aspnet_regsql is to create the membership tables in side you database; now i think you have a problem with making connection with the DB. here if you want to connect with the DB with a user that you defined you must add this user your DB security directory, and give that user the permissions to connect and write to DB ( you might give the user DBOWNER permission, as you like) and after that you can connect your db with that user id as trusteed connection (for more information) when you use the windows authentication, you will be known as trusted user and the connection will be opened directly because your machine is a trusted user over the sql server!!.

to add a user to your db go to the security folder under the root of your sql server and add a new user there. and at the same screen from the user maping you can assign the new user to the DB's that you want and give the needed permissions

hope that will help.

|||

I tried to do so but still can't. i even tried a user called "sa" but also received the same error mesg. Do I need to do anything with "Server type" and "Server name"?

Currently, my "Server type" is "Database engine" and my "Server name" is "ABC/SQLEXPRESS". ABC is my computer name.

Edited note: Thanks for the link. I already have my connection string in my web.config. Now, I just need to know how to create the userid I key in in web.config in SQL Server 2005.

|||

the connection string must look like this

<connectionStrings>
<add name="PolKitap.Properties.Settings.mylibraryConnectionString"
connectionString="Server=.\SQLEXPRESS;Database=pollibDB;Uid=username;Pwd=password;"
providerName="System.Data.SqlClient" />
</connectionStrings>

but you must make sure that the user is assigned to the db as DBOWNER. and how to add new user to the db;

checkthis site

hope this will help this time :D

|||

I think I still can't get it. But, thanks for all your help.Smile

Friday, March 9, 2012

How to create a copy of SQL Server 2000 database in SQL Server 2005 Express?

I have a database called 'DB1' in SQL Server 2000. I want to create the same database in SQL Server 2005 Express including the original data in tables.

How would I do that? I cannot find any option to do this upgrade in SQL Server Management Studio.

Check out this:

How to: Upgrade to SQL Server 2005 with the Copy Database Wizard

|||

The article you mentioned does not apply to the 2005 Express Edition. The Management Studio for the Express Edition contains no Copy database option that the above article mentions.

I think there is NO tool for doing this upgrade for Express Edition of SQL: Server 2005.

|||

Hi,

Just want to create a copy of SQL Server 2000 database in 2005 ? Why don't you backup you database in SQL Server 2000 and restore it in SQL Server 2005.

Thanks.

|||

Hi,

As mentioned above you can backup ur database and then restore it in SQL 2005.

PLease have a look at this article which explains the steps for backup and restore:

http://www.sqlteam.com/article/backup-and-restore-in-sql-server-full-backups

Please let me know if you have any queries.

Wednesday, March 7, 2012

How to creat a first DB?

Hello all,

I've Installed VS2005 and MSSQL express with it. I used to work with mssql 2003 enterprise edition where it had "Enterprise Manager" from which I could create and modify my Databases.

How do I creat a new database with MSSQL express?

I've tried to do this via visual studio 2005 "server explorer". I"m entering the "Create new SQL Server Database" dialog, I select my server's name and my new database name and I recive an error message which says "An error has occurred while estabilishing a connection to the server" and it also says that

"When connecting to SQL server 2005, this failure may be caused by the fact that under the defult settings SQL sever does not allow remote connections".

How do configure my MSSQL express to allow the remote connection?

Thanks in advance!

With the new SQL 2005 systems you need to use the new Management Studio to perform the same tasks as the Older Enterprise Manager and Query tools. With the full versions this is included, for the basic express product you can get a smaller version from the Microsoft Downloads site, Called SQL Management Studio Express.

In the case of remote connections have a look at this support article... http://support.microsoft.com/default.aspx/kb/914277

|||

How to configure SQL Server 2005 to allow remote connections

http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277

|||Thanks a lot guys :)|||


Hi,

also have a look at the screencast section on my site, which will show you a walkthrough for your problem.


HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

Friday, February 24, 2012

How to cosolidate databases of SQL Express from multiple installations?

1. install a SQL Express instance such as myexpress;

2. create some databases with tables such as db1 and db2;

3. Reinstall SQL Express with the same instance name "myexpress". I assume we need reinstall SQL Express myexpress again becuase of bad operations.

4. Open the myexpress by management tool but I can not see db1 and db2 databases but the datafiles and logfiles are in the data directory.

The question is what I need to do so I can consolidate exited databases so they can be seen in "myexpress" instance by management tool?

hi,

WhyHere wrote:

1. install a SQL Express instance such as myexpress;

2. create some databases with tables such as db1 and db2;

3. Reinstall SQL Express with the same instance name "myexpress". I assume we need reinstall SQL Express myexpress again becuase of bad operations.

4. Open the myexpress by management tool but I can not see db1 and db2 databases but the datafiles and logfiles are in the data directory.

The question is what I need to do so I can consolidate exited databases so they can be seen in "myexpress" instance by management tool?

reinstalling the database engine will actually overwrite your used master database... the master database contains the "registration" of each user database so that the "clean" master does not include those registrations... you can re-attach your existing database files via the

CREATE DATABASE xxx

ON (FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\xxx.mdf'

)

FOR ATTACH ;

statement... please have a look at http://msdn2.microsoft.com/en-us/library/ms176061.aspx for further info about it's synopsis... this will result re-registering a database from it's physical files...

BTW, overwriting the master database will also clean-up all logins information about all SQL Server and Windows NT principals.. associated (for SQL Server standard logins only) database users must also be cleaned/syncronized, for each user, via the sp_change_users_login system stored procedure, as reported in http://msdn2.microsoft.com/en-us/library/ms174378.aspx..

regards

Sunday, February 19, 2012

How to copy sql express tables & stored procedures into remote full sql server 2005

Hi all,

I am using Visual web developper 2005 with sql server express 2005 and i have also sql server management studio express. it's all free now .

my web site is ready

I didn't have problem to upload my site to my hoster.

Now I want to upload all my tables and my stored procedure create locally with VWD express

How can i do it ?

NB: I know i can't design DB (create/modify tables and stored proc) with express edition

thank's for your help

Hi all,

I have my all tables and stored procedures on the remote server and my site is working well but it was very hard to.

let me resume SSMSE steps for tables:

1. Connect to local server

2. Connect to remote server

3. Create Sql file by using "Script out Create " command on the local table

4. Change connection from local to remote

5. execute your sq file to create table on the remote DB

6. Open table on remote DB

7. Open table on local DB

8. use copy/paste to copy rows from local to remote

you must do it for all table including aspnet tables when you use features like menbership, roles profiles and personalization

for stored procedures no steps 6 7 8 and you must change the name of the databases on thesql file

How to copy local sql express DB to remote full sql server 2005

Hi guys,

I am using Visual wev developper 2005 with sql server express 2005 and i have also sql server management studio express. it's all free now .

my web site is ready

I didn't have problem to upload my site to my hoster.

Now I want to upload all my tables and my stored procedure create locally with VWD express

How can i do it ?

thank's for your help

Hi all,

I have my all table on the remote server but it was very hard to.

let me resume SSMSE steps:

1. Connect to local server

2. Connect to remote server

3. Create Sql file by using "Script out Create " command on the local table

4. Change connection from local to remote

5. execute your sq file to create table on the remote DB

6. Open table on remote DB

7. Open table on local DB

8. use copy/paste to copy rows from local to remote

you must do it for all table including aspnet tables when you use features like menbership, roles profiles and personalization

How to Copy DataBases between SQL Express instances.

I am developing an application that uses SQL Server Express. Everything is running great, except that I can't figure out how to copy a DataBase from my server at work onto my laptop so that I may test it at home...

How can I copy the DataBase from my Server at work to my laptop? I'm on the network at work, I just can't figure out how to copy it...

Please help! :)

Thanks,

Jacob
Look up detach database in Books On Line, sp_detach_db and sp_attach_db|||Do I need SQL Server 2005 (not express) to do this through the management studio?

I'm not going to mess with doing this myself, I want the software to do it.
|||

I don't have SSMS-E installed but right click on the database and see if you have a detach option, or an All tasks|Detach Option.

If you do, take it, once the file is detached just copy the foo.mdf and foo.ldf to the new server, then right click and select attach.