Viewing 15 posts - 2,266 through 2,280 (of 7,191 total)
Or create a unique filtered index to avoid the need for a trigger:CREATE UNIQUE INDEX UQ_CustomStudent_personID_value_attributeID
ON dbo.CustomStudent (personID,value,attributeID)
WHERE value = '17'
AND attributeID = '9875'
John
October 6, 2016 at 2:07 am
You haven't given any examples of exactly what you're trying to prevent, but from your description, it sounds as if you could do all this (except the e-mail) with CHECK...
October 5, 2016 at 3:01 am
NineIron (10/4/2016)
I don't get how the cross apply is working. My limited experience is using it like a join. I'm using 2008 Express but, I suppose I could download 12.
The...
October 4, 2016 at 5:37 am
Yes, that's broadly what I had in mind. The reason I thought it more complicated is that my definition of median includes taking the average of the two middle...
October 4, 2016 at 5:29 am
Which bit are you struggling with - the aggregate function and GROUP BY, the CROSS APPLYs, the DATEADD and DATEDIFF, or something else?
Please confirm that you are indeed using SQL...
October 4, 2016 at 4:59 am
Assuming you're running this in SSMS, you can double-click on the error and it'll take you to the line in the code. In this instance, I think it's the...
October 4, 2016 at 2:49 am
Here you go. If you don't feel comfortable changing DATEFIRST, you can do some modulo magic on DATEPART(dw,RegistrationDateTime) so that you get the right numbers.
set DATEFIRST 5 -- set...
October 3, 2016 at 9:58 am
A job can have more than one schedule. It's easier to have multiple schedules than multiple jobs!
John
October 3, 2016 at 9:05 am
Careful, though. Add these rows to your table and try again. I'm sure there are other values that might trip you up, as well.
insert into #Test(ResultValue) values('3E+1')
insert into...
October 3, 2016 at 7:12 am
csb5036 (9/28/2016)
SELECT CustomerName, City, State
FROM Customer, Address
ORDER BY ZipCode ASC, CustomerName ASC
When I execute this code, my return is 16 items instead of 4. Somehow, each customer is being...
September 28, 2016 at 9:13 am
Alex
I've no idea what a PLC is, but I think I can answer your question without knowing! If I were you, I'd put all the PLC variables into a...
September 28, 2016 at 8:31 am
I've never tried using variables in a RESTORE statement before, but something like this should work:USE master;
DECLARE
@DestDB sysname = 'CIFT01'
,@BakFile varchar(260) = 'D:\Microsoft SQL Server\MSSQL11.SQL2012\MSSQL\Backup\2016-09-27_19-00_CIFT01.bak'
,@LogicalDataFile sysname
,@LogicalLogFile sysname;
SELECT
@LogicalDataFile = @DestDB
,@LogicalLogFile =...
September 28, 2016 at 4:42 am
For five databases, I think I'd just write out the RESTORE statement five times and run the whole lot. The database names aren't going to change each time you...
September 28, 2016 at 4:12 am
Ansharah (9/28/2016)
If know clear root cause of this problem. I can avoid in future since its in Prod.
Like I said, someone reseeded the identity. Since you need sysadmin, db_owner...
September 28, 2016 at 4:02 am
It looks as if someone has reseeded the identity at some point. Find out the maximum value of piagam_id, and reseed the identity again to that value plus one.
John
September 28, 2016 at 2:41 am
Viewing 15 posts - 2,266 through 2,280 (of 7,191 total)