October 12, 2016 at 4:45 pm
Sergiy (10/12/2016)
To do it all in one query you may use GROUP BY ... WITH ROLLUP.In the row with GROUPING(Column1) = 1 you concatenate COUNT(*) , GETDATE() and whatever else you need to put there (after converting them all into varchars, of course.
Spot on, Sergiy.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 13, 2016 at 6:07 am
Okay! I will try it out.
Thanks.
October 18, 2016 at 9:43 am
Hi ,
I have this batch file as below. I need to update this to get the date without setting it as I have done in the second line of my code below.
I want it to display automatically when I run this batch file every time. The date should be in yyyymmdd format.
I tried lot of options with date parameters but couldn't get this right.
Can you please help me with this..
*** Batch file ********************************************
set naic=1211610
set filedatetime=18/10/2016 11:03
set date=%filedatetime:~6,4%%filedatetime:~3,2%%filedatetime:~0,2%
set filename=tnvin_%date%%naic%.txt
set tnpath=C:\tnvintrailerSQLCMD -S SQLSANDBOX -E -Q "[SouthernTrust].[dbo].[P_tntr] "
bcp [St].[dbo].[TmpTNVINTRInfo] out "%tnpath%%filename%" -c -T -S SQLSANDBOX
SQLCMD -S SQLSANDBOX -E -Q "DROP TABLE [St].[dbo].[TmpTNVINTRInfo]"
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply