Monday, March 26, 2012
Grant login permission on tables
In my SQL Server 2000, how do I grant a login account permission for tables
in a particular database, using script, not by checking the checkboxes.
There are many tables in that database, and I am thinking using script, it
will be faster.
Thanks for help.
JasonIf the user already exists on the database try some of these
grant select on mytable to user
grant insert on mytable to user
grant update on mytable to user
grant delete on mytable to user
grant select, insert, update, delete on mytable to user
grant all on mytable to user
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"Jason Huang" wrote:
> Hi,
> In my SQL Server 2000, how do I grant a login account permission for tables
> in a particular database, using script, not by checking the checkboxes.
> There are many tables in that database, and I am thinking using script, it
> will be faster.
> Thanks for help.
>
> Jason
>
>|||Hi Jason,
Try this out:
select 'grant Select,Insert,Delete,Update on ' +name+ ' to [Username in
database]' from sysobjects where xtype='U'
Make sure user is already there in database.
Manu
"Jason Huang" wrote:
> Hi,
> In my SQL Server 2000, how do I grant a login account permission for tables
> in a particular database, using script, not by checking the checkboxes.
> There are many tables in that database, and I am thinking using script, it
> will be faster.
> Thanks for help.
>
> Jason
>
>
Grant login permission on tables
In my SQL Server 2000, how do I grant a login account permission for tables
in a particular database, using script, not by checking the checkboxes.
There are many tables in that database, and I am thinking using script, it
will be faster.
Thanks for help.
Jason
If the user already exists on the database try some of these
grant select on mytable to user
grant insert on mytable to user
grant update on mytable to user
grant delete on mytable to user
grant select, insert, update, delete on mytable to user
grant all on mytable to user
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"Jason Huang" wrote:
> Hi,
> In my SQL Server 2000, how do I grant a login account permission for tables
> in a particular database, using script, not by checking the checkboxes.
> There are many tables in that database, and I am thinking using script, it
> will be faster.
> Thanks for help.
>
> Jason
>
>
|||Hi Jason,
Try this out:
select 'grant Select,Insert,Delete,Update on ' +name+ ' to [Username in
database]' from sysobjects where xtype='U'
Make sure user is already there in database.
Manu
"Jason Huang" wrote:
> Hi,
> In my SQL Server 2000, how do I grant a login account permission for tables
> in a particular database, using script, not by checking the checkboxes.
> There are many tables in that database, and I am thinking using script, it
> will be faster.
> Thanks for help.
>
> Jason
>
>
Grant login permission on tables
In my SQL Server 2000, how do I grant a login account permission for tables
in a particular database, using script, not by checking the checkboxes.
There are many tables in that database, and I am thinking using script, it
will be faster.
Thanks for help.
JasonIf the user already exists on the database try some of these
grant select on mytable to user
grant insert on mytable to user
grant update on mytable to user
grant delete on mytable to user
grant select, insert, update, delete on mytable to user
grant all on mytable to user
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"Jason Huang" wrote:
> Hi,
> In my SQL Server 2000, how do I grant a login account permission for table
s
> in a particular database, using script, not by checking the checkboxes.
> There are many tables in that database, and I am thinking using script, it
> will be faster.
> Thanks for help.
>
> Jason
>
>|||Hi Jason,
Try this out:
select 'grant Select,Insert,Delete,Update on ' +name+ ' to [Username in
database]' from sysobjects where xtype='U'
Make sure user is already there in database.
Manu
"Jason Huang" wrote:
> Hi,
> In my SQL Server 2000, how do I grant a login account permission for table
s
> in a particular database, using script, not by checking the checkboxes.
> There are many tables in that database, and I am thinking using script, it
> will be faster.
> Thanks for help.
>
> Jason
>
>
Wednesday, March 21, 2012
Grand totals page
We have a report that includes a list that expands down to 17 inches to accomodate two pages for a report and this list is grouped on a particular location. Each report is grouped by State. So in each state there can be many locations that report various items that comprimse two pages.
Now, what we need is a "state grand total" page and I am wondering about the best way to go about doing this. We do not want to create a new report with a separate stored proc that returns grand totals. What we would like is to do a running total or something like that. I could then include this on a subreport, but I need it to be the last page. For some reason, I thought there was a Report Footer section, but I only see Page Footer.
I hope I made myself clear enough and not being too confusing and I many thanks for any helpful information.
guyinkalamazoo3 wrote:
We do not want to create a new report with a separate stored proc that returns grand totals.
This is how I handle it. The auto total feature in RS is horrific IMO.
Sunday, February 19, 2012
Global Auto Increment Value
Hi ,
In Sybase, there is concept of global autoincrement
The range of default values for a particular database is pn + 1 to p(n + 1), where p is the partition size and n is the value of the public option GLOBAL_DATABASE_ID. For example, if the partition size is 1000 and GLOBAL_DATABASE_ID is set to 3, then the range is from 3001 to 4000
If synchornization is done betrween 2 database . then in server , the new record will be created
The value of increment value would be max value at server +1
For Example
Database id of database(1) is 1
Table A has 3 rows
The values are 1000000001
1000000002
1000000003
This database id of this database(2) is 2
The records in table A in this database 2000000001
2000000002
Then synchronization is performed.
The records from database(2) comes to Database(1)
So the records in Database(1) are
1000000001
1000000002
1000000003
2000000001
2000000002
In sybase , when we insert a new record in Database(1), the new record will be 1000000004
I have transferred this type of sybase database(1) to Sql Server using DTS.
When I create a new record on Sql Server , the new record which is getting inserted is 2000000003. I want the new record to be inserted is 1000000004.
How is it possible..
Thanks in advance
MS SQL does not have any way to do this built in. IDENTITY columns are always unique within the table, not the database.I have simulated what you are talking about by creating a seperate table with just one field of the global increment number and using that.|||
Create a DatabaseID column in each table with the tinyint data type and create a default constraint for it with the database number for the corresponding database. Create an identity column. Make the primary key a compound of the DatabaseID and the identity column.
SQL Server's approach to uniqueness across replicated databases is to use the uniqueidentifier data type with a default value based on calling newid(). If you care about the database that owns the row you'll have to have some kind of DatabaseID column then too though.
|||There is no built-in functionality available to recycle old identity values or gaps. You will have to do that yourself. The link below has a solution that can be used to find gaps in sequential numbers and you can use that to get the next id:
http://www.umachandar.com/technical/SQL6x70Scripts/Main67.htm
Note that you will have to perform the appropriate locking depending on your concurrency requirements to get the correct results.
Giving Active Queries Priority
such as share of the processor?
I have two queries that were started from Query Analyzer. One is very
long, the other rather short. However the long one is taking almost
all the processor resources and not allowing the short one to complete.
I'd like to allocate more of the processor to the short one until it
is done.
I am the admin on this system and have access to Enterprise Mgr.
Thanks.Hi
If you had multiple processors then you may want to look at the maxdop query
hint, or you may want to break your longer running query up so that other
activity can occur. You may also want to look at the query plan to see if
you can optimise the long running query or possibly re-architect the
database/system to remove the need for such intensive processing.
John
<sfarkas@.visa.com> wrote in message
news:1117592953.657773.238730@.o13g2000cwo.googlegr oups.com...
> Is there a way to give a particular query greater system resources,
> such as share of the processor?
> I have two queries that were started from Query Analyzer. One is very
> long, the other rather short. However the long one is taking almost
> all the processor resources and not allowing the short one to complete.
> I'd like to allocate more of the processor to the short one until it
> is done.
> I am the admin on this system and have access to Enterprise Mgr.
> Thanks.