Showing posts with label databases. Show all posts
Showing posts with label databases. Show all posts

Monday, March 26, 2012

Read SP source code from VB

Hi,
I'm developing an application to crypt SQL databases and i need to
read SP and Views source code from VB6, if you know how to do this
please answer me.

Greetings."Carpi" <carlos.rodriguez@.sparks-software.com> wrote in message
news:5280f320.0401080621.514fd41f@.posting.google.c om...
> Hi,
> I'm developing an application to crypt SQL databases and i need to
> read SP and Views source code from VB6, if you know how to do this
> please answer me.
> Greetings.

Probably the best place to start is the .Script method of the SQLDMO
objects, which will generate the CREATE statements for all object types.

Simon

read only databases

ok when i upload my databases that i created in VS2005, they are read only.

so i though something was just funny, so i installed sql managment studio on the server and attached the databases, and when i attached them there grey with (READ-ONLY) displayed... how can i get my DB's out of read only! i tryied going through the properties of the DB through MSSQL managenet studio but that only generates an error...

any ideas!

Right click on your database MDF file. and then select Properties and then make sure to uncheck Read-Only checkbox.

cheers

|||ok the database and the ldf are not cheked read only, but the app_data folder is checked read only and its greyed out, but when i uncheck it and click apply and ok its gone then if i right click on the folder and go to properties and look at it again the check is back in the read only box greyed out... any ideas why it keeps checking itsself to raed only...|||move mdf & ldf file from your app_data folder and then check it.
cheers

Friday, March 23, 2012

Read only and access to specific databases

Hello everyone,
Please forgive me as I'm VERY new to SQL Server. I am (in a former and
current life) a Oracle Certified Master DBA, however, I've been given a
new project -- SQL Server 2005 to administrate. Although I'm going
through some material on SQL Server, I do have two questions that
hopefully someone can answer for me.
I first want to make a READ-ONLY user (a user who can only query the
database) but not do any updates, deletes, etc. I added a local group
to the box (and put the users into that local group) and then added
that group to the "master" security users and then added that group to
the specific database I want them to have access to.
My question is, I don't see where I can make that group readonly to
that specific database, and I also don't see where I can give them
access to ONLY that one database. They can so far query the other
remaining 6 databases on the system by using owner.schema.table syntax,
and I don't want them to be able to do that.
I know this is prob. a pretty simple question and task, but I'm stumped
at how SQL Server does this... although i'm sure the solution is as
simple as the question.
Thanks for all your imput and help!
Create a SQL Login or add the users Windows account (or
Windows group) as a login on the SQL Server box. The login
gives the user access to the server but not to the databases
themselves. It's kind of like a grant connect.
For read only access to a particular database, you can then
add that login as a user in the database and add the user to
the built in database role db_datareader. That would give
the user select on the tables. You could additionally add
the user to db_denydatawriter and that would deny their
ability to insert, update, delete on the tables.
As for why you are seeing some variances, permissions are
cumulative. If the user is a member of other groups that
have access to databases, database objects then the user
gets access that way. If the public database role has been
granted access more than the default access, the user would
pick these up as well as all database users are members of
the public role.
The user having access to the other databases you don't
explicitly add the user to could be due to membership in a
windows group that has been given access - so they inherit
access to the database through their group membership. Or
enabling the guest account in that database. If the guest
account is enabled, anyone with a login can access the
database. By default of how the public role works, the user
would have access to anything granted to public. The guest
account can also be granted additional permissions although
this isn't really a good idea. The guest account is always
exists in master and tempdb and can't be removed from those
two databases.
-Sue
On 14 Mar 2006 08:38:17 -0800, "Greg" <gregcpx@.hotmail.com>
wrote:

>Hello everyone,
>Please forgive me as I'm VERY new to SQL Server. I am (in a former and
>current life) a Oracle Certified Master DBA, however, I've been given a
>new project -- SQL Server 2005 to administrate. Although I'm going
>through some material on SQL Server, I do have two questions that
>hopefully someone can answer for me.
>I first want to make a READ-ONLY user (a user who can only query the
>database) but not do any updates, deletes, etc. I added a local group
>to the box (and put the users into that local group) and then added
>that group to the "master" security users and then added that group to
>the specific database I want them to have access to.
>My question is, I don't see where I can make that group readonly to
>that specific database, and I also don't see where I can give them
>access to ONLY that one database. They can so far query the other
>remaining 6 databases on the system by using owner.schema.table syntax,
>and I don't want them to be able to do that.
>I know this is prob. a pretty simple question and task, but I'm stumped
>at how SQL Server does this... although i'm sure the solution is as
>simple as the question.
>Thanks for all your imput and help!

Read only and access to specific databases

Hello everyone,
Please forgive me as I'm VERY new to SQL Server. I am (in a former and
current life) a Oracle Certified Master DBA, however, I've been given a
new project -- SQL Server 2005 to administrate. Although I'm going
through some material on SQL Server, I do have two questions that
hopefully someone can answer for me.
I first want to make a READ-ONLY user (a user who can only query the
database) but not do any updates, deletes, etc. I added a local group
to the box (and put the users into that local group) and then added
that group to the "master" security users and then added that group to
the specific database I want them to have access to.
My question is, I don't see where I can make that group readonly to
that specific database, and I also don't see where I can give them
access to ONLY that one database. They can so far query the other
remaining 6 databases on the system by using owner.schema.table syntax,
and I don't want them to be able to do that.
I know this is prob. a pretty simple question and task, but I'm stumped
at how SQL Server does this... although i'm sure the solution is as
simple as the question.
Thanks for all your imput and help!Create a SQL Login or add the users Windows account (or
Windows group) as a login on the SQL Server box. The login
gives the user access to the server but not to the databases
themselves. It's kind of like a grant connect.
For read only access to a particular database, you can then
add that login as a user in the database and add the user to
the built in database role db_datareader. That would give
the user select on the tables. You could additionally add
the user to db_denydatawriter and that would deny their
ability to insert, update, delete on the tables.
As for why you are seeing some variances, permissions are
cumulative. If the user is a member of other groups that
have access to databases, database objects then the user
gets access that way. If the public database role has been
granted access more than the default access, the user would
pick these up as well as all database users are members of
the public role.
The user having access to the other databases you don't
explicitly add the user to could be due to membership in a
windows group that has been given access - so they inherit
access to the database through their group membership. Or
enabling the guest account in that database. If the guest
account is enabled, anyone with a login can access the
database. By default of how the public role works, the user
would have access to anything granted to public. The guest
account can also be granted additional permissions although
this isn't really a good idea. The guest account is always
exists in master and tempdb and can't be removed from those
two databases.
-Sue
On 14 Mar 2006 08:38:17 -0800, "Greg" <gregcpx@.hotmail.com>
wrote:
>Hello everyone,
>Please forgive me as I'm VERY new to SQL Server. I am (in a former and
>current life) a Oracle Certified Master DBA, however, I've been given a
>new project -- SQL Server 2005 to administrate. Although I'm going
>through some material on SQL Server, I do have two questions that
>hopefully someone can answer for me.
>I first want to make a READ-ONLY user (a user who can only query the
>database) but not do any updates, deletes, etc. I added a local group
>to the box (and put the users into that local group) and then added
>that group to the "master" security users and then added that group to
>the specific database I want them to have access to.
>My question is, I don't see where I can make that group readonly to
>that specific database, and I also don't see where I can give them
>access to ONLY that one database. They can so far query the other
>remaining 6 databases on the system by using owner.schema.table syntax,
>and I don't want them to be able to do that.
>I know this is prob. a pretty simple question and task, but I'm stumped
>at how SQL Server does this... although i'm sure the solution is as
>simple as the question.
>Thanks for all your imput and help!

Read only and access to specific databases

Hello everyone,
Please forgive me as I'm VERY new to SQL Server. I am (in a former and
current life) a Oracle Certified Master DBA, however, I've been given a
new project -- SQL Server 2005 to administrate. Although I'm going
through some material on SQL Server, I do have two questions that
hopefully someone can answer for me.
I first want to make a READ-ONLY user (a user who can only query the
database) but not do any updates, deletes, etc. I added a local group
to the box (and put the users into that local group) and then added
that group to the "master" security users and then added that group to
the specific database I want them to have access to.
My question is, I don't see where I can make that group readonly to
that specific database, and I also don't see where I can give them
access to ONLY that one database. They can so far query the other
remaining 6 databases on the system by using owner.schema.table syntax,
and I don't want them to be able to do that.
I know this is prob. a pretty simple question and task, but I'm stumped
at how SQL Server does this... although i'm sure the solution is as
simple as the question.
Thanks for all your imput and help!Create a SQL Login or add the users Windows account (or
Windows group) as a login on the SQL Server box. The login
gives the user access to the server but not to the databases
themselves. It's kind of like a grant connect.
For read only access to a particular database, you can then
add that login as a user in the database and add the user to
the built in database role db_datareader. That would give
the user select on the tables. You could additionally add
the user to db_denydatawriter and that would deny their
ability to insert, update, delete on the tables.
As for why you are seeing some variances, permissions are
cumulative. If the user is a member of other groups that
have access to databases, database objects then the user
gets access that way. If the public database role has been
granted access more than the default access, the user would
pick these up as well as all database users are members of
the public role.
The user having access to the other databases you don't
explicitly add the user to could be due to membership in a
windows group that has been given access - so they inherit
access to the database through their group membership. Or
enabling the guest account in that database. If the guest
account is enabled, anyone with a login can access the
database. By default of how the public role works, the user
would have access to anything granted to public. The guest
account can also be granted additional permissions although
this isn't really a good idea. The guest account is always
exists in master and tempdb and can't be removed from those
two databases.
-Sue
On 14 Mar 2006 08:38:17 -0800, "Greg" <gregcpx@.hotmail.com>
wrote:

>Hello everyone,
>Please forgive me as I'm VERY new to SQL Server. I am (in a former and
>current life) a Oracle Certified Master DBA, however, I've been given a
>new project -- SQL Server 2005 to administrate. Although I'm going
>through some material on SQL Server, I do have two questions that
>hopefully someone can answer for me.
>I first want to make a READ-ONLY user (a user who can only query the
>database) but not do any updates, deletes, etc. I added a local group
>to the box (and put the users into that local group) and then added
>that group to the "master" security users and then added that group to
>the specific database I want them to have access to.
>My question is, I don't see where I can make that group readonly to
>that specific database, and I also don't see where I can give them
>access to ONLY that one database. They can so far query the other
>remaining 6 databases on the system by using owner.schema.table syntax,
>and I don't want them to be able to do that.
>I know this is prob. a pretty simple question and task, but I'm stumped
>at how SQL Server does this... although i'm sure the solution is as
>simple as the question.
>Thanks for all your imput and help!

Wednesday, March 21, 2012

READ access to sql server activity monitor and sql server JOB acti

HI All,
Due to sox audit complaiance issues, we cannot give full read write access
to our production sql server 2005 databases to our developers.
But our developers want to have atleast read access to sql server activity
monitor and sql server JOB activity monitor.
How can I give only read access to those two monitors?
If I give read access to MSDB database then it will work?
I think only sysadmin role has access to those monitors right?
Please help on how to give read olny access to those monitors in sql server
2005.
Regards
Kumar
You just need to give them ProcessAdmin Server Role and in UserMapping
for MSDB give them SQLAgentReaderRole and SQLAgentUserRole
HTH,
Dinesh

READ access to sql server activity monitor and sql server JOB acti

HI All,
Due to sox audit complaiance issues, we cannot give full read write access
to our production sql server 2005 databases to our developers.
But our developers want to have atleast read access to sql server activity
monitor and sql server JOB activity monitor.
How can I give only read access to those two monitors?
If I give read access to MSDB database then it will work?
I think only sysadmin role has access to those monitors right?
Please help on how to give read olny access to those monitors in sql server
2005.
Regards
KumarYou just need to give them ProcessAdmin Server Role and in UserMapping
for MSDB give them SQLAgentReaderRole and SQLAgentUserRole
HTH,
Dineshsql

READ access to sql server activity monitor and sql server JOB acti

HI All,
Due to sox audit complaiance issues, we cannot give full read write access
to our production sql server 2005 databases to our developers.
But our developers want to have atleast read access to sql server activity
monitor and sql server JOB activity monitor.
How can I give only read access to those two monitors?
If I give read access to MSDB database then it will work?
I think only sysadmin role has access to those monitors right?
Please help on how to give read olny access to those monitors in sql server
2005.
Regards
KumarYou just need to give them ProcessAdmin Server Role and in UserMapping
for MSDB give them SQLAgentReaderRole and SQLAgentUserRole
HTH,
Dinesh

Tuesday, March 20, 2012

RE: where and how to run sp_updatestats after upgrading

Hi,
I have a question on where and how to run sp_updatestats after upgrading databases from SQL Server 7.0.
Thanks for your reply.After the successful upgrade from QUery analayzer use the database and run SP_UPDATESTATS to update stats on all the tables or you can run DBCC DBREINDEX for optimum performance.|||Hi Satya,

Thanks for your reply.

Do I need to run sp_updatestats for each database in order to updae stats for all the tables in the Query Analyzer? How does DBCC DBREINDEX works?

Thanks!
Alice

RE: Please help me!!! SQL Newbie here - need help with inserting of records!!!!!

Hi,

I am a SQL and databases newbie and this might seem like a really simple question but I just can't seem to get my head around the concept. I'm building a C# music database app. that manages music files but I am having serious trouble wrapping my head around the initial inserts of all the music MP3s on a hard drive - how do I do the inserts?

I am using the following tables (I have simplified them):

ARTIST table

ARTISTID (PK)

ARTISTNAME

ALBUM table

ALBUMID (PK)

ARTISTID (FK)

ALBUMTITLE

TRACKALBUM

TRACKID(PK)

ALBUMID(FK)

TRACKNUMBER

TRACK

TRACKID

TRACKTITLE

So whats the best way to go about inserting new tracks into this database? I realise this is probably a very simple thing but any help would be VERY MUCH APPRECIATED as this is one of the core functions of my app.

Hi,

The concept of having Foreign key relationships is that you need to have the entry in the parent table to put a referecing key entry in the child table. I would suggest building the tables top-down

1. First populate the Artist table

2. Next populated the Album table and so on

With the referential integrity in place, this would ensure that you do not insert anything in the child table that is not there in the parent table. I am assuming that these tables have one-to-many FK relationships.

The following link could be helpful: http://msdn2.microsoft.com/en-us/library/bb332381.aspx

HTH

Friday, March 9, 2012

RDL vs RDLC

My application is a large windows form app that connects to databases via webservice. The client has no ability to get to the SQL Server. Do I even have an option of using Reporting Services, or do I have to use client deployed reports in RDLC files and pass it a dataset? If so, what are the advantages of using SSRS?

I don't have a problem with this method, since it is pretty much identical to what we do with Crystal Reports, but I want to make sure I understand the alternatives.

Thanks

The FAQ section about the ReportViewer controls may be helpful (e.g. #8): http://www.gotreportviewer.com/

-- Robert