Viewing 15 posts - 1 through 15 (of 178 total)
Using LEAD instead of LAG.....
WITH FolderCTE AS ( SELECT LEAD(id, 1, null) OVER (ORDER BY id) [next_folder] , id , folder FROM #sampledata WHERE folder is not null )SELECT sd.id ,...
November 28, 2019 at 10:03 am
I'm using the ID column which got added to sort the data.
drop table #sampledata go create table #sampledata(id int identity(1,1),folder varchar(100) null,folder2 varchar(100) null)go insert into...
November 27, 2019 at 9:13 am
Use the LAG function
November 26, 2019 at 1:50 pm
The maximum number of logs you can configure to keep is 99. It is set to 6 by default but you can increase it in the Configure SQL Server Errors...
September 3, 2019 at 12:53 pm
You need to name the column in Query1, and also add the size column name back in.
SET @Query1 = FORMATMESSAGE(N'''SELECT SUM([master].[sys].[master_files].size)*8/1024 [Size] FROM [master].[sys].[master_files] WHERE [master].[sys].[master_files].[name] = ''''%s''''', @DatabaseName)
July 30, 2019 at 1:46 pm
What is @Query2 defined as?
July 30, 2019 at 1:15 pm
Management Studio on your client workstation or do you RDP on to each server? Could it be network? Try doing a "select * into another_table from table" or a temp...
July 29, 2019 at 1:35 pm
where are you running the select from?
July 29, 2019 at 1:30 pm
but have you restored it on the slow instance? Try restoring it on the slow instance. Restore it using a different database name if you need to and try again...
July 29, 2019 at 1:28 pm
Have you tried restoring the database on instance 1?
July 29, 2019 at 1:24 pm
I believe it is in the DataSource table. The ItemId column references the Catalog(ItemId) column and the Link column also references the Catalog(ItemId) column.
SELECT * FROM ReportServer.dbo.Catalog WHERE ItemID IN...
July 19, 2019 at 1:10 pm
I would argue that in the UK that even the linkage between a person and an address is not private. If you are registered to vote you will be on...
July 16, 2019 at 10:52 am
You can also use the Import/Export wizard to generate the table structure if you don't have the SSMS tools pack or SQL prompt installed.
June 24, 2019 at 2:05 pm
You need to take all the characters to the LEFT of the pipe character and then all the character to the RIGHT of the pipe character. How to find the...
May 30, 2019 at 11:11 am
If you used Ola Hallengren's scripts for the backup you could just specify the \\fileserver\sqlbackups\auto backups part for the backup path and it would create the sub folders required for...
May 30, 2019 at 10:56 am