Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Tuesday, March 27, 2012

Determine SQL Server service account via script

Is there SQL code that will report the name of the Windows account that the
SQL Server service is using? I'd be doing this using a login in the sysadmi
n
role.
I've searched BOL, the web, and newsgroups. But I haven't found a way.
Thanks
Jon Robertson
Borland Certified Advanced Delphi 7 Developer
MedEvolve, Inc
http://www.medevolve.comJon
DECLARE @.serviceaccount varchar(100)
EXECUTE master.dbo.xp_instance_regread
N'HKEY_LOCAL_MACHINE',
N'SYSTEM\CurrentControlSet\Services\MSSQ
LSERVER',
N'ObjectName',
@.ServiceAccount OUTPUT,
N'no_output'
SELECT @.Serviceaccount
"Jon Robertson" <JonRobertson@.community.nospam> wrote in message
news:17635F3D-6CF1-4ECA-941D-DAB9652D81D7@.microsoft.com...
> Is there SQL code that will report the name of the Windows account that
> the
> SQL Server service is using? I'd be doing this using a login in the
> sysadmin
> role.
> I've searched BOL, the web, and newsgroups. But I haven't found a way.
> Thanks
> --
> Jon Robertson
> Borland Certified Advanced Delphi 7 Developer
> MedEvolve, Inc
> http://www.medevolve.comsql

Determine security access to stored procedure through ASP

I have an ASP application running in a MS Windows Server 2003 computer
joined to a Windows 2000 Active Directory domain.
Different users have different roles, and the security in the SQL
database is based on Active Directory security groups (SQL server is
configured for Windows security and not SQL server security).
I would like to make certain ASP page show an icon depending on whether
the user has EXECUTE permission on a particular stored procedure.
Example: User X@.domain.com is a member of the Active Directory
security group APP-ADMIN. On the SQL server side, APP-ADMIN is the log
in of a SQL user called "App Admins", and App Admins have been granted
EXECUTE permission to the stored procedure spDeleteSomething. I want
the ASP to determine if X@.domain.com has the permission on
spDeleteSomething so an icon is displayed; in this case it should be
displayed.
I hope I made this clear, but if not, feel free to ask for more details.You can use the IS_MEMBER function to check to see if the current login is a
member of the App Admins group:
SELECT IS_MEMBER('domain.com\App Admins')
returns 1 if the current login is a member of the App Admins security group,
0 if they aren't.
"webJose" wrote:

> I have an ASP application running in a MS Windows Server 2003 computer
> joined to a Windows 2000 Active Directory domain.
> Different users have different roles, and the security in the SQL
> database is based on Active Directory security groups (SQL server is
> configured for Windows security and not SQL server security).
> I would like to make certain ASP page show an icon depending on whether
> the user has EXECUTE permission on a particular stored procedure.
> Example: User X@.domain.com is a member of the Active Directory
> security group APP-ADMIN. On the SQL server side, APP-ADMIN is the log
> in of a SQL user called "App Admins", and App Admins have been granted
> EXECUTE permission to the stored procedure spDeleteSomething. I want
> the ASP to determine if X@.domain.com has the permission on
> spDeleteSomething so an icon is displayed; in this case it should be
> displayed.
> I hope I made this clear, but if not, feel free to ask for more details.
>|||In ASP.NET, you can determine if a web user is a member of an Active
Directory group or role without going through SQL Server.
How To: Use Role Manager in ASP.NET 2.0
http://msdn.microsoft.com/library/d... />
000013.asp
For example:
if (Roles.IsUserInRole("TestRole"))
{
Label1.Text = User.Identity.Name + " is in role TestRole";
}
else
{
Label1.Text = User.Identity.Name + " is NOT in role TestRole";
}
"webJose" <webJose@.gmail.com> wrote in message
news:1140194004.035980.226530@.g14g2000cwa.googlegroups.com...
>I have an ASP application running in a MS Windows Server 2003 computer
> joined to a Windows 2000 Active Directory domain.
> Different users have different roles, and the security in the SQL
> database is based on Active Directory security groups (SQL server is
> configured for Windows security and not SQL server security).
> I would like to make certain ASP page show an icon depending on whether
> the user has EXECUTE permission on a particular stored procedure.
> Example: User X@.domain.com is a member of the Active Directory
> security group APP-ADMIN. On the SQL server side, APP-ADMIN is the log
> in of a SQL user called "App Admins", and App Admins have been granted
> EXECUTE permission to the stored procedure spDeleteSomething. I want
> the ASP to determine if X@.domain.com has the permission on
> spDeleteSomething so an icon is displayed; in this case it should be
> displayed.
> I hope I made this clear, but if not, feel free to ask for more details.
>|||JT: Thank you for your response. Although highly enlighting, I am not
using .NET (I know! I should be). :-)
Mark: Thank you for your response. IS_MEMBER workS OK for me. I'll
create user-defined functions to encapsulate this functionality. Now,
out of curiosity, is there a way to test for EXECUTE permissions on any
stored procedure like on the fly? For example, something like:
If CanExecute("spSomeSP") Then
Response.Write "You got it!"
End If
And CanExecute() would test somehow the permissions for the user ID on
the sp name passed as argument.|||You could query it from the sysprotects system table.
For SQL 2000:
IF EXISTS (
SELECT 1 FROM sysprotects
WHERE [id] = OBJECT_ID('yourproc')
AND [uid] = USER_ID()
AND [action] = 224
AND [protecttype] IN (204,205)
)
BEGIN
PRINT 'You have access'
END
For SQL 2005
IF EXISTS (
SELECT 1 FROM sys.database_permissions
WHERE [class] = 1
AND [major_id] = OBJECT_ID('yourproc')
AND [grantee_principal_id] = USER_ID()
AND [type] = 'EX'
AND [state] IN ('G','W')
)
BEGIN
PRINT 'You have access'
END
"webJose" wrote:

> JT: Thank you for your response. Although highly enlighting, I am not
> using .NET (I know! I should be). :-)
> Mark: Thank you for your response. IS_MEMBER workS OK for me. I'll
> create user-defined functions to encapsulate this functionality. Now,
> out of curiosity, is there a way to test for EXECUTE permissions on any
> stored procedure like on the fly? For example, something like:
> If CanExecute("spSomeSP") Then
> Response.Write "You got it!"
> End If
> And CanExecute() would test somehow the permissions for the user ID on
> the sp name passed as argument.
>|||One caveat to this: the will only return that the user has access if the use
r
they map too was explicity given access to execute procedure. If their
permission is inherited from membership in a server or database role, my
script will not show them as having access.
If you are explicitly giving execute permission to each of the users, then
it will work.
"Mark Williams" wrote:
> You could query it from the sysprotects system table.
> For SQL 2000:
> IF EXISTS (
> SELECT 1 FROM sysprotects
> WHERE [id] = OBJECT_ID('yourproc')
> AND [uid] = USER_ID()
> AND [action] = 224
> AND [protecttype] IN (204,205)
> )
> BEGIN
> PRINT 'You have access'
> END
> For SQL 2005
> IF EXISTS (
> SELECT 1 FROM sys.database_permissions
> WHERE [class] = 1
> AND [major_id] = OBJECT_ID('yourproc')
> AND [grantee_principal_id] = USER_ID()
> AND [type] = 'EX'
> AND [state] IN ('G','W')
> )
> BEGIN
> PRINT 'You have access'
> END
> --
> "webJose" wrote:
>

Sunday, March 25, 2012

Determine if Cluster Resources Move before Rebooting

How do I determine if the Cluster Group was moved before
reboot the one node on a Windows 2000 Advanced Server?
I have Active/Active Cluster with Node A and Node B
My goal was to move Node A resources to Node B and reboot
Node A and then resouces back to Node A.
I think the Server Administrator did not move the
resources before rebooting the server which caused the
link server not to work properly.
Please help me with this problem.
Thank You,
Mike
The cluster administrator tool will show what resources are on what node(s).
You can look from the resource point of view or from the node point of view.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Mike" <anonymous@.discussions.microsoft.com> wrote in message
news:155f501c415ea$bbc559a0$a401280a@.phx.gbl...
> How do I determine if the Cluster Group was moved before
> reboot the one node on a Windows 2000 Advanced Server?
> I have Active/Active Cluster with Node A and Node B
> My goal was to move Node A resources to Node B and reboot
> Node A and then resouces back to Node A.
> I think the Server Administrator did not move the
> resources before rebooting the server which caused the
> link server not to work properly.
> Please help me with this problem.
> Thank You,
> Mike
>
|||The application log can show you the times when SQL Server was started and
stopped. You may be able to track down when SQL Server was moved from one
one to the other by studying this.
Rand
This posting is provided "as is" with no warranties and confers no rights.
sql

Thursday, March 22, 2012

Detecting IIS

Good Morning,

My name is Erin. When attempting to install SQL Server Express on Windows XP Home Edition Service Pak 2, the installation freezes at "Detecting IIS...". I have been bopped around Microsoft Support since Monday. I even opened a case, but I have no success. Does anyone have any ideas on how to get around this problem? Any help would be greatly appreciated. Tongue TiedGreat question Erin.

There are several threads in the Setup Forum that may help.

Check out
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=130608&SiteID=1
and
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=54363&SiteID=1|||I made it through the installation of Net.Framework 2.0. with the SDk kit. I've installed the SQLServer, Express without any problems. Now I need to configure the Startup kit for SDK, and Net Framework 2.0. I finally got the configuration wizard, and I am asked if I have the IIS installed on my computer. I don't think I can get the IIS on the Home, ed. There may be a substitute. I ran into a support I believe some time ago. I am looking now. Thought I was alone where this matter is concerned. Will get back if I find the support for IIS.

Detecting IIS

Good Morning,

My name is Erin. When attempting to install SQL Server Express on Windows XP Home Edition Service Pak 2, the installation freezes at "Detecting IIS...". I have been bopped around Microsoft Support since Monday. I even opened a case, but I have no success. Does anyone have any ideas on how to get around this problem? Any help would be greatly appreciated. Tongue TiedGreat question Erin.

There are several threads in the Setup Forum that may help.

Check out
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=130608&SiteID=1
and
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=54363&SiteID=1|||I made it through the installation of Net.Framework 2.0. with the SDk kit. I've installed the SQLServer, Express without any problems. Now I need to configure the Startup kit for SDK, and Net Framework 2.0. I finally got the configuration wizard, and I am asked if I have the IIS installed on my computer. I don't think I can get the IIS on the Home, ed. There may be a substitute. I ran into a support I believe some time ago. I am looking now. Thought I was alone where this matter is concerned. Will get back if I find the support for IIS.

detecting group of logins

Hello there
I have some applications that talks with sql server.
On some of them i have problem of access denied.
In all of them they are use windows authentication.
and on sql server there are many logins. Is there a way to know when user is
entered from which login he used to access inside? and in case of failure is
there a way to know what login the user tried to access?Roy,
I am afraid I do not fully understand your problem, but let me try.
From your title, I guess that your users are using their domain logins
(mydomain\mylogin) to login to the serve, but that you are not granting
database rights to individual logins, but to domain groups
(mydomain\mySQLgroup1, etc).
Is that correct?
If so, each individual when he logs in, he is authenticated as himself
(mydomain\mylogin), but he inherits the rights granted to all group logins
(mydomain\mySQLgroup1, etc) of which his login is a member. So, he is not
running as one of those group logins at all, but always runs as his personal
login.
To determine how the personal login gets (or fails to get) rights to an
object you will have to examine the rights granted to the group logins of
which he is a member. You can then use sp_helprotect to examine rights
within a database and sp_helplogins to determine what database roles a login
(either personal or group) has been granted.
A subtle way that a login will fail is when it is a member of a group login
that has a default database definition that the group does not actually have
rights to. Then the attempt to login can fail trying to access the default
database at login time. (If a login is a member of many group logins and
those group logins have different default databases, then you cannot predict
which default database will be applied at login time.)
If the default database problem is what is affecting you, then change that
definition.
RLF
"Roy Goldhammer" <roy@.hotmail.com> wrote in message
news:OE$fRG4eHHA.4364@.TK2MSFTNGP06.phx.gbl...
> Hello there
> I have some applications that talks with sql server.
> On some of them i have problem of access denied.
> In all of them they are use windows authentication.
> and on sql server there are many logins. Is there a way to know when user
> is entered from which login he used to access inside? and in case of
> failure is there a way to know what login the user tried to access?
>

Monday, March 19, 2012

Detailed information on individual security parameters

Is there a location to either download the Windows 2000 Resource Kit Books
(on Security) or find the subject parameters elsewhere?
Hello,
Can you please explain in more detail what you looking for? Active Directory
Schema References contains all the default security descriptors applied to
each object class and attribute within Active Directory.
Search googel for "Active Directory Schema References "
Regards
Christoffer Andersson
Microsoft MVP - Directory Services
No email replies please - reply in the newsgroup
http://www.chrisse.se - Active Directory Resources
"SRVMAINT00" <apherson@.lycos.com> wrote in message
news:cgagf.63$SA4.4791@.news.uswest.net...
> Is there a location to either download the Windows 2000 Resource Kit Books
> (on Security) or find the subject parameters elsewhere?
>
>
|||"SRVMAINT00" <apherson@.lycos.com> wrote in message
news:cgagf.63$SA4.4791@.news.uswest.net...
> Is there a location to either download the Windows 2000 Resource Kit Books
> (on Security) or find the subject parameters elsewhere?
I would start with the Windows 2000 Security Guide and other documents at
www.microsoft.com/technet/security and also there is a lot of good
information for Windows 2000 at www.nsa.gov/snac

Detailed information on individual security parameters

Is there a location to either download the Windows 2000 Resource Kit Books
(on Security) or find the subject parameters elsewhere?Hello,
Can you please explain in more detail what you looking for? Active Directory
Schema References contains all the default security descriptors applied to
each object class and attribute within Active Directory.
Search googel for "Active Directory Schema References "
Regards
Christoffer Andersson
Microsoft MVP - Directory Services
No email replies please - reply in the newsgroup
---
http://www.chrisse.se - Active Directory Resources
"SRVMAINT00" <apherson@.lycos.com> wrote in message
news:cgagf.63$SA4.4791@.news.uswest.net...
> Is there a location to either download the Windows 2000 Resource Kit Books
> (on Security) or find the subject parameters elsewhere?
>
>|||"SRVMAINT00" <apherson@.lycos.com> wrote in message
news:cgagf.63$SA4.4791@.news.uswest.net...
> Is there a location to either download the Windows 2000 Resource Kit Books
> (on Security) or find the subject parameters elsewhere?
I would start with the Windows 2000 Security Guide and other documents at
www.microsoft.com/technet/security and also there is a lot of good
information for Windows 2000 at www.nsa.gov/snac

Detailed information on individual security parameters

Is there a location to either download the Windows 2000 Resource Kit Books
(on Security) or find the subject parameters elsewhere?Hello,
Can you please explain in more detail what you looking for? Active Directory
Schema References contains all the default security descriptors applied to
each object class and attribute within Active Directory.
Search googel for "Active Directory Schema References "
--
Regards
Christoffer Andersson
Microsoft MVP - Directory Services
No email replies please - reply in the newsgroup
---
http://www.chrisse.se - Active Directory Resources
"SRVMAINT00" <apherson@.lycos.com> wrote in message
news:cgagf.63$SA4.4791@.news.uswest.net...
> Is there a location to either download the Windows 2000 Resource Kit Books
> (on Security) or find the subject parameters elsewhere?
>
>|||"SRVMAINT00" <apherson@.lycos.com> wrote in message
news:cgagf.63$SA4.4791@.news.uswest.net...
> Is there a location to either download the Windows 2000 Resource Kit Books
> (on Security) or find the subject parameters elsewhere?
I would start with the Windows 2000 Security Guide and other documents at
www.microsoft.com/technet/security and also there is a lot of good
information for Windows 2000 at www.nsa.gov/snac

Detailed error reporting. How to?

The best I can get out of my detail log is this which is no help. How do I find out what really happened. My windows app log is no help either

Date 5/24/2006 9:51:41 PM
Log Job History (DTS_xx)

Step ID 1
Server xx
Job Name DTS_xx
Step Name DTS_xx
Duration 00:00:01
Sql Severity 0
Sql Message ID 0
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0

Message
Executed as user: xx\administrator. The package execution failed. The step failed.

This KB article discusses various options:
http://support.microsoft.com/kb/918760|||

Michael - I'm glad your online right now. All that I'm trying to do is run stored procs on my database. My ssis package uses the correct login but I keep getting the error I posted. This was running fine on my 2000 box.

So I tried a few other things. I recreated the package on my production server and it works. Seems to be the problem is when I move it from my dev box to production its loosing something.

Sunday, March 11, 2012

Detaching & Attaching Database

Hello Group.
I have the following problem using SQL Server 2000 on WinXP machine.
I detached a SQL database and then performed a windows copy of the database
to another folder on the system.
I then renamed the database and tried to attach the renamed database to SQL.
SQL sees the old name and says there is already a database with that name
attached.
How can I solve this problem?
How can I get SQL to see the new name given to the MDF and LDF files?
Thanks,
Terry"Terry" <tgwillett@.cox.net> wrote in message
news:Trhwf.51529$ih5.12670@.dukeread11...
> Hello Group.
> I have the following problem using SQL Server 2000 on WinXP machine.
> I detached a SQL database and then performed a windows copy of the
> database to another folder on the system.
> I then renamed the database and tried to attach the renamed database to
> SQL.
> SQL sees the old name and says there is already a database with that name
> attached.
> How can I solve this problem?
> How can I get SQL to see the new name given to the MDF and LDF files?
> Thanks,
> Terry
>
Renaming the MDF / LDF files has nothing to do with renaming the database.
The name for the database when it is attached is specified by the first
parameter of sp_attach_db. Example:
EXEC sp_attach_db 'new_db_name',
'd:\mssql\data\db_file_name.mdf',
'd:\mssql\data\db_file_name.ldf'
David Portas
SQL Server MVP
--|||Hi Terry
The name of the database does not have to have anything to do with the names
of the database files. So when you say you renamed 'the database' do you
mean you renamed the files you moved, or renamed the database on the server?
The original name of the database is stored with the files, however, even if
you change the name of the files. If you want to attach some database files
and give the database contained on those files another name than the one it
originally had, you have to specify that when you do the attach.
I suggest you use the command sp_attach_db, following the examples in the
Books Online. This will allow you to specify the name of the database you
are attaching, and the physical names of all the files you want to attach.
If you still are unsuccessful, you can then post the exact command you are
using and the exact error message you get back.
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"Terry" <tgwillett@.cox.net> wrote in message
news:Trhwf.51529$ih5.12670@.dukeread11...
> Hello Group.
> I have the following problem using SQL Server 2000 on WinXP machine.
> I detached a SQL database and then performed a windows copy of the
> database to another folder on the system.
> I then renamed the database and tried to attach the renamed database to
> SQL.
> SQL sees the old name and says there is already a database with that name
> attached.
> How can I solve this problem?
> How can I get SQL to see the new name given to the MDF and LDF files?
> Thanks,
> Terry
>|||Okay, but how do I accomplish this with enterprise manager?
In the dialog box that appears when you go to attach the database, it gives
you the orginal database name.
In the box "attach as" I give it the new name and get the error that it
already exits.
What am I missing here?
Thanks, for your quick response.
Terry
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:uClxr8KFGHA.2064@.TK2MSFTNGP09.phx.gbl...
> "Terry" <tgwillett@.cox.net> wrote in message
> news:Trhwf.51529$ih5.12670@.dukeread11...
> Renaming the MDF / LDF files has nothing to do with renaming the database.
> The name for the database when it is attached is specified by the first
> parameter of sp_attach_db. Example:
> EXEC sp_attach_db 'new_db_name',
> 'd:\mssql\data\db_file_name.mdf',
> 'd:\mssql\data\db_file_name.ldf'
> --
> David Portas
> SQL Server MVP
> --
>|||Okay, your statement
"The original name of the database is stored with the files" explains what I
was missing.
Now I understand. I did not know this.
Thanks,
Kalen
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:%23Edin%23KFGHA.3856@.TK2MSFTNGP12.phx.gbl...
> Hi Terry
> The name of the database does not have to have anything to do with the
> names of the database files. So when you say you renamed 'the database' do
> you mean you renamed the files you moved, or renamed the database on the
> server?
> The original name of the database is stored with the files, however, even
> if you change the name of the files. If you want to attach some database
> files and give the database contained on those files another name than the
> one it originally had, you have to specify that when you do the attach.
> I suggest you use the command sp_attach_db, following the examples in the
> Books Online. This will allow you to specify the name of the database you
> are attaching, and the physical names of all the files you want to attach.
> If you still are unsuccessful, you can then post the exact command you are
> using and the exact error message you get back.
> --
> HTH
> Kalen Delaney, SQL Server MVP
> www.solidqualitylearning.com
>
> "Terry" <tgwillett@.cox.net> wrote in message
> news:Trhwf.51529$ih5.12670@.dukeread11...
>
>|||"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:uClxr8KFGHA.2064@.TK2MSFTNGP09.phx.gbl...
> "Terry" <tgwillett@.cox.net> wrote in message
> news:Trhwf.51529$ih5.12670@.dukeread11...
I don't know about accomplishing this in Enterprise Manager because I rarely
use EM that way. In my opinion it would be much easier to type the
sp_attach_db command in Query Analyzer.
David Portas
SQL Server MVP
--|||Okay,
Thanks for your help.
Much appreciated.
Terry
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:eEqu3XLFGHA.1288@.TK2MSFTNGP09.phx.gbl...
> "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
> news:uClxr8KFGHA.2064@.TK2MSFTNGP09.phx.gbl...
> I don't know about accomplishing this in Enterprise Manager because I
> rarely use EM that way. In my opinion it would be much easier to type the
> sp_attach_db command in Query Analyzer.
> --
> David Portas
> SQL Server MVP
> --
>

detached database disappears?

Hi All:
Running SQL2005 sp1 on Windows Server 2003 R2.
I have Management Studio installed locally on the server. I connected to the
local instance, backed up a database with no problems, and then detached the
database, and now the physical files are gone? not in the "data" folder, not
anywhere...I still have the backup file, but I'm a little freaked out by
this.
Has anyone experience this? I'm logged in as the administrator so I don't
think the files are hidden from view (all the other databases are in the
data folder)
> I have Management Studio installed locally on the server. I connected to
> the local instance, backed up a database with no problems, and then
> detached the database, and now the physical files are gone? not in the
> "data" folder, not anywhere...I still have the backup file, but I'm a
> little freaked out by this.
> Has anyone experience this?
No, I've never seen this. Are you sure you searched all of the drives,
since often we don't place user databases under the program files structure,
but rather on a separate disk altogether.
|||>> I have Management Studio installed locally on the server. I connected to
> No, I've never seen this. Are you sure you searched all of the drives,
> since often we don't place user databases under the program files
> structure, but rather on a separate disk altogether.
Yeah, there's only one drive/partition on the system, and I've searched
everywhere...it's g-o-n-e.
I performed a full dB backup as well as TLog backup before detaching it. I'm
having trouble restoring from the backup now.
First, I tried to restore by typing in the name of the dB in the "to
database" and attaching the backup file. The backup shows the name of the dB
in the backup set, but when I select the "full database backup" and click
OK, I get a strange error:
TITLE: Microsoft SQL Server Management Studio
Restore failed for Server 'proto'. (Microsoft.SqlServer.Smo)
For help, click:
[url]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00. 2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo. ExceptionTemplates.FailedOperationExceptionText&Ev tID=Restore+Server&LinkId=20476[/url]
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: File "EMS_Metro_Data" cannot be restored
over the existing "C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\EMS_Metro_Data_new.MDF". Reissue the RESTORE
statement using WITH REPLACE to overwrite pre-existing files, or WITH MOVE
to identify an alternate location. (Microsoft.SqlServer.Smo)
For help, click:
[url]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00. 2047.00&LinkId=20476[/url]
BUT the database name referenced in the error is NOT the database I'm trying
to restore!
So, I then created a new database with the same name as the one I detached,
and selected "restore" and went through the same process, and I then get a
different error:
TITLE: Microsoft SQL Server Management Studio
Restore failed for Server 'proto'. (Microsoft.SqlServer.Smo)
For help, click:
[url]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00. 2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo. ExceptionTemplates.FailedOperationExceptionText&Ev tID=Restore+Server&LinkId=20476[/url]
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
The backup set holds a backup of a database other than the existing
'EMS_Ultimate' database.
RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error:
3154)
For help, click:
[url]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00 .2047&EvtSrc=MSSQLServer&EvtID=3154&LinkId=20476[/url]
EMS_Ultimate is the dB I'm trying to restore! And that's the name of the dB
in the backup file...now I'm really nervous!
|||Sounds to me like the MDF file is still in the Data folder.
And the error message references the name of the *file* no the name of the
database. They do not have to be the same.
"geek-y-guy" <noone@.nowhere.org> wrote in message
news:ekhyVxeKHHA.320@.TK2MSFTNGP06.phx.gbl...
> Yeah, there's only one drive/partition on the system, and I've searched
> everywhere...it's g-o-n-e.
> I performed a full dB backup as well as TLog backup before detaching it.
> I'm having trouble restoring from the backup now.
> First, I tried to restore by typing in the name of the dB in the "to
> database" and attaching the backup file. The backup shows the name of the
> dB in the backup set, but when I select the "full database backup" and
> click OK, I get a strange error:
> TITLE: Microsoft SQL Server Management Studio
> --
> Restore failed for Server 'proto'. (Microsoft.SqlServer.Smo)
> For help, click:
> [url]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00. 2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo. ExceptionTemplates.FailedOperationExceptionText&Ev tID=Restore+Server&LinkId=20476[/url]
> --
> ADDITIONAL INFORMATION:
> System.Data.SqlClient.SqlError: File "EMS_Metro_Data" cannot be restored
> over the existing "C:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\EMS_Metro_Data_new.MDF". Reissue the RESTORE
> statement using WITH REPLACE to overwrite pre-existing files, or WITH MOVE
> to identify an alternate location. (Microsoft.SqlServer.Smo)
> For help, click:
> [url]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00. 2047.00&LinkId=20476[/url]
> --
> BUT the database name referenced in the error is NOT the database I'm
> trying to restore!
> So, I then created a new database with the same name as the one I
> detached, and selected "restore" and went through the same process, and I
> then get a different error:
> TITLE: Microsoft SQL Server Management Studio
> --
> Restore failed for Server 'proto'. (Microsoft.SqlServer.Smo)
> For help, click:
> [url]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00. 2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo. ExceptionTemplates.FailedOperationExceptionText&Ev tID=Restore+Server&LinkId=20476[/url]
> --
> ADDITIONAL INFORMATION:
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.ConnectionInfo)
> --
> The backup set holds a backup of a database other than the existing
> 'EMS_Ultimate' database.
> RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error:
> 3154)
> For help, click:
> [url]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00 .2047&EvtSrc=MSSQLServer&EvtID=3154&LinkId=20476[/url]
> --
> EMS_Ultimate is the dB I'm trying to restore! And that's the name of the
> dB in the backup file...now I'm really nervous!
>
|||Sounds to me like the MDF file is still in the Data folder.
And the error message references the name of the *file* no the name of the
database. They do not have to be the same.
"geek-y-guy" <noone@.nowhere.org> wrote in message
news:ekhyVxeKHHA.320@.TK2MSFTNGP06.phx.gbl...
> Yeah, there's only one drive/partition on the system, and I've searched
> everywhere...it's g-o-n-e.
> I performed a full dB backup as well as TLog backup before detaching it.
> I'm having trouble restoring from the backup now.
> First, I tried to restore by typing in the name of the dB in the "to
> database" and attaching the backup file. The backup shows the name of the
> dB in the backup set, but when I select the "full database backup" and
> click OK, I get a strange error:
> TITLE: Microsoft SQL Server Management Studio
> --
> Restore failed for Server 'proto'. (Microsoft.SqlServer.Smo)
> For help, click:
> [url]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00. 2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo. ExceptionTemplates.FailedOperationExceptionText&Ev tID=Restore+Server&LinkId=20476[/url]
> --
> ADDITIONAL INFORMATION:
> System.Data.SqlClient.SqlError: File "EMS_Metro_Data" cannot be restored
> over the existing "C:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\EMS_Metro_Data_new.MDF". Reissue the RESTORE
> statement using WITH REPLACE to overwrite pre-existing files, or WITH MOVE
> to identify an alternate location. (Microsoft.SqlServer.Smo)
> For help, click:
> [url]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00. 2047.00&LinkId=20476[/url]
> --
> BUT the database name referenced in the error is NOT the database I'm
> trying to restore!
> So, I then created a new database with the same name as the one I
> detached, and selected "restore" and went through the same process, and I
> then get a different error:
> TITLE: Microsoft SQL Server Management Studio
> --
> Restore failed for Server 'proto'. (Microsoft.SqlServer.Smo)
> For help, click:
> [url]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00. 2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo. ExceptionTemplates.FailedOperationExceptionText&Ev tID=Restore+Server&LinkId=20476[/url]
> --
> ADDITIONAL INFORMATION:
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.ConnectionInfo)
> --
> The backup set holds a backup of a database other than the existing
> 'EMS_Ultimate' database.
> RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error:
> 3154)
> For help, click:
> [url]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00 .2047&EvtSrc=MSSQLServer&EvtID=3154&LinkId=20476[/url]
> --
> EMS_Ultimate is the dB I'm trying to restore! And that's the name of the
> dB in the backup file...now I'm really nervous!
>
|||
> Sounds to me like the MDF file is still in the Data folder.
> And the error message references the name of the *file* no the name of the
> database. They do not have to be the same.
>
OK, this is very bizarre...but when I clicked on the "options" in the
"restore database" window, all the settings seemed to be from a previous
restore I did months and months ago on a different database...I don't
understand why those settings would be preserved, when on the first panel
("general") I'm inputting completely different information and selecting a
completely different backup file, but I guess that's one of the mysteries of
the SQL2005.
The errors below were occuring because the MDF and LDF files existed for the
database specified in the options pane...not for the one I was trying to
restore. When I modified the settings in the "options" pane it worked
properly...oh well...at least I have the data back...I was worried the wrong
database was in the backup file.
Thanks for bearing with me!

>
> "geek-y-guy" <noone@.nowhere.org> wrote in message
> news:ekhyVxeKHHA.320@.TK2MSFTNGP06.phx.gbl...
>

Friday, March 9, 2012

detach problem

I'm using following connection string in my application in (C# 2.0 windows )

Data Source=.\SQLEXPRESS; Trusted_Connection=yes;AttachDbFilename=|DataDirectory|\myDB.mdf"

My application attaches the file successfully when the first connection is established, but after closing my application the database is remained in the sql server express and it does not detached automatically. According to this article the database shall be detached and I need it in my application because of the security.

http://technet.microsoft.com/en-us/library/ms165716.aspx

Please let me know what shall I do ?

Thanks in advance,

Saeideh

You should always close the conenction to the database as far as you don′t use it anymore.Othwerwise the database will be closed (and detached after a certain period of time). If you have enabled connection pooling it "can take a while" after the pool will be released and the connection will be closed.

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

User instance databases have the Auto Close option set so that if there are no connections to a database for 8-10 minutes, the database shuts down and the file is closed. This happens automatically, but it can take a while, especially if connection pooling is enabled for your connections.

Jens K. Suessmeyer

http://www.sqlserver2005.de

Wednesday, March 7, 2012

Desktop vs. Standard

Hello,
I purchased some software that comes with the desktop edition of SQL 2000.
I have a Windows 2003 server and about 20 clients who need to access the
database.
Are there any limits to the desktop edition that I should be aware of?
Does it work with Windows 2003?
Does it have a limit to the number of simultaneous users?
Does it have memory limits?
Thanks
I assume you mean Desktop Engine, also known as MSDE...
1. Yes
2. No. But there's a performance throttling kicking in when you have > 8 simultaneously executing
queries.
3. Max size for db is 2GB (data, not log).
More info at http://www.microsoft.com/sql/default.mspx.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"boe" <boe_d@.hotmail.nospam.com> wrote in message news:%23bmI5Dc3EHA.1188@.tk2msftngp13.phx.gbl...
> Hello,
> I purchased some software that comes with the desktop edition of SQL 2000.
> I have a Windows 2003 server and about 20 clients who need to access the
> database.
> Are there any limits to the desktop edition that I should be aware of?
> Does it work with Windows 2003?
> Does it have a limit to the number of simultaneous users?
> Does it have memory limits?
> Thanks
>
|||Thank you - good to know!
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uKv%23VNc3EHA.3472@.TK2MSFTNGP09.phx.gbl...
>I assume you mean Desktop Engine, also known as MSDE...
> 1. Yes
> 2. No. But there's a performance throttling kicking in when you have > 8
> simultaneously executing
> queries.
> 3. Max size for db is 2GB (data, not log).
> More info at http://www.microsoft.com/sql/default.mspx.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "boe" <boe_d@.hotmail.nospam.com> wrote in message
> news:%23bmI5Dc3EHA.1188@.tk2msftngp13.phx.gbl...
>

Desktop vs. Standard

Hello,
I purchased some software that comes with the desktop edition of SQL 2000.
I have a Windows 2003 server and about 20 clients who need to access the
database.
Are there any limits to the desktop edition that I should be aware of?
Does it work with Windows 2003?
Does it have a limit to the number of simultaneous users?
Does it have memory limits?
ThanksI assume you mean Desktop Engine, also known as MSDE...
1. Yes
2. No. But there's a performance throttling kicking in when you have > 8 simultaneously executing
queries.
3. Max size for db is 2GB (data, not log).
More info at http://www.microsoft.com/sql/default.mspx.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"boe" <boe_d@.hotmail.nospam.com> wrote in message news:%23bmI5Dc3EHA.1188@.tk2msftngp13.phx.gbl...
> Hello,
> I purchased some software that comes with the desktop edition of SQL 2000.
> I have a Windows 2003 server and about 20 clients who need to access the
> database.
> Are there any limits to the desktop edition that I should be aware of?
> Does it work with Windows 2003?
> Does it have a limit to the number of simultaneous users?
> Does it have memory limits?
> Thanks
>|||Thank you - good to know!
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uKv%23VNc3EHA.3472@.TK2MSFTNGP09.phx.gbl...
>I assume you mean Desktop Engine, also known as MSDE...
> 1. Yes
> 2. No. But there's a performance throttling kicking in when you have > 8
> simultaneously executing
> queries.
> 3. Max size for db is 2GB (data, not log).
> More info at http://www.microsoft.com/sql/default.mspx.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "boe" <boe_d@.hotmail.nospam.com> wrote in message
> news:%23bmI5Dc3EHA.1188@.tk2msftngp13.phx.gbl...
>> Hello,
>> I purchased some software that comes with the desktop edition of SQL
>> 2000.
>> I have a Windows 2003 server and about 20 clients who need to access the
>> database.
>> Are there any limits to the desktop edition that I should be aware of?
>> Does it work with Windows 2003?
>> Does it have a limit to the number of simultaneous users?
>> Does it have memory limits?
>> Thanks
>>
>

Desktop SQL can't install; SAPWD switch needed

I'm trying to install MSDE sql on my windows xp-pro system, but when running
setup, I get a prompt: A strong SA password is required for security
reasons. Please use SAPWD switch to supply the same.
The readme files really doesnt explain how I should go into any type of
explanation (like Administrative Tools in ControlPanel, etc) and set up a
system admin config for this.you must run the programm in the command prompt
then supply the necessary parameters
1. start>run>cmd
2. cd\msdeinstaller
3. setup/? for help
4. use the sapassword switch
"Bubba" wrote:

> I'm trying to install MSDE sql on my windows xp-pro system, but when runni
ng
> setup, I get a prompt: A strong SA password is required for security
> reasons. Please use SAPWD switch to supply the same.
> The readme files really doesnt explain how I should go into any type of
> explanation (like Administrative Tools in ControlPanel, etc) and set up a
> system admin config for this.
>
>|||setup.exe sapwd='1qQ123456Aa'
"jose g. de jesus jr mcp, mcdba" wrote:
> you must run the programm in the command prompt
> then supply the necessary parameters
> 1. start>run>cmd
> 2. cd\msdeinstaller
> 3. setup/? for help
> 4. use the sapassword switch
>
> "Bubba" wrote:
>

Desktop Application With Windows Mobile

Is it possible to create a desktop application that connects to an SQL Mobile database and deploy this application to a PC with SQL Server 2000 installed? If not, would this be possible if the installed server was SQL Server 2005?

Your desktop application that connects to SQL Mobile is using System.Data.SqlServerCe for the ADO.NET provider. You cannot access SQL Server 2000 or 2005 using this provider, so in order for your application to work against SS2000/2005 you would need to provide a data access layer based on System.Data.SqlClient.

Darren

Friday, February 24, 2012

Design table option not available in EM

I restored a database from one server to another. I created a SQL Windows
Authenticated login account for a developer and granted access to the
restored database as owner. When developer right clicks a table, the design
table option is not available. Does anyone know why this occurs in EM'Is that account the one in which the server is registered in EM?