Rename a table with sp_rename (Table name has square brackets in the name literal)

 CREATE TABLE [TEST].[[TEST]].[NewTableName](
 [StatusID] [int] NOT NULL,
 [Status] [nchar](10) NULL )
--wrong table name:     [TEST].[NewTableName   

--code to fix the name issue with sp_rename

--put the srong table name inside double quotes


--or the way with escape like you did
sp_rename 'TEST.[[TEST]].[NewTableName]','NewTableName'

---The table name has been changed to  TableName with schema [TEST]
--Afyer rename
[TEST].[TableName] or ( TEST.TableName)

Move datetime to nearest 15 minute

  create table test (dt datetime)
insert into test values('2016-12-07 11:22:25.063')
,('2016-12-07 11:02:25.063')
,('2016-12-07 11:55:55.063')
,('2016-12-07 11:32:25.063')
,('2016-12-07 11:52:25.063') 
,('2016-12-07 11:15:00.000') 

datetimefromparts (Year(dt),Month(dt),day(dt), datepart(hour,dt), (datepart(minute,dt)/15 + (CASE WHEN datepart(minute,dt)%15 =0 Then 0 Else 1 End) )*15%60 ,0,0)  dt1, 
dt ,
Dateadd(minute, (datepart(minute,dt)/15 + (CASE WHEN datepart(minute,dt)%15 =0 Then 0 Else 1 End) )*15%60, DATEADD(hour, DATEDIFF(hour, 0,dt), 0)) dt2

,Dateadd(minute, ceiling(datepart(minute,dt) /15.)*15 % 60, DATEADD(hour, DATEDIFF(hour, 0,dt), 0)) dt3

,datepart(minute, convert(smalldatetime,(ceiling(cast(dt as float) * (24/.25)))/(24/.25))) /* rounded minute in 15 minute interval */
,DATEADD(hour, DATEDIFF(hour, 0,dt), 0)) /* beginning of the hour */
AS dt4

from test

drop table test

Insert “dummy” record into each group

 create table manufacturingprocess ([Job#] int, Process varchar(30), Hours int, ProcessOrder int)

Insert into manufacturingprocess values(1,'Cut',10,50),(1,'Assemble',25,100)

merge manufacturingprocess tgt
using (select distinct [Job#] From manufacturingprocess ) src 
on src.[Job#]=tgt.[Job#] and ( 1=0 or /* avoid insert again if execute twice */ tgt.Process='Dummy r')
When Not matched then 
insert ([Job#],Process,Hours, ProcessOrder) values (src.[Job#],'Dummy r',0,1);

Select [Job#],Process,Hours, ProcessOrder from manufacturingprocess
Order by [Job#],Hours

drop table manufacturingprocess

Generate Code-128 Barcode Online

You can generate barcode from the below link online:

ASCII Control Codes in Code 128 Barcodes:

^M (Key): CR carriage return

For example: 5^M with 35p(barcode height)x 2p minimum bar width.
You can download the generated barcode image for print.

OctopusDeploy Tentacle Service Automatic Startup not Working

When the service startup was set to automatic, the OctopusDeploy Tentacle service did not start as expected. I tried to change the startup type to Automatic (Delayed start) as a workaround(trick found from the below link).

Speed up Reports for MS SQL Server 2014 Reporting Services SSRS and Access Log Information

How to Modify a Reporting Services Configuration File (RSreportserver.config)

There are a few configuration values can be changed to improve long running reports.

SQLServer 2014: \Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config

Updated to:

Check Trace log file :
The trace log files are ReportServerService_.log and are located in the following folder:
C:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\LogFiles

Read log information from ExecutionLog3 view

Use ReportServer
select * from ExecutionLog3
Order by TimeStart DESC

–Some sample values

—Configure Available Memory for Report Server Applications

Modify SessionTimeout for SSRS with rs.exe utility

SSRS Format Negative Number

=Format(Fields!colFieldName.Value, “###,###.;(###,###.)”))

Result examples: