Viewing 15 posts - 976 through 990 (of 1,192 total)
I'm glad that helped, and I'll be happy to step through it as best I can!
So, the core of the solution is the ROW_NUMBER() function. It does exactly what you'd...
June 20, 2015 at 11:23 am
Perhaps something like this?
First your sample data:
SET DATEFORMAT dmy
DECLARE @Seasons TABLE (ItemNo int, Colour char(10), Season char(4),PeriodStart date, PeriodEnd date)
INSERT INTO @Seasons
SELECT 225441, 'MELON','HE12','29/04/2012','05/05/2012'
UNION ALL
SELECT 225441, 'MELON','HE12','06/05/2012','12/05/2012'
UNION ALL
SELECT 225441, 'MELON','HE12','13/05/2012','19/05/2012'
UNION...
June 20, 2015 at 11:02 am
This should be pretty straightforward with a CTE and ROW_NUMBER.
Something like this:
WITH OrderedByDate AS (
SELECT
RN=ROW_NUMBER() OVER (PARTITION BY target_currency ORDER BY date_l desc),
target_currency,
rate_exchange,
date_l
FROM rates)
SELECT target_currency as [Currency],
rate_exchange AS [Rate],
date_l...
June 20, 2015 at 9:20 am
Maybe something like this?
declare @artefacts table (id int, name char(10), type char(10))
declare @relationships table (parent int, child int)
insert into @artefacts values
(1, 'myInstance', 'Instance'),
(2, 'mySite', 'Site'),
(3, 'myDatabase', 'Database')
insert into @relationships values
(1,...
June 19, 2015 at 10:35 am
Hmmm...I'm probably missing something, but didn't I explain that? 🙂
...while doing an online index rebuild. That starts different transactions that generate most of the logging, but are not tied to...
June 18, 2015 at 3:29 pm
Well, none of that information about log usage is in sys.dm_tran_session_transactions; it's in sys.dm_tran_database_transactions.
Most likely you're doing an INNER JOIN between sys.dm_tran_session_transactions and sys.dm_tran_database_transactions on transaction_id while doing an online...
June 18, 2015 at 2:36 pm
The .trc files are for the default trace, not the error log.
If you just have default settings for the location and name, the error log files will be showing as...
June 18, 2015 at 1:56 pm
You can mirror from an older version to a newer version (like 2005->2008), but it's a one way trip. You can fail over to the 2008 instance, but you can't...
June 15, 2015 at 12:55 am
For the logins, you would just want to script them all out prior to the migration and save the script. Then you can just run the script on the destination...
June 14, 2015 at 7:24 am
Ok, let's get one thing clear, because I'm confused about it now. Do you have a transaction log backup? In the initial post you said you didn't, but in your...
June 14, 2015 at 7:01 am
Paul Randal has a blog post about this sort of missing metadata case here: http://www.sqlskills.com/blogs/paul/iam-page-corruption-examples/
Per his advice in the comments to that article, you will need to either restore from...
June 12, 2015 at 8:38 pm
In general, DDL, sample data, and expected results would help us give you a solution that does what you want (check this link http://www.sqlservercentral.com/articles/Best+Practices/61537/).
Having said that, as you found...
June 12, 2015 at 9:31 am
It can be. It really depends on the sort of data you have. I've created dummy databases with a single table that contained a gigabyte's worth of rows with the...
June 11, 2015 at 12:25 pm
TheSQLGuru (6/11/2015)
June 11, 2015 at 10:27 am
To follow up, I was able to run a quick test. I created a new table in a database in a lab AG (SQL Server 2012) that did not have...
June 11, 2015 at 10:10 am
Viewing 15 posts - 976 through 990 (of 1,192 total)