Monday, March 19, 2012
need solution for change file path
i would like to ask some question about MS SQL 2000 Server.
recall: during the installation, for the setup type, there's one setting for
the destination folder for (1) program files and (2)data files
i need a solution for:
during the installation, if the user pin point the path to default
<<DRIVE>>:\program files\mssql...
now i am having a new partition for the HDD, how can i switch MSSQL ordinary
data files path directory pin point to another directory?
example : from default data files path directory c:\mssql to e:\mssql?
thank youyk.ngYou can set a new database default location by selecting the server
properties, database settings tab and update the data and log directories on
the new database default location section.
Ben Nevarez, MCDBA, OCP
Database Administrator
"zouky" wrote:
> greeting,
> i would like to ask some question about MS SQL 2000 Server.
> recall: during the installation, for the setup type, there's one setting for
> the destination folder for (1) program files and (2)data files
> i need a solution for:
> during the installation, if the user pin point the path to default
> <<DRIVE>>:\program files\mssql...
> now i am having a new partition for the HDD, how can i switch MSSQL ordinary
> data files path directory pin point to another directory?
> example : from default data files path directory c:\mssql to e:\mssql?
> thank youyk.ng
>
>
need solution for change file path
i would like to ask some question about MS SQL 2000 Server.
recall: during the installation, for the setup type, there's one setting for
the destination folder for (1) program files and (2)data files
i need a solution for:
during the installation, if the user pin point the path to default
<<DRIVE>>:\program files\mssql...
now i am having a new partition for the HDD, how can i switch MSSQL ordinary
data files path directory pin point to another directory?
example : from default data files path directory c:\mssql to e:\mssql?
thank youyk.ngYou can set a new database default location by selecting the server
properties, database settings tab and update the data and log directories on
the new database default location section.
Ben Nevarez, MCDBA, OCP
Database Administrator
"zouky" wrote:
> greeting,
> i would like to ask some question about MS SQL 2000 Server.
> recall: during the installation, for the setup type, there's one setting f
or
> the destination folder for (1) program files and (2)data files
> i need a solution for:
> during the installation, if the user pin point the path to default
> <<DRIVE>>:\program files\mssql...
> now i am having a new partition for the HDD, how can i switch MSSQL ordina
ry
> data files path directory pin point to another directory?
> example : from default data files path directory c:\mssql to e:\mssql?
> thank youyk.ng
>
>
Need simple connect/SQL Select in aspx.vb
I have searched for what I think is a simple solution.
In my aspx.vb code page, I need to make a connection to SQL Server (my connection strings are in the web.config file) and then make a simple SQL Select to return one or 2 values.
For example, the user will select a customer on the ASP form, then I need to read a couple of default values from that user's record and display them back onto the form.
Can someone provide the sample code or direct me to this? I'm thinking that this is rather simple, but I can't seem to make it work. If I see a sample of exactly what I need to do, such as reading a value using the Northwind sample DB, then I can modify it to fit my table structure, etc.
Thank you.
Hi,
Here is a sample code that you can run on a web form which reads an Id value from a textbox and then returns the firstname and lastname of the customer.
PrivateSub Button5_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles Button5.ClickDim sqlConnectionStringAsString = System.Configuration.ConfigurationSettings.AppSettings.Get("ConnectionString")Dim sqlConnectionAs SqlClient.SqlConnection =New SqlClient.SqlConnection(sqlConnectionString)Dim sqlCommandAs SqlClient.SqlCommand =New SqlClient.SqlCommand("SELECT FirstName, LastName FROM Customers Where CustomerId = @.CustomerId")Dim sqlParamAs SqlClient.SqlParameter =New SqlClient.SqlParameter("@.CustomerId",CInt(txtCustomerId.Text))sqlCommand.Parameters.Add(sqlParam)
sqlCommand.Connection = sqlConnection
sqlConnection.Open()
Dim drAs SqlClient.SqlDataReaderdr = sqlCommand.ExecuteReader(CommandBehavior.CloseConnection)
While dr.ReadtxtFirstName.Text =
CType(dr.GetValue(dr.GetOrdinal("FirstName")),String)txtLastName.Text =
CType(dr.GetValue(dr.GetOrdinal("LastName")),String)EndWhiledr.Close()
EndSub
You can use the below line of code to get the connection string from the web.config file
System.Configuration.ConfigurationSettings.AppSettings.Get("ConnectionString")
You should have placed the below configuration declaration within the configuration tags (<configuration></configuration>)
<appSettings><addkey="ConnectionString"value="..."/></appSettings>
Eralper
http://www.kodyaz.com
|||
How come my intellisense does not automatically pop-up the wording 'SqlClient...' in my dim statements. Nothing seems to be wrong with my set up as I have been working fine for months, but now that I am trying to ad-hoc querries I don't have access to these facilities..
Dim sqlConnectionAsSqlClient.SqlConnection =New SqlClient.SqlConnection(sqlConnectionString)Dim sqlCommandAsSqlClient.SqlCommand =New SqlClient.SqlCommand("SELECT FirstName, LastName FROM Customers Where CustomerId = @.CustomerId")Dim sqlParamAsSqlClient.SqlParameter =New SqlClient.SqlParameter("@.CustomerId",CInt(txtCustomerId.Text))
|||
Never mind, I just had to add
Imports System.Data
Imports System.Data.SqlClient
need short term solution - long term solution on hold
i've been trying to set up a long term solution replicating data from
our production database into our development and staging environments.
from what i've seen, the simplest way to do this is to restore from
back up. unfortunately the production devices are on a remote network,
and i'm still trying to setup the necessary vpn connectivity between
them to do this restore-from-backup replication method.
in the mean time however, i do need some production data in the local
environments. the two instances can communicate on port 1433 just fine,
so what method would you guys recommend for getting a whole database
copied over to another server? the only real requirement is no downtime
on the production server. also, the server is currently spiking up to
about 25% max cpu, if possible i'd like a solution that doesn't bring
it to its knees.
don't want to merge data or transform anything. just want the entire
database (tables, procedures, keys, constraints, data) copied from one
server to another.
thanks for any suggestions,
jason
Jason,
as you want the entire database, presumably on a regular basis and taking
account of changes to all objects, there's no easy solution to this using
replication. EG replication won't take all the objects in a database -
several parts of the database catalog are not replicated. So, typically
log-shipping is used to solve this issue. This could be set up manually or
using the wizards. In the absence of a VPN the files could be transferred
using FTP and then moved and restored
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||actually, i don't need it on a regular basis. for now i just need a
single image, which doesn't even have to be transactionally-up-to-date.
just something from the past "short while" would be adequate, and it
could be one-time only.
does that open up any easier possibilities?
|||In that case I'd zip up the backup, FTP it, unzip and restore.
Cheers,
Paul Ibison