Showing posts with label mssql. Show all posts
Showing posts with label mssql. Show all posts

Friday, March 23, 2012

Grant ASPNET all access

hello all,

I would like to grant the MACHINENAME\ASPNET user all acccess to my MSSQL database (i.e tables and stored procedures. I can do this through enterprise manager but id rather do it programatically so i can add it to my database creation script. What is the syntax for this?

I thought it would be along the lines of:

Grant all on databasename to localhost\ASPNET.

But obviously its not! Please help!

thanks

TomIn response to my own question, if anyone needs to know:

exec sp_grantlogin N'machine-name\ASPNET'
go

exec sp_grantlogin N'NT AUTHORITY\NETWORK SERVICE'
go

use dbname
go

exec sp_grantdbaccess
@.loginame = 'machine-name\ASPNET'
go

exec sp_grantdbaccess
@.loginame ='NT AUTHORITY\NETWORK SERVICE'
go

(Rename machinename and dbname to your specifics)

The network service user is required just for windows 2003 i believe, i think on xp and 2000 only ASPNET is needed access.

Tom

GRANT ALTER TRACE in MSSQL 2000

Hi,
How do I acomplish the following in MSSQL Server 2000?
GRANT ALTER TRACE TO <user>;
GRANT VIEW ANY DEFINITION TO <user>;
Thanks
KrassHi Krass
The first is not possible, the second is not necessary.
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://sqlblog.com
"kkantchev@.hotmail.com" <kkantchevhotmailcom@.discussions.microsoft.com>
wrote in message news:E3282092-9BAA-4025-8A8B-1086356E3464@.microsoft.com...
> Hi,
> How do I acomplish the following in MSSQL Server 2000?
> GRANT ALTER TRACE TO <user>;
> GRANT VIEW ANY DEFINITION TO <user>;
> Thanks
> Krass|||Thanks Kalen,
So, I guess user needs to have sysadmin role. Is that correct?
Krass
"Kalen Delaney" wrote:

> Hi Krass
> The first is not possible, the second is not necessary.
> --
> HTH
> Kalen Delaney, SQL Server MVP
> www.InsideSQLServer.com
> http://sqlblog.com
>
> "kkantchev@.hotmail.com" <kkantchevhotmailcom@.discussions.microsoft.com>
> wrote in message news:E3282092-9BAA-4025-8A8B-1086356E3464@.microsoft.com..
.
>
>|||Krass,
On SQL Server 2000, only sysadmins can run SQL Traces.
RLF
"kkantchev@.hotmail.com" <kkantchevhotmailcom@.discussions.microsoft.com>
wrote in message news:6EB6CD69-8E98-4A64-96CB-DDD4316C6036@.microsoft.com...[vbcol=seagreen]
> Thanks Kalen,
> So, I guess user needs to have sysadmin role. Is that correct?
> Krass
> "Kalen Delaney" wrote:
>

Friday, March 9, 2012

good perfmon counter

I found this for useful perfmon counter but I think it was for before Win2K.
http://www.databasejournal.com/features/mssql/article.php/1477311
Does anyone have a good link of something more updated?
TIA, ChrisRYou can find several articles at
http://www.sql-server-performance.com
You could start with:
http://www.sql-server-performance.com/sql_server_performance_audit.asp
-Sue
On Tue, 9 Aug 2005 16:08:45 -0700, "ChrisR"
<noemail@.bla.com> wrote:
>I found this for useful perfmon counter but I think it was for before Win2K.
>http://www.databasejournal.com/features/mssql/article.php/1477311
>Does anyone have a good link of something more updated?
>TIA, ChrisR
>

Wednesday, March 7, 2012

Going to SQL7 DE to SQL 2000 MSDE

Hi All
Does anyone know if there is a path to change a database
from MSSQL 7 Desktop Edition (note, not desktop engine) to
MSDE 2000 ?
Thanks
JI very much doubt that there's some setup program that will upgrade the 7.0
DE to 2000 MSDE. My guess is that you have to use backup/restore or
detach/attach - something that you can't do for the system databases (they
can't cross editions).
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"J" <anonymous@.discussions.microsoft.com> wrote in message
news:05c401c3bed1$a6597a30$a401280a@.phx.gbl...
> Hi All
> Does anyone know if there is a path to change a database
> from MSSQL 7 Desktop Edition (note, not desktop engine) to
> MSDE 2000 ?
> Thanks
> J|||Hi
Do you recommend that I first update the database to SQL
2000 and then do a backup and restore into MSDE?
Do you know where I can find documentation on restoring
into MSDE?
Thanks
J
>--Original Message--
>I very much doubt that there's some setup program that
will upgrade the 7.0
>DE to 2000 MSDE. My guess is that you have to use
backup/restore or
>detach/attach - something that you can't do for the
system databases (they
>can't cross editions).
>--
>Tibor Karaszi, SQL Server MVP
>Archive at:
>http://groups.google.com/groups?
oi=djq&as_ugroup=microsoft.public.sqlserver
>
>"J" <anonymous@.discussions.microsoft.com> wrote in message
>news:05c401c3bed1$a6597a30$a401280a@.phx.gbl...
>> Hi All
>> Does anyone know if there is a path to change a database
>> from MSSQL 7 Desktop Edition (note, not desktop engine)
to
>> MSDE 2000 ?
>> Thanks
>> J
>
>.
>|||I'm not sure. I haven't dealt with MSDE so I don't know about all the setup
quirks that MSDE has. But upping to Personal Edition 2000 first sounds like
a good idea (make it the same service pack as well), because you now have
the option to restore both system and user databases as well. The restore
process is the same for a regular SQL Server, the RESTORE command. I suggest
you post to the msde group, as you might find more specific suggestions
there.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"J" <anonymous@.discussions.microsoft.com> wrote in message
news:1147a01c3bf5f$63eb4ff0$a601280a@.phx.gbl...
> Hi
> Do you recommend that I first update the database to SQL
> 2000 and then do a backup and restore into MSDE?
> Do you know where I can find documentation on restoring
> into MSDE?
> Thanks
> J
>
> >--Original Message--
> >I very much doubt that there's some setup program that
> will upgrade the 7.0
> >DE to 2000 MSDE. My guess is that you have to use
> backup/restore or
> >detach/attach - something that you can't do for the
> system databases (they
> >can't cross editions).
> >
> >--
> >Tibor Karaszi, SQL Server MVP
> >Archive at:
> >http://groups.google.com/groups?
> oi=djq&as_ugroup=microsoft.public.sqlserver
> >
> >
> >"J" <anonymous@.discussions.microsoft.com> wrote in message
> >news:05c401c3bed1$a6597a30$a401280a@.phx.gbl...
> >> Hi All
> >> Does anyone know if there is a path to change a database
> >> from MSSQL 7 Desktop Edition (note, not desktop engine)
> to
> >> MSDE 2000 ?
> >> Thanks
> >> J
> >
> >
> >.
> >

Friday, February 24, 2012

Global Stored Proc Find and Replace

Hello all,
Being a relative newbie to large scale MSSQL development, I'd like to try and find out if there is some sort of utility, command or stored proc that I can use to globally change all text within my database's stored procedures.

For example... I would like to change a table name from dbo.xtable... to dbo.ytable... Is this possible?

Actually, I'd be happy with some way to search through all my stored procs to find a specific string (i.e. xtable in the example above).

Any help provided will be greatly appreciated!

Jordan StradtmanDo you know how to scipt a database?

First off, all sprocs syhould be stored individually in .sql files, preferably in a version control app, or at least on a server...

To do them all script the db and do a search in notepad...|||Notepad?!

What a lame-ass app that is.

PFE32 dude.|||What's a PFE32?|||Programmer's File Editor. Search Google. It's freeware.

Lots and lots of goodies, such as templates, macros, etc. It's basic, small, love it.

Once you use it, you can never go back...|||Here they shoved down our throught this SlickEdit piece of s%$&, and deinstalled my TextPad. Well, thanks for the link, I'll go check it out.|||I should also mention that I have been using PFE for about 6+ years, which might be why I am so attached to it.|||Jordy,

In Enterprise Manager, right-click the database you wish to script, pick "All Tasks", then "Generate SQL Scripts". Click the button "Show All" to list the database objects, the move the objects you wish to script to the right window. There are some check boxes to assist in selecting various groups of object types.

After selecting what you want scripted, click the "Preview" button. When it appears with the scripts for the objects, click the "Copy" button, close up the windows, and paste the scripts into the text editor of your choice.

Stay warm - hope things are going well for you.

-- Greg H., Digital Marketing