Viewing 15 posts - 2,266 through 2,280 (of 7,187 total)
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
If you always have a space in the middle of your postcode, and you want to match everything to the left of the space, change your join predicate to this:
LEFT(N.[Office...
September 27, 2016 at 9:19 am
Mike
Three reasons, really:
(1) To minimise physical fragmentation. If your file grows in small chunks, you're likely to have bits of it scattered all over the disk.
(2) To avoid having...
September 27, 2016 at 8:13 am
Your business rules don't make any sense to me. Why, when you have different values in ReferenceTable2 for City and for State, do the two rows in your expected...
September 27, 2016 at 7:58 am
Find a SQL Server instance that isn't doing anything - a test instance on your desktop/laptop for example. In SSMS, go to Tools -> Options -> SQL Server Object...
September 27, 2016 at 7:21 am
Viewing 15 posts - 2,266 through 2,280 (of 7,187 total)