Showing posts with label learning. Show all posts
Showing posts with label learning. Show all posts

Wednesday, March 7, 2012

BETWEEN LAPTOP AND DESKTOP

Hi,

I want to jumpstart my learning of SQL Server so I downloaded the Express edition onto my desktop in the office and also onto my laptop. I usually connect the two machines (through a LAN) to update whatever I was able to do at home while in the office.

What should I do in order to view or edit whatever I started on the laptop from the desktop? Would the databases I create on one be accessible through the other machine for editing and the likes?

Glint.

hi Glint,

you first need connectivity.. if that has to be performed at work, this is not a problem, as you just plug the office lan cable and you are on..

actually you do not need SQLExpress to be installed at all in the desktop pc as your "server" is located in the laptop.. so you just need to (remotely) connect from desktop (client) to the laptop (server)..

SQLExpress installs by default disabling network connections, so you need to run the Surface Area Configuration tool to enable "remote connections" and run SQL Server Configuration Manager to verify the desired network protocol is enabled..

you can then "connect" to your laptop server providing the appropriate credentials.. (by default SQLExpress installs allowing only WinNT authenticated connections, but you can modify that behaviour at "run time" to accept standard SQL Server authenticated connections (providing userid and password) modifying a Windows registry key,
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer
LoginMode = 2
where MSSQL.1 identifies your "engine number".. if you only installed 1 instance MSSQL.1 should be ok... or, you can download (recommended anyway) the SQL Server Management Studio Express, the "official" GUI based management tool for SQLExpress, from http://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en, and connect via a trusted connection witl administrators permissions, select the server node, access it's properties and modify the "Server authentication" properties (Security tab) to "SQL Server and Windows Authentication mode"..

but this does not "copy or sync" your laptop "databases" to the office desktop.. if you need it to (copy), you have to "detach" the database you are interested wih, copy the relative physical files to the desktop, and attach the database there (see http://msdn2.microsoft.com/en-us/library/ms190794.aspx and http://msdn2.microsoft.com/en-us/library/ms187858.aspx for further info).. the very same task can be performed via a backup+restore action.. you backup a database (full backup) on the "server", copy the backup file to the destination machine, and restore there the database, http://msdn2.microsoft.com/zh-cn/library/9st0dc24.aspx

so you have the choice to "copy" your homework to the office pc, eventually work on it and finally re-copy all to the laptop for further homeworks, or just always connect to your laptop for office work as well..

please consider downloading Books On Line (BOL), the official and primary help resource for SQL Server at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx..

regards

|||Thanx, Andrea.

BETWEEN LAPTOP AND DESKTOP

Hi,

I want to jumpstart my learning of SQL Server so I downloaded the Express edition onto my desktop in the office and also onto my laptop. I usually connect the two machines (through a LAN) to update whatever I was able to do at home while in the office.

What should I do in order to view or edit whatever I started on the laptop from the desktop? Would the databases I create on one be accessible through the other machine for editing and the likes?

Glint.

hi Glint,

you first need connectivity.. if that has to be performed at work, this is not a problem, as you just plug the office lan cable and you are on..

actually you do not need SQLExpress to be installed at all in the desktop pc as your "server" is located in the laptop.. so you just need to (remotely) connect from desktop (client) to the laptop (server)..

SQLExpress installs by default disabling network connections, so you need to run the Surface Area Configuration tool to enable "remote connections" and run SQL Server Configuration Manager to verify the desired network protocol is enabled..

you can then "connect" to your laptop server providing the appropriate credentials.. (by default SQLExpress installs allowing only WinNT authenticated connections, but you can modify that behaviour at "run time" to accept standard SQL Server authenticated connections (providing userid and password) modifying a Windows registry key,
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer
LoginMode = 2
where MSSQL.1 identifies your "engine number".. if you only installed 1 instance MSSQL.1 should be ok... or, you can download (recommended anyway) the SQL Server Management Studio Express, the "official" GUI based management tool for SQLExpress, from http://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en, and connect via a trusted connection witl administrators permissions, select the server node, access it's properties and modify the "Server authentication" properties (Security tab) to "SQL Server and Windows Authentication mode"..

but this does not "copy or sync" your laptop "databases" to the office desktop.. if you need it to (copy), you have to "detach" the database you are interested wih, copy the relative physical files to the desktop, and attach the database there (see http://msdn2.microsoft.com/en-us/library/ms190794.aspx and http://msdn2.microsoft.com/en-us/library/ms187858.aspx for further info).. the very same task can be performed via a backup+restore action.. you backup a database (full backup) on the "server", copy the backup file to the destination machine, and restore there the database, http://msdn2.microsoft.com/zh-cn/library/9st0dc24.aspx

so you have the choice to "copy" your homework to the office pc, eventually work on it and finally re-copy all to the laptop for further homeworks, or just always connect to your laptop for office work as well..

please consider downloading Books On Line (BOL), the official and primary help resource for SQL Server at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx..

regards

|||Thanx, Andrea.

Saturday, February 25, 2012

better table management (partitions?)

Hi,

For my work I am now learning Sql server 2005 and I have been given a database that has been set up by someone else to work with. It is my job to get the database ready for use in reports.

My problem is that the current database has one huge table with almost 8GB of data. The table contains data from 2004 to present (and growing) from 14 different countries. The reports we use are mostly per country, but we also want to compare the 14 countries to eachother for say, whole 2006. At the moment the table is stored in one single file instead of using partitions.

I believe partitions can give a good performance boost when running the queries. But how do I do this? Currently the country codes are just plain text, can they be used for partitions?

Any advice would be welcome,

Thanks!

It sounds like you could benefit from partitioning. You can learn more here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/sql2k5partition.asp

If this post answers your question, make sure you mark it "answered" so others can find it quickly.

Thanks -

Buck Woody
http://www.buckwoody.com

|||

Thanks for your reply.

The table has over 5 million records and is still growing, so partitioning seems nice.

However, they are using SQL 2005 standard edition, while only enterprise can use partitioning.

Are there any other ways to make the queries run faster?

|||

Use the Database Tuning Advisor in SQL Server 2005 to see if there are any changes you can make to help. There's a full article about that here:

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

Buck Woody