What permissions are required for a user to run a stored procedure which includes the SET IDENTITY_INSERT statement?
Books On Line states:
"Execute permissions [for SET IDENTITY_INSERT] default to the sysadmin fixed server role, and the db_owner and db_ddladmin fixed database roles, and...
You're right, and that would imply that the check constraint could be written:
CHECK (fld1 is null and fld2 is null or isnull(fld1,-1) between 60 and 240 and (isnull(fld2,-1) between 0 and 100))
This does indeed work.
Thanks for your help
Graham
Thanks, that works as desired.
I would like to understand why the first examples don't work, and why SQL Server rearranges the statements in the forms it does. Can anyone explain?
Given a table tblABC, I want to ensure that if a value is entered in field fld1 it is between 60 and 240 and that a value between 0 and 100 is entered in field fld2, or no value is entered for either field fld1 or field fld2. In other words both or neither.
I have tried this:
ALTER TABLE...
Problem:
An Access database (mdb) has a reference to another mdb. Function calls can be made OK in a code module from one to the other. However, function calls made in a toolbar button's onAction property fail. Any suggestions?
Further details:
1. The same structure works fine on some...
Is there an alternative to the correlated subquery. Running the subquery for each row returned by the outer query must be expensive.
Any help greatly appreciated.
Graham Robbins
The following is an example of a correlated subquery:
/*
Ensure that only the most recently added patient contact...
OH YES! YET ANOTHER DATE CONVERSION PROBLEM.
Can anybody explain this mystery? ...
Query issued by client system:
VERSION ISO: UPDATE tblPatientDetails SET Dob = '1948-06-25'
VERSION USA: UPDATE tblPatientDetails SET Dob = '1948-25-06'
SERVER 1: (as reported by @@Version)
Microsoft...
Given a Field (Column) called PhoneNo ... need to SET PhoneNo = '' if supplied value is Null.
SQL DEFAULT is OK for INSERT. How do you do this for UPDATE?
HINTS: Client is Access making the update directly ... so can't use S-PROC.
Don't want NULL to be allowable in Table Def ...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.