Tuesday, March 27, 2012
Are Bit Flags Bad?
Any insight would be appreciated.
ThanksI've used integers to store multiple bit states on occasion and found it very usefull.
For instance, you can have multiple boolean security states, and if you think of them as separate boolean values then separate bit fields would seem appropriate. But is you think of them as a single value describing the overall state of the security setting, then you aren't really violating any principles by storing them as a single field.
At a practical level, SQL Server will combine up to eight bit fields and store them internally as a single byte anyway.
Normalization is good practice because it leads to efficient and functional design. But if you avoid an instance where violating it would actually improve an application, then you are letting the cart lead the horse. Normalization is principle, not dogma.|||there is a multitude of examples where M$ itself used...smallint...as a datatype for this type of scenarios. i think int would be an overkill, while following the trend would save you storage space while doing the job.
Tuesday, March 20, 2012
applying transaction logs from a crashed server
server crashes. I can install the server with the same service pack level,
then restore the system databases and then the User databases from the
backups on the new server.
How do we bring in and apply the Transaction logs from the crashed server to
the new server?You mean "the last" log backup? I.e., the log records produced since you produced your most recent
log backup?
It depends on how the server crashed. If the SQL Server is still available, then you just do
BACKUP LOG crashedDb TO .. WITH NO_TRUNCATE
If that SQL Server isn't accessible, then you do the following:
On a working server, create a new database.
Stop that SQL Server.
Delete the database files.
Copy the ldf file from the crashed server in place of the ldf file which you deleted in above step.
Start this SQL Server
BACKUP LOG dbname to ... WITH NO_TRUNCATE
You now have a chain of log backups up until the crash which you can use for your restore. Of
course, all this assumes that you do log backups in the first place and that you can access the ldf
file for your crashed database.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"sharman" <sharman@.discussions.microsoft.com> wrote in message
news:F4187089-40A8-420B-B912-77F1B5A79834@.microsoft.com...
>I would like to know the process to rebuilt a new server if the current
> server crashes. I can install the server with the same service pack level,
> then restore the system databases and then the User databases from the
> backups on the new server.
> How do we bring in and apply the Transaction logs from the crashed server to
> the new server?
Applying the updates to SQL Mobile Server?!
Dear MSDN Support,
Here i am back with an inquiry about the last process of Merge Replication between SQL Mobile 2005 and SQL Server 2005.
Well i have performed all the steps found in the tutorial of the SQL Mobile Edition Books Online, and everything went on so fine and smooth. Now when i deploy my application on the Pocket PC emulator all possible SQL queries work and modify the data only in the emulator, i had installed ActiveSync 4.0 and it synchronizes the SQL Mobile data with the SQL Mobile server only when i copy the database from the emulator to my desktop, and this way is not efficient to my project, i need a better way to synchronize the data between the database on the emulator and that on the SQL Mobile Server.
I'll be looking forward to getting your help as soon as possible.
Thank you for your attention.
Best Regards;
Just FYI: there's no “MSDN support” on these forums, all answers are provided by
volunteers including your fellow developers, MVPs and Microsoft's employees.
|||
Thank you for your notice, and thank you for spotting at my problem!
|||Mr Ahmad,
Just checking - did you figure out how to perform replication from your emulator to SQL Server? I couldn't tell from yor last post if you had solved your issue and are doing ok now. Let us know.
Thanks,
Darren
|||Dear Darren,
I appreciate your reply alot, regarding the replication from the emulator to SQL Server, i had written the following code to my project and i am calling the function synchronize from a simple button.Here is the code i wrote for the Sync.
Dim repl As New SqlCeReplication()
repl.InternetUrl = "http://TOSHIBAMAN/Clinic/sqlcesa30.dll"
repl.Publisher = "TOSHIBAMAN"
repl.PublisherDatabase = "Clinic"
repl.PublisherSecurityMode = SecurityType.NTAuthentication
repl.Publication = "Clinic"
repl.Subscriber = "Clinic"
repl.SubscriberConnectionString = "Data Source=\My Documents\Clinic.sdf; Max Database Size=128;Default Lock Escalation =100;"
Try
repl.AddSubscription(AddOption.ExistingDatabase)
repl.Synchronize()
Catch err As SqlCeException
MessageBox.Show(err.ToString)
End Try
When clicking the button Synchronize the emulator fires the following message:
The SQL Mobile subscription already exists. Publisher, PublisherDatabase,and Publication for
this subscription should be different from any existing subscription
So what i do is to sync the database in the emulator and that in the SQL Mobile through the ActiveSync 4.0 then i connect to my database in the SQL Mobile and expand Replication right click on the subscription and choose to Synchronize the subscription.
But after i read some threads here, and the books online i do believe that there is a way which synchronizes the subscription from the emulator to the SQL Mobile to the original database engine!!
I'll be looking forward to getting your comments and advices.
Thank you alot for your attention!
Best Regards;
|||Mr Ahmed,
Your code is very close - here are some corrections:
1. if you choose to use NT Authentication, you will have to provide the InternetLogin and InternetPassword properties as well. I suggest you start out by just using anonymous authentication until you have the replication working and then add more security afterwards.
2. in the connection string, it is not necessary to say max database size = 128 and Lock Escalation = 100 because these are the default values for SQL Mobile
3. if you are trying to dynamically create the Clinic.sdf SQL Mobile database upon the first merge replication synchronize, then you want to use AddOption.CreateDatabase.
So some sample code would look like this:
Public Function GetReplication() As SqlCeReplication
Dim repl As SqlCeReplication = Nothing
Try
repl = New SqlCeReplication()
repl.InternetUrl = Configuration.GetAppSetting("REPLICATION_URL")
repl.Publisher = Configuration.GetAppSetting("REPLICATION_PUBLISHER")
repl.PublisherDatabase = Configuration.GetAppSetting("REPLICATION_PUBLISHER_DB")
repl.PublisherSecurityMode = SecurityType.NTAuthentication
repl.Publication = Configuration.GetAppSetting("REPLICATION_PUBLICATION")
repl.Subscriber = Configuration.GetAppSetting("REPLICATION_SUBSCRIBER")
repl.SubscriberConnectionString = Configuration.GetAppSetting("REPLICATION_SUBSCRIBER_CONNECTION_STRING")
If Not System.IO.File.Exists(_dbmsFile) Then
repl.AddSubscription(AddOption.CreateDatabase)
End If
Catch ex As Exception
DisplaySQLCEErrors(ex)
Return Nothing
End Try
Return repl
End Function
Where the value of _dbmsFile (in your case) is "\My Documents\Clinic.sdf"
The point of the code sample above is to show you the minumum set of properties you need to set on the SqlCeReplication object in order for it to work, as well as how to handle dynamically creating the SQL Mobile database the first time (if it doesn't already exist)
Since you are using an emulator, you need to ensure that the emulator's network settings are configured to communicate with IIS and SQL Server on the server (which I can see is the same development machine you are running the emulator on). So open Pocket Internet Explorer on the emulator and try the URL http://TOSHIBAMAN/Clinic/sqlcesa30.dll to verify that you can get to the SQL Mobile server tools directory on IIS.
Darren
sqlSunday, March 11, 2012
Apply folder structure in SQL Server 2005
I am in the midst of the process of migrating mdb databases to SQL Server.
Since I have many databases, I want to organize them in a structured tree order, i.e. in folders and subfolders, like the example of "System Databases" folder.
Is it possible? and if the answer is yes, then how?
Any database can be moved to any location which is permitted to the domain account MSSQL is running under . Maybe it's tricky a little for the system databases master and tempdb; anyway all the information can be found on MSDN or BOL. To move user databases see sp_detach_db/sp_attach_db and http://search.msdn.microsoft.com/search/results.aspx?view=msdn&qu=moving+master+database for system db's.|||I presume you mean you want to group them into folders in the GUI. Antoher poster assumed you meant you wanted to move the MDF/LDF files on the file system.
If you're talking about the GUI, the answer is "no" today.
This is not really a work-around, but FYI - it is possible to add extended properties to databases and then write a TSQL query that groups and sorts by the extended property value. In other words, it is possible to define your own database-level attributes and then sort and filter on them.
Thursday, March 8, 2012
Application Security
to import files from our application server to update the database server.
Both servers are Windows 2003 Server Standard Edition. The application laun
ches MS Access 2000 and imp
orts files into an Access database table and then connects to our database s
erver hosting SQL Server 2000 Sp3 to update a master table of users.
The VB app is launched with a local account on the app server and uses a reg
istry value to get the database connection string using SQL Authentication.
We have noticed an authentication error message (Failure Event ID 529) on t
he SQL server for the accou
nt launching the scheduled task that runs the imports. The error only occur
s on the SQL server when a load occurs on the application server. The load
occurs when users run a Web .ASP application and run end of month procedures
. It connects to the same
SQL server with the same SQL Authenticated credentials.
The import VB application does not start to authenticate unless a load is pr
esent on the server. Why would the security context change and go away from
SQL authentication' The work around so far is to use a domain account or
mirrored account on the SQL
server.
Thanks.It sounds like the VB application is using a connection string that is
requesting Windows Authentication. This is why it works if you
use a domain account or duplicate the user account and passwords. Check
the Security tab in Enterprise manager and verify that you are allowing
both SQL and Windows Authentication. Enable auditing for both failed and
successfull logins and test using both standard and Windows authentication
to validate the logging.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.
Saturday, February 25, 2012
application process don't continue after run trigger
There is an application about cashier application process. I'd
wrote a trigger for send information messages to users. Send an e-mail
message when TransactType equal to db. But there is a problem, e-mail
message is sending but other application process is not continue and
record is not write to MSSQL database when TransactType equal to db.
Have any suggestion? Why is not application process continue after run
the Trigger proccess.
MSSQL version 7.0
Thanks.
CREATE TRIGGER sendmail_trigger ON [Transact]
FOR INSERT
AS
DECLARE
@.ptype varchar (100),
@.psubject varchar (100),
@.pacctid varchar (100),
@.ptransactamount varchar (100),
@.premail varchar (100),
@.pmessage varchar (900),
@.pname varchar (100)
set @.ptype = (select TransactType from Inserted)
if (@.ptype = 'db')
begin
set @.pacctid = (select AcctID from Inserted)
set @.ptransactamount = (select TransactAmount/-50 from Inserted)
set @.premail = (SELECT EmailAddress FROM Users WHERE AcctID=@.pacctid)
set @.pname = (SELECT UserName FROM Users WHERE AcctID=@.pacctid)
set @.psubject = 'Information Message'
set @.pmessage =
'Dear '+ @.pname+',
Debit '+ @.ptransactamount + ' your account.
For your information.'
EXEC master..xp_sendmail @.recipients = @.premail,
@.blind_copy_recipients = 'xxx@.yyy.zzz',
@.subject = @.psubject, @.message = @.pmessage
end
It is possible that you are getting an error, which may cause a scope
abort... Scope aborts do NOT return control back to the calling Sp etc, they
merely exit...
Comment out lines of code one at a time and see if you can find the line
which is hurting you... I suspect the email send may be causing the
problem...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"U A" <umuta@.sabanciuniv.edu> wrote in message
news:u1YkANWSEHA.2408@.tk2msftngp13.phx.gbl...
> Hi,
> There is an application about cashier application process. I'd
> wrote a trigger for send information messages to users. Send an e-mail
> message when TransactType equal to db. But there is a problem, e-mail
> message is sending but other application process is not continue and
> record is not write to MSSQL database when TransactType equal to db.
> Have any suggestion? Why is not application process continue after run
> the Trigger proccess.
> MSSQL version 7.0
> Thanks.
> --
> CREATE TRIGGER sendmail_trigger ON [Transact]
> FOR INSERT
> AS
> DECLARE
> @.ptype varchar (100),
> @.psubject varchar (100),
> @.pacctid varchar (100),
> @.ptransactamount varchar (100),
> @.premail varchar (100),
> @.pmessage varchar (900),
> @.pname varchar (100)
> set @.ptype = (select TransactType from Inserted)
> if (@.ptype = 'db')
> begin
> set @.pacctid = (select AcctID from Inserted)
> set @.ptransactamount = (select TransactAmount/-50 from Inserted)
> set @.premail = (SELECT EmailAddress FROM Users WHERE AcctID=@.pacctid)
> set @.pname = (SELECT UserName FROM Users WHERE AcctID=@.pacctid)
> set @.psubject = 'Information Message'
> set @.pmessage =
> 'Dear '+ @.pname+',
> Debit '+ @.ptransactamount + ' your account.
> For your information.'
> EXEC master..xp_sendmail @.recipients = @.premail,
> @.blind_copy_recipients = 'xxx@.yyy.zzz',
> @.subject = @.psubject, @.message = @.pmessage
> end
> --
>
|||Many thanks. I had comment out line of EXEC master..xp_sendmail. Process
successfuly finished. But e-mail didn't send. What can I do for send
e-mail automatically this trigger method?
thanks.
On 03-06-2004 15:30, Wayne Snyder wrote:
> It is possible that you are getting an error, which may cause a scope
> abort... Scope aborts do NOT return control back to the calling Sp etc, they
> merely exit...
> Comment out lines of code one at a time and see if you can find the line
> which is hurting you... I suspect the email send may be causing the
> problem...
>
|||I suggest you don't send email from the trigger. Have the trigger to insert necessary information into a table
and create a job which runs every x minutes that reads off of this table and does the email sending.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"U A" <umuta@.sabanciuniv.edu> wrote in message news:e144dYXSEHA.3872@.TK2MSFTNGP10.phx.gbl...
> Many thanks. I had comment out line of EXEC master..xp_sendmail. Process
> successfuly finished. But e-mail didn't send. What can I do for send
> e-mail automatically this trigger method?
> thanks.
>
> On 03-06-2004 15:30, Wayne Snyder wrote:
>
|||Thanks your suggestion but it gave same error. I had insert the records
to a new table and send e-mail with a remote perl script. I think,
trigger occasion exits from application.
thanks.
On 03-06-2004 18:55, Tibor Karaszi wrote:
> I suggest you don't send email from the trigger. Have the trigger to insert necessary
information into a table and create a job which runs every x minutes
that reads off of
this table and does the email sending.
application process don't continue after run trigger
There is an application about cashier application process. I'd
wrote a trigger for send information messages to users. Send an e-mail
message when TransactType equal to db. But there is a problem, e-mail
message is sending but other application process is not continue and
record is not write to MSSQL database when TransactType equal to db.
Have any suggestion? Why is not application process continue after run
the Trigger proccess.
MSSQL version 7.0
Thanks.
--
CREATE TRIGGER sendmail_trigger ON [Transact]
FOR INSERT
AS
DECLARE
@.ptype varchar (100),
@.psubject varchar (100),
@.pacctid varchar (100),
@.ptransactamount varchar (100),
@.premail varchar (100),
@.pmessage varchar (900),
@.pname varchar (100)
set @.ptype = (select TransactType from Inserted)
if (@.ptype = 'db')
begin
set @.pacctid = (select AcctID from Inserted)
set @.ptransactamount = (select TransactAmount/-50 from Inserted)
set @.premail = (SELECT EmailAddress FROM Users WHERE AcctID=@.pacctid)
set @.pname = (SELECT UserName FROM Users WHERE AcctID=@.pacctid)
set @.psubject = 'Information Message'
set @.pmessage =
'Dear '+ @.pname+',
Debit '+ @.ptransactamount + ' your account.
For your information.'
EXEC master..xp_sendmail @.recipients = @.premail,
@.blind_copy_recipients = 'xxx@.yyy.zzz',
@.subject = @.psubject, @.message = @.pmessage
end
--It is possible that you are getting an error, which may cause a scope
abort... Scope aborts do NOT return control back to the calling Sp etc, they
merely exit...
Comment out lines of code one at a time and see if you can find the line
which is hurting you... I suspect the email send may be causing the
problem...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"U A" <umuta@.sabanciuniv.edu> wrote in message
news:u1YkANWSEHA.2408@.tk2msftngp13.phx.gbl...
> Hi,
> There is an application about cashier application process. I'd
> wrote a trigger for send information messages to users. Send an e-mail
> message when TransactType equal to db. But there is a problem, e-mail
> message is sending but other application process is not continue and
> record is not write to MSSQL database when TransactType equal to db.
> Have any suggestion? Why is not application process continue after run
> the Trigger proccess.
> MSSQL version 7.0
> Thanks.
> --
> CREATE TRIGGER sendmail_trigger ON [Transact]
> FOR INSERT
> AS
> DECLARE
> @.ptype varchar (100),
> @.psubject varchar (100),
> @.pacctid varchar (100),
> @.ptransactamount varchar (100),
> @.premail varchar (100),
> @.pmessage varchar (900),
> @.pname varchar (100)
> set @.ptype = (select TransactType from Inserted)
> if (@.ptype = 'db')
> begin
> set @.pacctid = (select AcctID from Inserted)
> set @.ptransactamount = (select TransactAmount/-50 from Inserted)
> set @.premail = (SELECT EmailAddress FROM Users WHERE AcctID=@.pacctid)
> set @.pname = (SELECT UserName FROM Users WHERE AcctID=@.pacctid)
> set @.psubject = 'Information Message'
> set @.pmessage =
> 'Dear '+ @.pname+',
> Debit '+ @.ptransactamount + ' your account.
> For your information.'
> EXEC master..xp_sendmail @.recipients = @.premail,
> @.blind_copy_recipients = 'xxx@.yyy.zzz',
> @.subject = @.psubject, @.message = @.pmessage
> end
> --
>|||Many thanks. I had comment out line of EXEC master..xp_sendmail. Process
successfuly finished. But e-mail didn't send. What can I do for send
e-mail automatically this trigger method?
thanks.
On 03-06-2004 15:30, Wayne Snyder wrote:
> It is possible that you are getting an error, which may cause a scope
> abort... Scope aborts do NOT return control back to the calling Sp etc, th
ey
> merely exit...
> Comment out lines of code one at a time and see if you can find the line
> which is hurting you... I suspect the email send may be causing the
> problem...
>|||I suggest you don't send email from the trigger. Have the trigger to insert
necessary information into a table
and create a job which runs every x minutes that reads off of this table and
does the email sending.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"U A" <umuta@.sabanciuniv.edu> wrote in message news:e144dYXSEHA.3872@.TK2MSFTNGP10.phx.gbl...
> Many thanks. I had comment out line of EXEC master..xp_sendmail. Process
> successfuly finished. But e-mail didn't send. What can I do for send
> e-mail automatically this trigger method?
> thanks.
>
> On 03-06-2004 15:30, Wayne Snyder wrote:
>|||Thanks your suggestion but it gave same error. I had insert the records
to a new table and send e-mail with a remote PERL script. I think,
trigger occasion exits from application.
thanks.
On 03-06-2004 18:55, Tibor Karaszi wrote:
> I suggest you don't send email from the trigger. Have the trigger to insert necess
ary
information into a table and create a job which runs every x minutes
that reads off of
this table and does the email sending.
application process don't continue after run trigger
There is an application about cashier application process. I'd
wrote a trigger for send information messages to users. Send an e-mail
message when TransactType equal to db. But there is a problem, e-mail
message is sending but other application process is not continue and
record is not write to MSSQL database when TransactType equal to db.
Have any suggestion? Why is not application process continue after run
the Trigger proccess.
MSSQL version 7.0
Thanks.
--
CREATE TRIGGER sendmail_trigger ON [Transact]
FOR INSERT
AS
DECLARE
@.ptype varchar (100),
@.psubject varchar (100),
@.pacctid varchar (100),
@.ptransactamount varchar (100),
@.premail varchar (100),
@.pmessage varchar (900),
@.pname varchar (100)
set @.ptype = (select TransactType from Inserted)
if (@.ptype = 'db')
begin
set @.pacctid = (select AcctID from Inserted)
set @.ptransactamount = (select TransactAmount/-50 from Inserted)
set @.premail = (SELECT EmailAddress FROM Users WHERE AcctID=@.pacctid)
set @.pname = (SELECT UserName FROM Users WHERE AcctID=@.pacctid)
set @.psubject = 'Information Message'
set @.pmessage = 'Dear '+ @.pname+',
Debit '+ @.ptransactamount + ' your account.
For your information.'
EXEC master..xp_sendmail @.recipients = @.premail,
@.blind_copy_recipients = 'xxx@.yyy.zzz',
@.subject = @.psubject, @.message = @.pmessage
end
--It is possible that you are getting an error, which may cause a scope
abort... Scope aborts do NOT return control back to the calling Sp etc, they
merely exit...
Comment out lines of code one at a time and see if you can find the line
which is hurting you... I suspect the email send may be causing the
problem...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"U A" <umuta@.sabanciuniv.edu> wrote in message
news:u1YkANWSEHA.2408@.tk2msftngp13.phx.gbl...
> Hi,
> There is an application about cashier application process. I'd
> wrote a trigger for send information messages to users. Send an e-mail
> message when TransactType equal to db. But there is a problem, e-mail
> message is sending but other application process is not continue and
> record is not write to MSSQL database when TransactType equal to db.
> Have any suggestion? Why is not application process continue after run
> the Trigger proccess.
> MSSQL version 7.0
> Thanks.
> --
> CREATE TRIGGER sendmail_trigger ON [Transact]
> FOR INSERT
> AS
> DECLARE
> @.ptype varchar (100),
> @.psubject varchar (100),
> @.pacctid varchar (100),
> @.ptransactamount varchar (100),
> @.premail varchar (100),
> @.pmessage varchar (900),
> @.pname varchar (100)
> set @.ptype = (select TransactType from Inserted)
> if (@.ptype = 'db')
> begin
> set @.pacctid = (select AcctID from Inserted)
> set @.ptransactamount = (select TransactAmount/-50 from Inserted)
> set @.premail = (SELECT EmailAddress FROM Users WHERE AcctID=@.pacctid)
> set @.pname = (SELECT UserName FROM Users WHERE AcctID=@.pacctid)
> set @.psubject = 'Information Message'
> set @.pmessage => 'Dear '+ @.pname+',
> Debit '+ @.ptransactamount + ' your account.
> For your information.'
> EXEC master..xp_sendmail @.recipients = @.premail,
> @.blind_copy_recipients = 'xxx@.yyy.zzz',
> @.subject = @.psubject, @.message = @.pmessage
> end
> --
>|||Many thanks. I had comment out line of EXEC master..xp_sendmail. Process
successfuly finished. But e-mail didn't send. What can I do for send
e-mail automatically this trigger method?
thanks.
On 03-06-2004 15:30, Wayne Snyder wrote:
> It is possible that you are getting an error, which may cause a scope
> abort... Scope aborts do NOT return control back to the calling Sp etc, they
> merely exit...
> Comment out lines of code one at a time and see if you can find the line
> which is hurting you... I suspect the email send may be causing the
> problem...
>|||I suggest you don't send email from the trigger. Have the trigger to insert necessary information into a table
and create a job which runs every x minutes that reads off of this table and does the email sending.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"U A" <umuta@.sabanciuniv.edu> wrote in message news:e144dYXSEHA.3872@.TK2MSFTNGP10.phx.gbl...
> Many thanks. I had comment out line of EXEC master..xp_sendmail. Process
> successfuly finished. But e-mail didn't send. What can I do for send
> e-mail automatically this trigger method?
> thanks.
>
> On 03-06-2004 15:30, Wayne Snyder wrote:
> > It is possible that you are getting an error, which may cause a scope
> > abort... Scope aborts do NOT return control back to the calling Sp etc, they
> > merely exit...
> >
> > Comment out lines of code one at a time and see if you can find the line
> > which is hurting you... I suspect the email send may be causing the
> > problem...
> >
>|||Thanks your suggestion but it gave same error. I had insert the records
to a new table and send e-mail with a remote perl script. I think,
trigger occasion exits from application.
thanks.
On 03-06-2004 18:55, Tibor Karaszi wrote:
> I suggest you don't send email from the trigger. Have the trigger to insert necessary
information into a table and create a job which runs every x minutes
that reads off of
this table and does the email sending.
application login , but user security
We are in the process of migrating from mainframe application using
vsam files to MICROFOCUS and SQL server
Here is the senario we are at now :
In mainframe, the application might be able to read and write to the
file, but the write access is controled by the RACF (security software
like active directory). In other words, even though USER A can execute
the application, he cannot write to it, because the security software
doesn't allow USER A to write to the file.
In the new environment, our online application are replaced by a
product called MICROFOCUS -ES_MTO. ES-MTO connects to sqlserver via an
application userid (lets say APPL1). USERA logins in to the ES-MTO
using login id USERA, but then ES-MTO connects to sqlserver using
APPL1. APPL1 has read/write authority on the tables. USERA should be
able to execute the application, so he can read the table, but
shouldn't be able to write to it.
The application is however a read/write application.
I hope I was clear enough on my sceneraio.
What I am hoping to find out is, how can I still use sqlserver to check
permission using the real user login id , when the application uses the
application userid to connect ?
Am I making sense ?
Any help or input is greatly appreciated .
ThanksSQL Server security context is determined by the login used to connect to
SQL Server or an application role enabled after the connection is made. If
ES_MTO uses a single login, you won't be able to implement a SQL Server
security model that allows you to control access based on an individual
user's identity unless your application code can conditionally enable an
application role. I know nothing about ES_MTO so I can't comment on whether
or not that approach is feasible. You can read about application roles in
the SQL Server Books Online
Hope this helps.
Dan Guzman
SQL Server MVP
"sql rookie" <anytasks@.gmail.com> wrote in message
news:1114703232.008696.232480@.g14g2000cwa.googlegroups.com...
> Hi everybody...please don't flame me for my ignorance.
> We are in the process of migrating from mainframe application using
> vsam files to MICROFOCUS and SQL server
> Here is the senario we are at now :
> In mainframe, the application might be able to read and write to the
> file, but the write access is controled by the RACF (security software
> like active directory). In other words, even though USER A can execute
> the application, he cannot write to it, because the security software
> doesn't allow USER A to write to the file.
> In the new environment, our online application are replaced by a
> product called MICROFOCUS -ES_MTO. ES-MTO connects to sqlserver via an
> application userid (lets say APPL1). USERA logins in to the ES-MTO
> using login id USERA, but then ES-MTO connects to sqlserver using
> APPL1. APPL1 has read/write authority on the tables. USERA should be
> able to execute the application, so he can read the table, but
> shouldn't be able to write to it.
> The application is however a read/write application.
> I hope I was clear enough on my sceneraio.
> What I am hoping to find out is, how can I still use sqlserver to check
> permission using the real user login id , when the application uses the
> application userid to connect ?
> Am I making sense ?
> Any help or input is greatly appreciated .
> Thanks
>|||sql rookie wrote:
What I am hoping to find out is, how can I still use sqlserver to check
permission using the real user login id , when the application uses the
application userid to connect ?
Am I making sense ?
My response:
I am unsure what you mean by using 'sqlserver to check permission using the
real user login id'?
If you setup the security on the MicroFocus environment using SQLServer
security (uid and password). This userid can be granted R/W access to the
tables while the real user id will not be granted them. You can then contro
l
access to writing/updating the tables via the application. If you want/need
to have the user be able to read the information outside of the application
(Access linked tables, Excel Queries, etc) you can grant the 'real user id'
read access to the tables/views.
Does this cover your question'
Mike
--
Mike Mattix
CP Kelco, Inc
Okmulgee, OK
"sql rookie" wrote:
> Hi everybody...please don't flame me for my ignorance.
> We are in the process of migrating from mainframe application using
> vsam files to MICROFOCUS and SQL server
> Here is the senario we are at now :
> In mainframe, the application might be able to read and write to the
> file, but the write access is controled by the RACF (security software
> like active directory). In other words, even though USER A can execute
> the application, he cannot write to it, because the security software
> doesn't allow USER A to write to the file.
> In the new environment, our online application are replaced by a
> product called MICROFOCUS -ES_MTO. ES-MTO connects to sqlserver via an
> application userid (lets say APPL1). USERA logins in to the ES-MTO
> using login id USERA, but then ES-MTO connects to sqlserver using
> APPL1. APPL1 has read/write authority on the tables. USERA should be
> able to execute the application, so he can read the table, but
> shouldn't be able to write to it.
> The application is however a read/write application.
> I hope I was clear enough on my sceneraio.
> What I am hoping to find out is, how can I still use sqlserver to check
> permission using the real user login id , when the application uses the
> application userid to connect ?
> Am I making sense ?
> Any help or input is greatly appreciated .
> Thanks
>
Friday, February 24, 2012
Application Event ID 17177
application event log:
quote:
>This instance of SQL Server has been using a process id
>of 204 since 1/15/04 8:36:46 PM (local) 1/16/04 3:36:46
>AM (UTC).
Why is this generated? What is the significance of this
information?This is an informational message and can be ignored.
Hope this helps.
Dan Guzman
SQL Server MVP
"Gary Brunton" <gary_brunton@.hotmail.com> wrote in message
news:6b3001c3e6a0$238ee8f0$a001280a@.phx.gbl...
quote:|||We have a client who is getting the same error except it says a different pr
> I periodically get the following information from the
> application event log:
>
> Why is this generated? What is the significance of this
> information?
>
ocess id. The problem is it is showing up at 12:00 every night when sql ser
ver is supposed to backup to the Microsoft SQL Server\MSSQL\Backup folder.
When I view the dat files i
n the directory they are from November, needless to say not current. When I
am in the SQL enterprise manager under management- sql server agent-jobs, I
can see the separate jobs and when I look at the properties they are schedu
led for daily @. 12:00 am.
Why am I not getting updated files in the backup folder? Ntbackup is runni
ng nightly with no errors and is backing up all sql database files along wit
h this MSSQL\Backup folder but the files in it are not current. Ntbackup is
backing up to 4mmtape. An
y help guys would be greatly appreciated.
Phil
Application Event ID 17177
application event log:
>This instance of SQL Server has been using a process id
>of 204 since 1/15/04 8:36:46 PM (local) 1/16/04 3:36:46
>AM (UTC).
Why is this generated? What is the significance of this
information?This is an informational message and can be ignored.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Gary Brunton" <gary_brunton@.hotmail.com> wrote in message
news:6b3001c3e6a0$238ee8f0$a001280a@.phx.gbl...
> I periodically get the following information from the
> application event log:
> >This instance of SQL Server has been using a process id
> >of 204 since 1/15/04 8:36:46 PM (local) 1/16/04 3:36:46
> >AM (UTC).
> Why is this generated? What is the significance of this
> information?
>|||We have a client who is getting the same error except it says a different process id. The problem is it is showing up at 12:00 every night when sql server is supposed to backup to the Microsoft SQL Server\MSSQL\Backup folder. When I view the dat files in the directory they are from November, needless to say not current. When I am in the SQL enterprise manager under management- sql server agent-jobs, I can see the separate jobs and when I look at the properties they are scheduled for daily @. 12:00 am. Why am I not getting updated files in the backup folder? Ntbackup is running nightly with no errors and is backing up all sql database files along with this MSSQL\Backup folder but the files in it are not current. Ntbackup is backing up to 4mmtape. Any help guys would be greatly appreciated
Phil
Application
allow me to do some sort of process billing? Used to be quite common in the
old days, to bill back users for their usage. Since I have a hosted
application, I want to bill for CPU usage.
I know that I can use SQL Profiler, but was hoping for an agent or service
that would allow me to bill based on DB or User.
See my post in the microsoft.public.sqlserver.server thread.
----
-
Need SQL Server Examples check out my website
http://www.geocities.com/sqlserverexamples
"Kevin Antel" <kevina@.cqlcorp.com> wrote in message
news:%23IBOkgH3EHA.1192@.tk2msftngp13.phx.gbl...
> Does anyone know of an agent/application that runs on SQL Server that will
> allow me to do some sort of process billing? Used to be quite common in
the
> old days, to bill back users for their usage. Since I have a hosted
> application, I want to bill for CPU usage.
> I know that I can use SQL Profiler, but was hoping for an agent or service
> that would allow me to bill based on DB or User.
>
Application
allow me to do some sort of process billing? Used to be quite common in the
old days, to bill back users for their usage. Since I have a hosted
application, I want to bill for CPU usage.
I know that I can use SQL Profiler, but was hoping for an agent or service
that would allow me to bill based on DB or User.I would set up a server side trace that logged the the events that you need
to a sql server table. Here is an article I wrote on the subject that
might help you get started with server side tracing:
http://www.dbazine.com/larsen6.shtml
--
----
----
-
Need SQL Server Examples check out my website
http://www.geocities.com/sqlserverexamples
"Kevin Antel" <kevina@.cqlcorp.com> wrote in message
news:%23M5QpgH3EHA.1524@.TK2MSFTNGP09.phx.gbl...
> Does anyone know of an agent/application that runs on SQL Server that will
> allow me to do some sort of process billing? Used to be quite common in
the
> old days, to bill back users for their usage. Since I have a hosted
> application, I want to bill for CPU usage.
> I know that I can use SQL Profiler, but was hoping for an agent or service
> that would allow me to bill based on DB or User.
>
Application
allow me to do some sort of process billing? Used to be quite common in the
old days, to bill back users for their usage. Since I have a hosted
application, I want to bill for CPU usage.
I know that I can use SQL Profiler, but was hoping for an agent or service
that would allow me to bill based on DB or User.
I would set up a server side trace that logged the the events that you need
to a sql server table. Here is an article I wrote on the subject that
might help you get started with server side tracing:
http://www.dbazine.com/larsen6.shtml
----
-
Need SQL Server Examples check out my website
http://www.geocities.com/sqlserverexamples
"Kevin Antel" <kevina@.cqlcorp.com> wrote in message
news:%23M5QpgH3EHA.1524@.TK2MSFTNGP09.phx.gbl...
> Does anyone know of an agent/application that runs on SQL Server that will
> allow me to do some sort of process billing? Used to be quite common in
the
> old days, to bill back users for their usage. Since I have a hosted
> application, I want to bill for CPU usage.
> I know that I can use SQL Profiler, but was hoping for an agent or service
> that would allow me to bill based on DB or User.
>
Sunday, February 19, 2012
Appending Backedup data During Restore Process
Can i append new database backup to the existing data, while restoring the backedup database? If so give me the solution. I had backups for 30 days backup and trying to restore all these bckups..
During the restore process, i had observed that the previsous data is getting deleted and new data is replaced on it (in the database). But i want to append the new data to the existing data.
Note : The backup format that i had taken for all these 30 days is of Full Backup (not differential backup)
Any solution(s) for the above stated...
Regards,Not possible using FULL BACKUP, you can use TLOG Backups to restore them on this server.
Appending a custom sql where clause
I am in the process of evaluating SSRS 2005 to replace an home grown
reporting tool. In my reporting application all users have access all
the tables\fields in the database. In the home grown tool, data
security is implemented by the following mechanism. When users run
reports, a standard sql where clause is appended to the sql generated
by the reproting tool. This standard where clause has @.userID as the
parameter.
Now is there a way in SSRS 2005 I can append a standard where clause to
every report just before it is run? Does it have an event model, I can
hook into?
Thanks
_Gigi JKIn most cases query parameters are mapped to report parameters but they do
not have to be, they can be mapped to expressions. When mapping a query
parameter to an expression you can map the query parameter to a global
variable. One of the global variables available is User!UserID. This
variable has the user (and their domain). If you don't want the domain then
you would strip the domain off.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<gigijk@.gmail.com> wrote in message
news:1137098143.325204.240880@.g47g2000cwa.googlegroups.com...
> Hello,
> I am in the process of evaluating SSRS 2005 to replace an home grown
> reporting tool. In my reporting application all users have access all
> the tables\fields in the database. In the home grown tool, data
> security is implemented by the following mechanism. When users run
> reports, a standard sql where clause is appended to the sql generated
> by the reproting tool. This standard where clause has @.userID as the
> parameter.
> Now is there a way in SSRS 2005 I can append a standard where clause to
> every report just before it is run? Does it have an event model, I can
> hook into?
> Thanks
> _Gigi JK
>|||Bruce,
Thanks for the reply. Sorry I sent the same question to you directly from my
gmail address as well.
In my case, reporting application will be intergrated into another
application which does not use NT auth. Is there a way I could pass in userID
to reporting tool?
On the original issue, what I want to do is to automatically append a where
clause ( for eg: 'AND sysem_id IN (SELECT System_id FROM Mdu_system where
user_id=@.userID') to every query generated by the reporting tool withou the
user intervention. Would this be posssible.
Once again thank you.
_GJK
"Bruce L-C [MVP]" wrote:
> In most cases query parameters are mapped to report parameters but they do
> not have to be, they can be mapped to expressions. When mapping a query
> parameter to an expression you can map the query parameter to a global
> variable. One of the global variables available is User!UserID. This
> variable has the user (and their domain). If you don't want the domain then
> you would strip the domain off.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> <gigijk@.gmail.com> wrote in message
> news:1137098143.325204.240880@.g47g2000cwa.googlegroups.com...
> > Hello,
> > I am in the process of evaluating SSRS 2005 to replace an home grown
> > reporting tool. In my reporting application all users have access all
> > the tables\fields in the database. In the home grown tool, data
> > security is implemented by the following mechanism. When users run
> > reports, a standard sql where clause is appended to the sql generated
> > by the reproting tool. This standard where clause has @.userID as the
> > parameter.
> >
> > Now is there a way in SSRS 2005 I can append a standard where clause to
> > every report just before it is run? Does it have an event model, I can
> > hook into?
> >
> > Thanks
> > _Gigi JK
> >
>
>|||You can have a hidden parameter (i.e. it does not prompt for it but you can
include it when running the report).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"GJK" <GJK@.discussions.microsoft.com> wrote in message
news:D37B86F8-AA55-4FF1-BC01-C426D806AF02@.microsoft.com...
> Bruce,
> Thanks for the reply. Sorry I sent the same question to you directly from
> my
> gmail address as well.
> In my case, reporting application will be intergrated into another
> application which does not use NT auth. Is there a way I could pass in
> userID
> to reporting tool?
> On the original issue, what I want to do is to automatically append a
> where
> clause ( for eg: 'AND sysem_id IN (SELECT System_id FROM Mdu_system where
> user_id=@.userID') to every query generated by the reporting tool withou
> the
> user intervention. Would this be posssible.
> Once again thank you.
> _GJK
> "Bruce L-C [MVP]" wrote:
>> In most cases query parameters are mapped to report parameters but they
>> do
>> not have to be, they can be mapped to expressions. When mapping a query
>> parameter to an expression you can map the query parameter to a global
>> variable. One of the global variables available is User!UserID. This
>> variable has the user (and their domain). If you don't want the domain
>> then
>> you would strip the domain off.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> <gigijk@.gmail.com> wrote in message
>> news:1137098143.325204.240880@.g47g2000cwa.googlegroups.com...
>> > Hello,
>> > I am in the process of evaluating SSRS 2005 to replace an home grown
>> > reporting tool. In my reporting application all users have access all
>> > the tables\fields in the database. In the home grown tool, data
>> > security is implemented by the following mechanism. When users run
>> > reports, a standard sql where clause is appended to the sql generated
>> > by the reproting tool. This standard where clause has @.userID as the
>> > parameter.
>> >
>> > Now is there a way in SSRS 2005 I can append a standard where clause to
>> > every report just before it is run? Does it have an event model, I can
>> > hook into?
>> >
>> > Thanks
>> > _Gigi JK
>> >
>>
Thursday, February 16, 2012
Append error in text file
I want to loog all error in the process but a each command the file was reseted... who can I append the error in a text file??:confused:
Command exemples:
isqlw.exe -S %SERVER_NAME% -E -d master -o log_install.log - i install.sql
echo ...
isqlw.exe -S %SERVER_NAME% -E -d %DATABASE_NAME% -o log_install.log -i create_table.sql
At the end only error in create_table.sql was there!!
Who can I do??:confused:
thanksHowdy
Try coding the job as a job, not iSQL. Then you CAN append output to a file in the Advanced section of the job step.
Cheers
SG
Sunday, February 12, 2012
Anyway to trace the origin of a SPID once server is rebooted?
Process 49 unlocking unowned resource: DB: 1
and SQL server stopped and tried to recover.
In a panic my team rebooted the server (which resolved the issue)
Since the reboot occurred I couldn't see what was SPID 49.
After the reboot is there a way in the sys tables to see what SPID49 was at
a given time?
Jeff
--
Message posted via http://www.sqlmonster.comNo
--
Andrew J. Kelly SQL MVP
"Jeffrey Sheldon via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:d871d8b5bf1642a6bfca78c03646a764@.SQLMonster.com...
> Received a db error when I was in a conference
> Process 49 unlocking unowned resource: DB: 1
> and SQL server stopped and tried to recover.
> In a panic my team rebooted the server (which resolved the issue)
> Since the reboot occurred I couldn't see what was SPID 49.
> After the reboot is there a way in the sys tables to see what SPID49 was
> at
> a given time?
> Jeff
> --
> Message posted via http://www.sqlmonster.com