Showing posts with label connecting. Show all posts
Showing posts with label connecting. Show all posts

Sunday, March 25, 2012

Authentication to SQL Server in ASP on Active Directory

I would like to be able to autheticate users connecting to SQL Server in
Active Server Pages on MS Active Directory.
Is this possible? If so, how?
Thank you.
AAAHi,
then you have to Map AD user account / group to sql server then you are
able to do it . please refer sp_adduser for more information it can be done
very well using this sp it is used to map those Windows (AD) accounts to SQL
and then use it in you ASP connection string. What is your Authentication
mode ?!
--
Andy Davis
Active Crypt Team
---SQL Server Encryption
Decryption Software
http://www.activecrypt.com
"AuntieAuntieAuntie" wrote:

> I would like to be able to autheticate users connecting to SQL Server in
> Active Server Pages on MS Active Directory.
> Is this possible? If so, how?
> Thank you.
> AAA|||Hi Andy,
This is the situation, (we can add users) but, not Domain Accounts that
belong to Domain Groups without a password on the connection string, within
an ASP on Active Directory, this is my current connection string:
<%
Dim strDatabaseType, objConn, cst
cst = "Provider=SQLOLEDB;data source=Z0123456;" &_
"Database=myDatabase;User ID=99;password=XXXXXXX;"
Set objConn = Server.CreateObject("ADODB.Connection")
%>
We would like to use a Domain Account as the userID without the password on
this connection string. On the database side, this account belongs to a
Domain Group, that has access to the database, it this possible? How can we
accomplish it?
AAA
"Andy Davis" wrote:
[vbcol=seagreen]
> Hi,
> then you have to Map AD user account / group to sql server then you are
> able to do it . please refer sp_adduser for more information it can be don
e
> very well using this sp it is used to map those Windows (AD) accounts to S
QL
> and then use it in you ASP connection string. What is your Authentication
> mode ?!
> --
> Andy Davis
> Active Crypt Team
> ---SQL Server Encryption
> Decryption Software
> http://www.activecrypt.com
>
> "AuntieAuntieAuntie" wrote:
>|||Hi,
We are using Windows Authentication for this applicaton.
AAA
"Andy Davis" wrote:
[vbcol=seagreen]
> Hi,
> then you have to Map AD user account / group to sql server then you are
> able to do it . please refer sp_adduser for more information it can be don
e
> very well using this sp it is used to map those Windows (AD) accounts to S
QL
> and then use it in you ASP connection string. What is your Authentication
> mode ?!
> --
> Andy Davis
> Active Crypt Team
> ---SQL Server Encryption
> Decryption Software
> http://www.activecrypt.com
>
> "AuntieAuntieAuntie" wrote:
>

Thursday, March 22, 2012

Authentication mode, connecting from webpage

Hello,
I need help setting up SQL Server Express edition.
What I did so far:
1) Downloaded and installed it with windows authentication
2) Installed SQL Server Management Studio Express
3) Created a database
4) Realized I needed SQL Authentication for connecting via php page.
5) Followed these instructions to enable SQL Authentication
Now that SQL Authentication is enabled, how do I create a user account that I can use in php pages to connect to the database?
Thanks,
Kurt

Hey Kurt. See the documentation in Books Online for the following commands:

CREATE LOGIN

CREATE USER

The create login statement will create a user on your server, then run the create user statement to allow that user access to the database(s) on your system.

HTH,

|||Hello,
Ok thanks, I got my user created with the following. I also realized its the same as creating a user in SQL Management Studio Express.
sqlcmd -S .\SQLEXPRESS
1>CREATE LOGIN myuser WITH PASSWORD = 'mypassword';
2>GO
Is there anything else I have to change for php to beable to connect with this user?
Thanks,
Kurt|||

You need to run the CREATE USER command to give the login you just created access to the database(s) you want it to have access to. Then you have to provide the appropriate permissions to that user within the database in question (i.e. select from tables, update tables, delete tables and records, etc., etc.)

|||Hi Chad,
I keep getting an error when I try to connect from a webpage. For the server can I use localhost?
Warning: mssql_connect(): Unable to connect to server: localhost in D:\wwwRoot\db\connect.php on line 18

Thanks,
Kurt

Tuesday, March 20, 2012

authentication error

I've been having a problem connecting to my sql 2000 server database.
The error reads...
Server Error in '/ASP' Application.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for
user 'NT AUTHORITY\NETWORK SERVICE'.
Source Error:
Line 30: //{
Line 31: Response.Write("before the open");
Line 32: objConn.Open();
Line 33: //SQLConnection.Open();
Line 34: //SqlCommand objCmd = new SqlCommand(sql,
objConn);
My web.config file reads:
<configuration>
<appSettings>
<add key="Andrew" value="Data Source=localhost;Initial
Catalog=Andrew;User Id=xxxx;Password=xxxxxxxxx"/>
</appSettings>
<system.web>
<compilation defaultLanguage="C#" debug="true" />
<customErrors mode="Off" />
<globalization requestEncoding="UTF-8" responseEncoding="UTF-8" />
</system.web>
</configuration>
My connection string in my C# file reads...
protected SqlConnection objConn = new
SqlConnection(System.Configuration.ConfigurationSe ttings.AppSettings["Andrew"]);
What I've done so far:
Under security in SQL server I've set up an account with the ID. It
shows type as Standard, Server access as Permit and Default Database as
Andrew.
Under my SQL Server Login Properties I've set the Authentication to
"SQL Server Authentication" and entered the password.
Under the defaults menu I've set the database to Andrew.
Under server roles "System Admins" is checked.
Under the Database Access tab my user ID is assigned to the
"Andrew" database with a checkmark in the permit box.
Database roles for Andrew are set to public and db_owner.
I can't seem to find my way around this error. Any help would be
greatly appreciated!
Thanks,
Andrew
Andrew,
When using ASP.NET the default security contect is the service accoutn that
IIS is running under. This is called using a trusted conneciton. By default
this account is not given access to SQL Server; to resolve this you should
give the correct permissions to SQL Server so the account that IIS is
running under has permissions to access SQL. Your connection is currently
connecting in this mode.
Adding "Integrated Security=false" to your connection string will turn this
feature off (then you should be good to go).
If you are inclined to use Integrated Authentication you should
1. Add Integrated Security=SSPI (and remove the user and password from your
conneciton string)
2. <system.web>
<authentication mode = "windows" />
<identity impersonate="true" />
</system.web>
3. Then open the IIS Admin tool and go to the properties window of where
your application is running. You then choose the Directory Security tab and
uncheck Anonymous & provide the username and password for the user. This
changes the context of the applicaiton to run under your user.
4. Grant the appropriate privilages to the user.
Brad Sarsfield [MSFT] bradsa(at)microsoft.com
This posting is provided "AS IS", with no warranties, and confers no rights.
<andrew.grande@.gmail.com> wrote in message
news:1127878854.885819.309560@.g49g2000cwa.googlegr oups.com...
> I've been having a problem connecting to my sql 2000 server database.
> The error reads...
> Server Error in '/ASP' Application.
> Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
> Description: An unhandled exception occurred during the execution of
> the current web request. Please review the stack trace for more
> information about the error and where it originated in the code.
> Exception Details: System.Data.SqlClient.SqlException: Login failed for
> user 'NT AUTHORITY\NETWORK SERVICE'.
> Source Error:
> Line 30: //{
> Line 31: Response.Write("before the open");
> Line 32: objConn.Open();
> Line 33: //SQLConnection.Open();
> Line 34: //SqlCommand objCmd = new SqlCommand(sql,
> objConn);
>
> My web.config file reads:
> <configuration>
> <appSettings>
> <add key="Andrew" value="Data Source=localhost;Initial
> Catalog=Andrew;User Id=xxxx;Password=xxxxxxxxx"/>
> </appSettings>
> <system.web>
> <compilation defaultLanguage="C#" debug="true" />
> <customErrors mode="Off" />
> <globalization requestEncoding="UTF-8" responseEncoding="UTF-8" />
> </system.web>
> </configuration>
> My connection string in my C# file reads...
> protected SqlConnection objConn = new
> SqlConnection(System.Configuration.ConfigurationSe ttings.AppSettings["Andrew"]);
> What I've done so far:
> Under security in SQL server I've set up an account with the ID. It
> shows type as Standard, Server access as Permit and Default Database as
> Andrew.
> Under my SQL Server Login Properties I've set the Authentication to
> "SQL Server Authentication" and entered the password.
> Under the defaults menu I've set the database to Andrew.
> Under server roles "System Admins" is checked.
> Under the Database Access tab my user ID is assigned to the
> "Andrew" database with a checkmark in the permit box.
> Database roles for Andrew are set to public and db_owner.
> I can't seem to find my way around this error. Any help would be
> greatly appreciated!
> Thanks,
> Andrew
>

authentication error

I've been having a problem connecting to my sql 2000 server database.
The error reads...
Server Error in '/ASP' Application.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for
user 'NT AUTHORITY\NETWORK SERVICE'.
Source Error:
Line 30: //{
Line 31: Response.Write("before the open");
Line 32: objConn.Open();
Line 33: //SQLConnection.Open();
Line 34: //SqlCommand objCmd = new SqlCommand(sql,
objConn);
My web.config file reads:
<configuration>
<appSettings>
<add key="Andrew" value="Data Source=localhost;Initial
Catalog=Andrew;User Id=xxxx;Password=xxxxxxxxx"/>
</appSettings>
<system.web>
<compilation defaultLanguage="C#" debug="true" />
<customErrors mode="Off" />
<globalization requestEncoding="UTF-8" responseEncoding="UTF-8" />
</system.web>
</configuration>
My connection string in my C# file reads...
protected SqlConnection objConn = new
SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["An
drew"]);
What I've done so far:
Under security in SQL server I've set up an account with the ID. It
shows type as Standard, Server access as Permit and Default Database as
Andrew.
Under my SQL Server Login Properties I've set the Authentication to
"SQL Server Authentication" and entered the password.
Under the defaults menu I've set the database to Andrew.
Under server roles "System Admins" is checked.
Under the Database Access tab my user ID is assigned to the
"Andrew" database with a checkmark in the permit box.
Database roles for Andrew are set to public and db_owner.
I can't seem to find my way around this error. Any help would be
greatly appreciated!
Thanks,
AndrewAndrew,
When using ASP.NET the default security contect is the service accoutn that
IIS is running under. This is called using a trusted conneciton. By default
this account is not given access to SQL Server; to resolve this you should
give the correct permissions to SQL Server so the account that IIS is
running under has permissions to access SQL. Your connection is currently
connecting in this mode.
Adding "Integrated Security=false" to your connection string will turn this
feature off (then you should be good to go).
If you are inclined to use Integrated Authentication you should
1. Add Integrated Security=SSPI (and remove the user and password from your
conneciton string)
2. <system.web>
<authentication mode = "windows" />
<identity impersonate="true" />
</system.web>
3. Then open the IIS Admin tool and go to the properties window of where
your application is running. You then choose the Directory Security tab and
uncheck Anonymous & provide the username and password for the user. This
changes the context of the applicaiton to run under your user.
4. Grant the appropriate privilages to the user.
Brad Sarsfield [MSFT] bradsa(at)microsoft.com
This posting is provided "AS IS", with no warranties, and confers no rights.
<andrew.grande@.gmail.com> wrote in message
news:1127878854.885819.309560@.g49g2000cwa.googlegroups.com...
> I've been having a problem connecting to my sql 2000 server database.
> The error reads...
> Server Error in '/ASP' Application.
> Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
> Description: An unhandled exception occurred during the execution of
> the current web request. Please review the stack trace for more
> information about the error and where it originated in the code.
> Exception Details: System.Data.SqlClient.SqlException: Login failed for
> user 'NT AUTHORITY\NETWORK SERVICE'.
> Source Error:
> Line 30: //{
> Line 31: Response.Write("before the open");
> Line 32: objConn.Open();
> Line 33: //SQLConnection.Open();
> Line 34: //SqlCommand objCmd = new SqlCommand(sql,
> objConn);
>
> My web.config file reads:
> <configuration>
> <appSettings>
> <add key="Andrew" value="Data Source=localhost;Initial
> Catalog=Andrew;User Id=xxxx;Password=xxxxxxxxx"/>
> </appSettings>
> <system.web>
> <compilation defaultLanguage="C#" debug="true" />
> <customErrors mode="Off" />
> <globalization requestEncoding="UTF-8" responseEncoding="UTF-8" />
> </system.web>
> </configuration>
> My connection string in my C# file reads...
> protected SqlConnection objConn = new
> SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["
Andrew"]);
> What I've done so far:
> Under security in SQL server I've set up an account with the ID. It
> shows type as Standard, Server access as Permit and Default Database as
> Andrew.
> Under my SQL Server Login Properties I've set the Authentication to
> "SQL Server Authentication" and entered the password.
> Under the defaults menu I've set the database to Andrew.
> Under server roles "System Admins" is checked.
> Under the Database Access tab my user ID is assigned to the
> "Andrew" database with a checkmark in the permit box.
> Database roles for Andrew are set to public and db_owner.
> I can't seem to find my way around this error. Any help would be
> greatly appreciated!
> Thanks,
> Andrew
>

Thursday, March 8, 2012

audit tables, delete triggers, and asp.net

i'm in a bit of a bind at work. if anyone could help, i'd greatly
appreciate it.

i have a web app connecting to a sql server using sql server
authentication. let's say, for example, my login/password is
dbUser/dbUser. the web app however, is using windows authentication.
so if I am logged into the network as 'DOMAIN\Eric', when I access my
web app, my web app knows that I am 'DOMAIN\Eric'. but to the sql
server db, I am user 'dbUser'.

now, i for each table i have, i need to implement an audit table to
record all updates, inserts, deletes that occur against it. i was
going to do so with triggers. this is all fine for selects, inserts,
and updates. for each table, i have an updatedby and an updatedate.

for example, let's say i have a table:

create table blah
(
id int,
col1 varchar(10),
updatedby varchar(30),
updatedate datetime
)

and corresponding audit table:

create audit_blah
(
id int,
blah_id int,
blah_col1 varchar(10),
blah_updatedby varchar(1),
blah_updatedate datetime
)

for update and insert triggers, i can know what to insert into the
updatedby column of audit_blah because it's in a corresponding row in
blah. my web app knows what user is accessing the application, and
can insert that name into blah. blah's trigger will then insert that
name into audit_blah.

however, in the case of a delete, i'm not passing in an 'updatedby',
because i'm deleting. in this situation, how can the trigger know
what user is deleting? the db only knows that sql user 'dbUser' is
deleting, but doesn't know that 'dbUser' is deleting on behalf of
'DOMAIN\Eric'. is there any way for my app to inform the trigger to
access my windows identity without having a corresponding row in the
table from which to pull that info?

obviously, i could have each of my app's users log into SQL server
through Windows authentication; then i could just use SYSTEM_USER.
but let's say, for performance's sake, it'd be better for me to use
one sql server login. (i believe one user works better for connection
pooling purposes.) is there a way to get around this?

(i'm hoping a built-in function exists that solves all my problems.)

suggestions? resources?

any help would be great appreciated.

happy turkeys.

EricHi

You may want to do soft deletes instead (possibly with a garbage collection
job!) or do the deletes through a stored procedure and log them differently.

John
"ecastillo" <encee5@.gmail.com> wrote in message
news:a2f0a8ac.0411252044.5dffaa2@.posting.google.co m...
> i'm in a bit of a bind at work. if anyone could help, i'd greatly
> appreciate it.
> i have a web app connecting to a sql server using sql server
> authentication. let's say, for example, my login/password is
> dbUser/dbUser. the web app however, is using windows authentication.
> so if I am logged into the network as 'DOMAIN\Eric', when I access my
> web app, my web app knows that I am 'DOMAIN\Eric'. but to the sql
> server db, I am user 'dbUser'.
> now, i for each table i have, i need to implement an audit table to
> record all updates, inserts, deletes that occur against it. i was
> going to do so with triggers. this is all fine for selects, inserts,
> and updates. for each table, i have an updatedby and an updatedate.
> for example, let's say i have a table:
> create table blah
> (
> id int,
> col1 varchar(10),
> updatedby varchar(30),
> updatedate datetime
> )
> and corresponding audit table:
> create audit_blah
> (
> id int,
> blah_id int,
> blah_col1 varchar(10),
> blah_updatedby varchar(1),
> blah_updatedate datetime
> )
> for update and insert triggers, i can know what to insert into the
> updatedby column of audit_blah because it's in a corresponding row in
> blah. my web app knows what user is accessing the application, and
> can insert that name into blah. blah's trigger will then insert that
> name into audit_blah.
> however, in the case of a delete, i'm not passing in an 'updatedby',
> because i'm deleting. in this situation, how can the trigger know
> what user is deleting? the db only knows that sql user 'dbUser' is
> deleting, but doesn't know that 'dbUser' is deleting on behalf of
> 'DOMAIN\Eric'. is there any way for my app to inform the trigger to
> access my windows identity without having a corresponding row in the
> table from which to pull that info?
> obviously, i could have each of my app's users log into SQL server
> through Windows authentication; then i could just use SYSTEM_USER.
> but let's say, for performance's sake, it'd be better for me to use
> one sql server login. (i believe one user works better for connection
> pooling purposes.) is there a way to get around this?
> (i'm hoping a built-in function exists that solves all my problems.)
> suggestions? resources?
> any help would be great appreciated.
> happy turkeys.
> Eric|||[posted and mailed, please reply in news]

ecastillo (encee5@.gmail.com) writes:
> however, in the case of a delete, i'm not passing in an 'updatedby',
> because i'm deleting. in this situation, how can the trigger know
> what user is deleting? the db only knows that sql user 'dbUser' is
> deleting, but doesn't know that 'dbUser' is deleting on behalf of
> 'DOMAIN\Eric'. is there any way for my app to inform the trigger to
> access my windows identity without having a corresponding row in the
> table from which to pull that info?

You could use SET CONTEXT_INFO. This command is somewhat tricky to use,
but it's workable. This commands sets the column context_info in
sysprocesses. The value is a binary value. Here is an example:

declare @.bin varbinary(30)
select @.bin = convert(varbinary(30), 'DOMAIN\Eric')
set context_info @.bin
go
select convert(varchar(30), context_info)
from master..sysprocesses where spid = @.@.spid

The web server would do the first part, the trigger the second part.

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Wednesday, March 7, 2012

Audit Logins

We are having an issue with an application connecting to
our database. In order to capture the login failures, I
went into Enterprise Manager properties and went to the
security tab. I then selected that audit level = all,
which to me means it audits all logins. However, when I
connect either correctly or with erros, there is nothing
written to the SQL Server Logs.
I tried to find more info in BOL's but couldn't. Where is
the audit info logged?
I now have a trace set up via profiler, but would still
like to understand why the 'audit level' via enterprise
manager didn't work. (I even ran a reconfig)
Thanks
SusanYou have to stop/restart the sql server service for this to take effect, and
the login failures will be in the SQL Server log.
"Susan" <anonymous@.discussions.microsoft.com> wrote in message
news:8efc01c3e9b9$663bc300$a601280a@.phx.gbl...
> We are having an issue with an application connecting to
> our database. In order to capture the login failures, I
> went into Enterprise Manager properties and went to the
> security tab. I then selected that audit level = all,
> which to me means it audits all logins. However, when I
> connect either correctly or with erros, there is nothing
> written to the SQL Server Logs.
> I tried to find more info in BOL's but couldn't. Where is
> the audit info logged?
> I now have a trace set up via profiler, but would still
> like to understand why the 'audit level' via enterprise
> manager didn't work. (I even ran a reconfig)
> Thanks
> Susan
>

Audit Logins

We are having an issue with an application connecting to
our database. In order to capture the login failures, I
went into Enterprise Manager properties and went to the
security tab. I then selected that audit level = all,
which to me means it audits all logins. However, when I
connect either correctly or with erros, there is nothing
written to the SQL Server Logs.
I tried to find more info in BOL's but couldn't. Where is
the audit info logged?
I now have a trace set up via profiler, but would still
like to understand why the 'audit level' via enterprise
manager didn't work. (I even ran a reconfig)
Thanks
SusanYou have to stop/restart the sql server service for this to take effect, and
the login failures will be in the SQL Server log.
"Susan" <anonymous@.discussions.microsoft.com> wrote in message
news:8efc01c3e9b9$663bc300$a601280a@.phx.gbl...
quote:

> We are having an issue with an application connecting to
> our database. In order to capture the login failures, I
> went into Enterprise Manager properties and went to the
> security tab. I then selected that audit level = all,
> which to me means it audits all logins. However, when I
> connect either correctly or with erros, there is nothing
> written to the SQL Server Logs.
> I tried to find more info in BOL's but couldn't. Where is
> the audit info logged?
> I now have a trace set up via profiler, but would still
> like to understand why the 'audit level' via enterprise
> manager didn't work. (I even ran a reconfig)
> Thanks
> Susan
>

Sunday, February 19, 2012

Attachment Error received

Hi all,
I've just started dabbling with SQL Express (I've an up-coming project and
would like to use it). I had no hassles connecting to the db I created in
VS2005 std but now I want to test connectin to it outside of the inetpub. I
copied the MDF and LDF to another folder on my drive and changed the conn
string to reflect this but I get the following error:
The header for file 'w:\temp\Test.mdf' is not a valid database file header.
The PageAudit property is incorrect.
An attempt to attach an auto-named database for file w:\temp\Test.mdf
failed. A database with the same name exists, or specified file cannot be
opened, or it is located on UNC share.
Clearly something's gone wrong here but what would I need to do to fix this
problem (and be able to connect to SQL Express db's from other folders in
future)?
Regards
John.
Moving the database files and then not being able to attach them is usually
a permissions problem but I've never seen this error. You might try the
copy again - this error sounds like a corrupted file.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"John" <a@.b.c> wrote in message news:uhr9aYCOGHA.916@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> I've just started dabbling with SQL Express (I've an up-coming project and
> would like to use it). I had no hassles connecting to the db I created in
> VS2005 std but now I want to test connectin to it outside of the inetpub.
> I
> copied the MDF and LDF to another folder on my drive and changed the conn
> string to reflect this but I get the following error:
> The header for file 'w:\temp\Test.mdf' is not a valid database file
> header.
> The PageAudit property is incorrect.
> An attempt to attach an auto-named database for file w:\temp\Test.mdf
> failed. A database with the same name exists, or specified file cannot be
> opened, or it is located on UNC share.
> Clearly something's gone wrong here but what would I need to do to fix
> this
> problem (and be able to connect to SQL Express db's from other folders in
> future)?
> Regards
> John.
>
>

Monday, February 13, 2012

attaching DAT files

**** Post for FREE via your newsreader at post.usenet.com ****
Hello,
I have solved my problem with connecting to SQL 6.5. Thank you for
answering.
Still I have two more questions.
I have copied DAT file from one computer with SQL 6.5 and put it to another
computer with SQL 6.5. How can I attach this file to database on second
computer? This file seems to beDatabase Device's file, and this is not a
backup. I have no chances to do a backup from first computer. Only I have is
Dat files from C:\MSSQL\DATA folder. Is there any solution?
And second question. I can see three database devices on my MSSQL 6.5
server. How do I know which device's databases I see?
Thank you.
Darius
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= *** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.usenet.com
Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=You need to use DISK REINIT and DISK REFIT. Read about the commands in Books
Online...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Darius" <darius.ram@.takas.lt> wrote in message
news:40487d61$1@.post.usenet.com...
> **** Post for FREE via your newsreader at post.usenet.com ****
> Hello,
> I have solved my problem with connecting to SQL 6.5. Thank you for
> answering.
> Still I have two more questions.
> I have copied DAT file from one computer with SQL 6.5 and put it to
another
> computer with SQL 6.5. How can I attach this file to database on second
> computer? This file seems to beDatabase Device's file, and this is not a
> backup. I have no chances to do a backup from first computer. Only I have
is
> Dat files from C:\MSSQL\DATA folder. Is there any solution?
> And second question. I can see three database devices on my MSSQL 6.5
> server. How do I know which device's databases I see?
> Thank you.
> Darius
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=> *** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
> http://www.usenet.com
> Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|||Hi,
In SQL 6.5 it is always better to take a DUMP of the database and then copy
it to destination and Load it
1. DUMP DATABASE
2. COPY the DMP file to destination
3. LOAD DATABASE
In SQL 6.5 the commands Tiber mentioned can be used during worst cases,
Normally when master database is damaged and
incomplete master database is incomplete. This case you have the physical
files. Each physical files (DAT files)can be mapped to
sysdevices table using DISK REINIT command. After that run DISK REFIT to
recreate the SYSUSAGES table.
After REFIT stop and start SQL server service.
Thanks
Hari
MCDBA
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OQJeohrAEHA.232@.TK2MSFTNGP10.phx.gbl...
> You need to use DISK REINIT and DISK REFIT. Read about the commands in
Books
> Online...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "Darius" <darius.ram@.takas.lt> wrote in message
> news:40487d61$1@.post.usenet.com...
> > **** Post for FREE via your newsreader at post.usenet.com ****
> >
> > Hello,
> >
> > I have solved my problem with connecting to SQL 6.5. Thank you for
> > answering.
> > Still I have two more questions.
> > I have copied DAT file from one computer with SQL 6.5 and put it to
> another
> > computer with SQL 6.5. How can I attach this file to database on second
> > computer? This file seems to beDatabase Device's file, and this is not a
> > backup. I have no chances to do a backup from first computer. Only I
have
> is
> > Dat files from C:\MSSQL\DATA folder. Is there any solution?
> > And second question. I can see three database devices on my MSSQL 6.5
> > server. How do I know which device's databases I see?
> >
> > Thank you.
> >
> > Darius
> >
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=> > *** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
> > http://www.usenet.com
> > Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=>|||I just want to add that I fully agree with Hari. If you have the option to
use DUMP and LOAD, go for that. What we nowadays call detach and attach was
no fun thing in the old architecture...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:OVXHN1rAEHA.688@.tk2msftngp13.phx.gbl...
> Hi,
> In SQL 6.5 it is always better to take a DUMP of the database and then
copy
> it to destination and Load it
> 1. DUMP DATABASE
> 2. COPY the DMP file to destination
> 3. LOAD DATABASE
> In SQL 6.5 the commands Tiber mentioned can be used during worst cases,
> Normally when master database is damaged and
> incomplete master database is incomplete. This case you have the physical
> files. Each physical files (DAT files)can be mapped to
> sysdevices table using DISK REINIT command. After that run DISK REFIT to
> recreate the SYSUSAGES table.
> After REFIT stop and start SQL server service.
> Thanks
> Hari
> MCDBA
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:OQJeohrAEHA.232@.TK2MSFTNGP10.phx.gbl...
> > You need to use DISK REINIT and DISK REFIT. Read about the commands in
> Books
> > Online...
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> >
> >
> > "Darius" <darius.ram@.takas.lt> wrote in message
> > news:40487d61$1@.post.usenet.com...
> > > **** Post for FREE via your newsreader at post.usenet.com ****
> > >
> > > Hello,
> > >
> > > I have solved my problem with connecting to SQL 6.5. Thank you for
> > > answering.
> > > Still I have two more questions.
> > > I have copied DAT file from one computer with SQL 6.5 and put it to
> > another
> > > computer with SQL 6.5. How can I attach this file to database on
second
> > > computer? This file seems to beDatabase Device's file, and this is not
a
> > > backup. I have no chances to do a backup from first computer. Only I
> have
> > is
> > > Dat files from C:\MSSQL\DATA folder. Is there any solution?
> > > And second question. I can see three database devices on my MSSQL 6.5
> > > server. How do I know which device's databases I see?
> > >
> > > Thank you.
> > >
> > > Darius
> > >
> > >
> > >
> > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=> > > *** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
> > > http://www.usenet.com
> > > Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
> > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=> >
> >
>

attaching DAT files

**** Post for FREE via your newsreader at post.mcse.ms ****
Hello,
I have solved my problem with connecting to SQL 6.5. Thank you for
answering.
Still I have two more questions.
I have copied DAT file from one computer with SQL 6.5 and put it to another
computer with SQL 6.5. How can I attach this file to database on second
computer? This file seems to beDatabase Device's file, and this is not a
backup. I have no chances to do a backup from first computer. Only I have is
Dat files from C:\MSSQL\DATA folder. Is there any solution?
And second question. I can see three database devices on my MSSQL 6.5
server. How do I know which device's databases I see?
Thank you.
Darius
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** mcse.ms - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.mcse.ms
Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=You need to use DISK REINIT and DISK REFIT. Read about the commands in Books
Online...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Darius" <darius.ram@.takas.lt> wrote in message
news:40487d61$1@.post.mcse.ms...
> **** Post for FREE via your newsreader at post.mcse.ms ****
> Hello,
> I have solved my problem with connecting to SQL 6.5. Thank you for
> answering.
> Still I have two more questions.
> I have copied DAT file from one computer with SQL 6.5 and put it to
another
> computer with SQL 6.5. How can I attach this file to database on second
> computer? This file seems to beDatabase Device's file, and this is not a
> backup. I have no chances to do a backup from first computer. Only I have
is
> Dat files from C:\MSSQL\DATA folder. Is there any solution?
> And second question. I can see three database devices on my MSSQL 6.5
> server. How do I know which device's databases I see?
> Thank you.
> Darius
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> *** mcse.ms - The #1 Usenet Newsgroup Service on The Planet! ***
> http://www.mcse.ms
> Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|||Hi,
In SQL 6.5 it is always better to take a DUMP of the database and then copy
it to destination and Load it
1. DUMP DATABASE
2. COPY the DMP file to destination
3. LOAD DATABASE
In SQL 6.5 the commands Tiber mentioned can be used during worst cases,
Normally when master database is damaged and
incomplete master database is incomplete. This case you have the physical
files. Each physical files (DAT files)can be mapped to
sysdevices table using DISK REINIT command. After that run DISK REFIT to
recreate the SYSUSAGES table.
After REFIT stop and start SQL server service.
Thanks
Hari
MCDBA
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OQJeohrAEHA.232@.TK2MSFTNGP10.phx.gbl...
> You need to use DISK REINIT and DISK REFIT. Read about the commands in
Books
> Online...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "Darius" <darius.ram@.takas.lt> wrote in message
> news:40487d61$1@.post.mcse.ms...
> another
have
> is
>|||I just want to add that I fully agree with Hari. If you have the option to
use DUMP and LOAD, go for that. What we nowadays call detach and attach was
no fun thing in the old architecture...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:OVXHN1rAEHA.688@.tk2msftngp13.phx.gbl...
> Hi,
> In SQL 6.5 it is always better to take a DUMP of the database and then
copy
> it to destination and Load it
> 1. DUMP DATABASE
> 2. COPY the DMP file to destination
> 3. LOAD DATABASE
> In SQL 6.5 the commands Tiber mentioned can be used during worst cases,
> Normally when master database is damaged and
> incomplete master database is incomplete. This case you have the physical
> files. Each physical files (DAT files)can be mapped to
> sysdevices table using DISK REINIT command. After that run DISK REFIT to
> recreate the SYSUSAGES table.
> After REFIT stop and start SQL server service.
> Thanks
> Hari
> MCDBA
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:OQJeohrAEHA.232@.TK2MSFTNGP10.phx.gbl...
> Books
second
a
> have
>|||**** Post for FREE via your newsreader at post.mcse.ms ****
Hello,
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OQJeohrAEHA.232@.TK2MSFTNGP10.phx.gbl...
> You need to use DISK REINIT and DISK REFIT. Read about the commands in
Books
> Online...
I have done everything as explained in example, but I encountered errors
such as "can't open file" or "start server with -m options". I don't know
what to do? There is no way to get a database dump. I have only *.dat files
Darius
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** mcse.ms - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.mcse.ms
Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|||As I said, this is not simple in the old architecture. All information that
is needed *is* available in Books Online. However, if you still encounter
problems, I recommend that you hire a consultant who know how to do this or
open a case with MS Support to assist you with this.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Darius" <darius.ram@.takas.lt> wrote in message
news:404c35d1@.post.mcse.ms...
> **** Post for FREE via your newsreader at post.mcse.ms ****
> Hello,
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:OQJeohrAEHA.232@.TK2MSFTNGP10.phx.gbl...
> Books
> I have done everything as explained in example, but I encountered errors
> such as "can't open file" or "start server with -m options". I don't know
> what to do? There is no way to get a database dump. I have only *.dat
files
> Darius
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> *** mcse.ms - The #1 Usenet Newsgroup Service on The Planet! ***
> http://www.mcse.ms
> Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=