Showing posts with label batch. Show all posts
Showing posts with label batch. Show all posts

Monday, March 19, 2012

add users in sql server using batch file

I am trying to add user via batch file.
Can anyone help me with a command?
Thanks,
Culam
You can use osql to execute your sql statements. sp_addlogin is used to add a
sql login, while sp_grantLogin is used to add a windows login.
sp_grantdbaccess can be used to add a user to a database. All are described
with examples in BOL.
"culam" wrote:

> I am trying to add user via batch file.
> Can anyone help me with a command?
> Thanks,
> Culam
|||Are you using these?
sp_adduser
sp_addlogin
sp_grantdbaccess
use osql.exe to issue the appropriate commands within the appropriate
database.
It is probably best to create a script (that runs) that you can execute
within Query Analyzer. When you have it working then try using osql.exe.
Keith
"culam" <culam@.discussions.microsoft.com> wrote in message
news:872F105E-90B9-46E6-A8B7-DB5E1A0C9A2D@.microsoft.com...
> I am trying to add user via batch file.
> Can anyone help me with a command?
> Thanks,
> Culam

add users in sql server using batch file

I am trying to add user via batch file.
Can anyone help me with a command?
Thanks,
CulamYou can use osql to execute your sql statements. sp_addlogin is used to add
a
sql login, while sp_grantLogin is used to add a windows login.
sp_grantdbaccess can be used to add a user to a database. All are described
with examples in BOL.
"culam" wrote:

> I am trying to add user via batch file.
> Can anyone help me with a command?
> Thanks,
> Culam|||Are you using these?
sp_adduser
sp_addlogin
sp_grantdbaccess
use osql.exe to issue the appropriate commands within the appropriate
database.
It is probably best to create a script (that runs) that you can execute
within Query Analyzer. When you have it working then try using osql.exe.
Keith
"culam" <culam@.discussions.microsoft.com> wrote in message
news:872F105E-90B9-46E6-A8B7-DB5E1A0C9A2D@.microsoft.com...
> I am trying to add user via batch file.
> Can anyone help me with a command?
> Thanks,
> Culam

Saturday, February 25, 2012

Add events as one batch

Hi,

Can I add collection of events to notification services from my .NET application?

Current implementation in my code:

Code Snippet

// create a new event and event collector

Event myEvent = new Event(application, eventClassName);

EventCollector eventCollector = new EventCollector(application, EVENT_CREATOR);

// Set field values of the event.

.

.

.

// add the event

eventCollector.Write(myEvent);

// commit the 1-event batch

eventCollector.Commit();

Let me know how can I commit collection of events at once rather than one by one.

Please give me your suggestions on this whether this can not be achieved or NOT.

Thanks in advance

Yogendran

Ah... Guys do you know where I can get the answer for this question?

Please help me.

Do you think this cann't be done?

Regards

Yogendran

Thursday, February 9, 2012

Activity in one DB causes time-outs in another

We have several SQL 2000 databases on one server.
One of the applications I'm responsible for has batch jobs that run for an hour; all activity is on the database. During this hour, other applications that use other databases on the same server experience time-outs. One of my coworkers did a count(*) on an empty table and it took 11 seconds.

We pay people to keep our servers up and running. Is this something they might solve by reconfiguring the server? It seems strange to me that a single database is allowed to hog all server resources.
We are meeting with them later this week, and I'd like to have some knowledge about this; we don't want to BS'ed into buying a new server.personally, I would look at optimizing your hour long batch process if at all possible. If you follow the directions in Brett's sticky at the top, I am sure some one would be happy to look over your code for you.|||There's that,yes. Right now it's cursor driven, because, "you know, if we just make some changes to the previous version we'll be done quicker."

Data is read from a file (created at a specific point in time) into a single table, and the batch process consists of two stages: stage one is comparing the new data to what we already have, and create an entry in the log table for every difference. Stage two is changing our data so that it reflects the data in the file, for that particular point in time.

I'm pretty sure that stage one can be done set-based, but I'm not so sure about stage two. The actions required for each row in the new data depend on what's already there in our db.