Showing posts with label base. Show all posts
Showing posts with label base. Show all posts

Monday, March 26, 2012

Read only User on data base

I'm sure this is a really easy one but I want to create a user with read only access on a sql 2000 database using SQL authentication.

I'm building a little pilot DB system and I have a trainee developer who I want to built me some queries for crystal reports. But I dont want them to be able to amend/delete data or tables etc.

I've created the user but how to I set it to read only. Also will the user still have read only rights if the user has access to the database via enterprize manager/Query analysier.

thanks,Grant the user as db_datareader. He or she will can only read data and uses EM and QA.|||I've Granted the user the db_datareader permission and within EM everything is ok the user has read only access but within QA, logging in with the correct SQL Ath. user name and password he still has permission to Drop tables via the object browser -- very strange or have I done something wrong !|||Is the id in a particular role?

How many roles do you have?|||The User has been created within the Public and DB_datareader database role only.

Do I need to add him to another db role or server role?|||Nope. Nothing wrong. You just have to change the password on the account he is using in Query Analyzer. Basically, this user has access to two separate accounts. One with the permissions you want him to have (NT Authenticated), and a second (the SQL authenticated one) with permissions you do not want him to have.

Naturally, before you go changing passwords, you have to ask where the other (SQL authenticated) account is used (maybe in some application that needs to update data?). In this case, changing the password could be prohibitive, and you may have to resort to asking the user to stop using that account. Ahh, politics.

Friday, March 23, 2012

read images from SQL server

Hi Guru's,
I want to show images in my webforms, but whitout any succes...... , hope some can tell me why
as base I've used exactly the same script as defined in the article http://www.dotnetbips.com/displayarticle.aspx?id=101
Maybe its because some of the HTML is incorrect ?
<itemtemplate>
<asp:image id="img" runat= server></asp:image>
</itemtemplate>
Please , a need some assitance here

regards
STry the link below for working code and there is a Microsoft Channel 9 show doing the same thing. Hope this helps.
http://www.codeproject.com/cs/database/ImageSaveInDataBase.asp

Tuesday, March 20, 2012

Re Recorcer suspect database

Hi
One of my client give me a suspect database, but he doesn't have any backup
of this base.
When i try to recorver the data with the command : DBCC CHECKDB with
REPAIR_REBUILD (or REPAIR_ALLOW_DATA_LOSS)
(http://65.214.43.26/articles/18/view.asp?id=7381), i got an error :
Serveur : Msg 8946, Niveau 16, tat 12, Ligne 2
Erreur de table : La page d'allocation (1:1) a des valeurs d'en-tte de page
PFS_PAGE incorrecte. Le type est 0. Contrlez le type, et les ID d'objet et
de page pour cette page.
What can i do?
The Microsoft support is too expensive, and i want to find an other solution
for the futur, to recorver my data.
When i try MSSQLRecorvery, i recorver all data, and it seems to be the best
solution. What do you think about this software?
Best regards
Herv RESCOURIO
"Hari Prasad" <hari_prasad_k@.hotmail.com> a crit dans le message de news:
eulsf9bNFHA.1948@.TK2MSFTNGP14.phx.gbl...
> Hi,
> First identify the cause for the Suspect. If it is due to some file access
> issues you do not want to use any tools instead use the SQL Server
> commands
> to recover the database.
> Various Reasons for database going to suspect Status.
> 1. The MDF or LDF file for the database is not available during startup
> 2. LDF file missing or Corrupted
> 3. MDF file page allocation problems.
>
> 1. The first one can be resolved by executing "sp_resetstatus" stored
> procedure and restart SQL server services
> 2. Start the database in Emergency mode , Update the Status column in
> master..sysdatabases table for that database to 32768.
> After this database will be usable with out transaction log. AFter this
> create a new database and use DTS to transfer objects and data.
> 3. Third one is critical , try executing DBCC CHECKDB with REPAIR_REBUILD
> option. If the problem is not rectified
> wither restore from Backup or contact Microsoft support.
>
> How to set to Emergency Mode
> --X-
> Use emergency mode (also called bypass mode) to recover data when SQL
> Server marks a database suspect and the automatic recovery will fail.
> Setting the database status to emergency mode tells SQL Server to skip
> automatic recovery and lets you access the data. To get your data, use
> this script:
>
> Sp_configure "allow updates", 1
> go
> Reconfigure with override
> GO
> Update sysdatabases set status = 32768 where name = "BadDbName"
> go
> Sp_configure "allow updates", 0
> go
> Reconfigure with override
> GO
>
> Thanks
> Hari
> SQL Server MVP
>
> "Herv RESCOURIO" <hr@.segilog.com> wrote in message
> news:ufots5bNFHA.3296@.TK2MSFTNGP15.phx.gbl...
>
> One of my client give me a suspect database, but he doesn't have any
backup
> of this base.

> The Microsoft support is too expensive, and i want to find an other
solution
> for the futur, to recorver my data.
> When i try MSSQLRecorvery, i recorver all data, and it seems to be the
best
> solution. What do you think about this software?
Just do the backups.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com

Re Recorcer suspect database

Hi
One of my client give me a suspect database, but he doesn't have any backup
of this base.
When i try to recorver the data with the command : DBCC CHECKDB with
REPAIR_REBUILD (or REPAIR_ALLOW_DATA_LOSS)
(http://65.214.43.26/articles/18/view.asp?id=7381), i got an error :
Serveur : Msg 8946, Niveau 16, État 12, Ligne 2
Erreur de table : La page d'allocation (1:1) a des valeurs d'en-tête de page
PFS_PAGE incorrecte. Le type est 0. Contrôlez le type, et les ID d'objet et
de page pour cette page.
What can i do?
The Microsoft support is too expensive, and i want to find an other solution
for the futur, to recorver my data.
When i try MSSQLRecorvery, i recorver all data, and it seems to be the best
solution. What do you think about this software?
Best regards
Hervé RESCOURIO
"Hari Prasad" <hari_prasad_k@.hotmail.com> a écrit dans le message de news:
eulsf9bNFHA.1948@.TK2MSFTNGP14.phx.gbl...
> Hi,
>
> First identify the cause for the Suspect. If it is due to some file access
> issues you do not want to use any tools instead use the SQL Server
> commands
> to recover the database.
>
> Various Reasons for database going to suspect Status.
>
> 1. The MDF or LDF file for the database is not available during startup
> 2. LDF file missing or Corrupted
> 3. MDF file page allocation problems.
>
>
> 1. The first one can be resolved by executing "sp_resetstatus" stored
> procedure and restart SQL server services
>
> 2. Start the database in Emergency mode , Update the Status column in
> master..sysdatabases table for that database to 32768.
> After this database will be usable with out transaction log. AFter this
> create a new database and use DTS to transfer objects and data.
>
> 3. Third one is critical , try executing DBCC CHECKDB with REPAIR_REBUILD
> option. If the problem is not rectified
> wither restore from Backup or contact Microsoft support.
>
>
> How to set to Emergency Mode
> --­-
> Use emergency mode (also called bypass mode) to recover data when SQL
> Server marks a database suspect and the automatic recovery will fail.
>
> Setting the database status to emergency mode tells SQL Server to skip
> automatic recovery and lets you access the data. To get your data, use
> this script:
>
>
> Sp_configure "allow updates", 1
> go
> Reconfigure with override
> GO
> Update sysdatabases set status = 32768 where name = "BadDbName"
> go
> Sp_configure "allow updates", 0
> go
> Reconfigure with override
> GO
>
>
> Thanks
> Hari
> SQL Server MVP
>
>
> "Hervé RESCOURIO" <hr@.segilog.com> wrote in message
> news:ufots5bNFHA.3296@.TK2MSFTNGP15.phx.gbl...
>> Hi
>>
>> What do you think about MSSQLRecovery 2.0, to recorver suspect database.
>> Do you know a better software to recover suspect database.
>>
>> Best regards
>>
>> Hervé RESCOURIO
>>
>>
>
>> One of my client give me a suspect database, but he doesn't have any
backup
> of this base.
> The Microsoft support is too expensive, and i want to find an other
solution
> for the futur, to recorver my data.
> When i try MSSQLRecorvery, i recorver all data, and it seems to be the
best
> solution. What do you think about this software?
Just do the backups.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com

Re Recorcer suspect database

Hi
One of my client give me a suspect database, but he doesn't have any backup
of this base.
When i try to recorver the data with the command : DBCC CHECKDB with
REPAIR_REBUILD (or REPAIR_ALLOW_DATA_LOSS)
(http://65.214.43.26/articles/18/view.asp?id=7381), i got an error :
Serveur : Msg 8946, Niveau 16, tat 12, Ligne 2
Erreur de table : La page d'allocation (1:1) a des valeurs d'en-tte de page
PFS_PAGE incorrecte. Le type est 0. Contrlez le type, et les ID d'objet et
de page pour cette page.
What can i do?
The Microsoft support is too expensive, and i want to find an other solution
for the futur, to recorver my data.
When i try MSSQLRecorvery, i recorver all data, and it seems to be the best
solution. What do you think about this software?
Best regards
Herv RESCOURIO
"Hari Prasad" <hari_prasad_k@.hotmail.com> a crit dans le message de news:
eulsf9bNFHA.1948@.TK2MSFTNGP14.phx.gbl...
> Hi,
> First identify the cause for the Suspect. If it is due to some file access
> issues you do not want to use any tools instead use the SQL Server
> commands
> to recover the database.
> Various Reasons for database going to suspect Status.
> 1. The MDF or LDF file for the database is not available during startup
> 2. LDF file missing or Corrupted
> 3. MDF file page allocation problems.
>
> 1. The first one can be resolved by executing "sp_resetstatus" stored
> procedure and restart SQL server services
> 2. Start the database in Emergency mode , Update the Status column in
> master..sysdatabases table for that database to 32768.
> After this database will be usable with out transaction log. AFter this
> create a new database and use DTS to transfer objects and data.
> 3. Third one is critical , try executing DBCC CHECKDB with REPAIR_REBUILD
> option. If the problem is not rectified
> wither restore from Backup or contact Microsoft support.
>
> How to set to Emergency Mode
> --_-
> Use emergency mode (also called bypass mode) to recover data when SQL
> Server marks a database suspect and the automatic recovery will fail.
> Setting the database status to emergency mode tells SQL Server to skip
> automatic recovery and lets you access the data. To get your data, use
> this script:
>
> Sp_configure "allow updates", 1
> go
> Reconfigure with override
> GO
> Update sysdatabases set status = 32768 where name = "BadDbName"
> go
> Sp_configure "allow updates", 0
> go
> Reconfigure with override
> GO
>
> Thanks
> Hari
> SQL Server MVP
>
> "Herv RESCOURIO" <hr@.segilog.com> wrote in message
> news:ufots5bNFHA.3296@.TK2MSFTNGP15.phx.gbl...
>> One of my client give me a suspect database, but he doesn't have any
backup
> of this base.

> The Microsoft support is too expensive, and i want to find an other
solution
> for the futur, to recorver my data.
> When i try MSSQLRecorvery, i recorver all data, and it seems to be the
best
> solution. What do you think about this software?
Just do the backups.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com