Please try the following:
EXEC tempdb.sys.sp_rename N'#TempWithdraw.DateTime', N'Dat', N'COLUMN';
You need to invoke sp_rename from TempDB.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I can't get what is not working in the below bold highlighted line. I would be grateful to anyone who could help me!
DECLARE @AssetWithDrawStartDate DATE;
DECLARE @AssetWithDrawDate DATE;
DECLARE @TradeStartDate DATE;
DECLARE @TradeDate DATE;
SET @AssetWithDrawDate= GETDATE()
SET @AssetWithDrawStartDate = dateadd(day,-7,@AssetWithDrawDate)
SET @TradeDate= GETDATE()
SET @TradeStartDate = dateadd(day,-30,@TradeDate)
SELECT DateTime, Asset, ClientId, Volume
INTO #TempWithdraw FROM dbo.cashoperations
EXEC SP_RENAME '#TempWithdraw.[DateTime]' , '[Dat]', 'COLUMN'
SELECT * FROM #TempWithdraw
Where Datetime >= @AssetWithDrawStartDate and [DateTime] <= @AssetWithDrawDate
Please try the following:
EXEC tempdb.sys.sp_rename N'#TempWithdraw.DateTime', N'Dat', N'COLUMN';
You need to invoke sp_rename from TempDB.