Categories
Database Development

File is getting generated into folder, But not a csv file

For the below SP, normal text file is getting generated instead of csv file. ALTER PROCEDURE [dbo].[GenerateCDR_Test] AS BEGIN DECLARE @FileName varchar(50), @bcpCommand varchar(2000) SET @FileName = ‘C:\TransactionsData’ + (‘Tansactions_’+ (CONVERT(VARCHAR, GETDATE(), 112) + ‘‘ + CAST(DATEPART(HOUR, GETDATE()) AS VARCHAR) + ‘‘ + CAST(DATEPART(MINUTE,GETDATE()) AS VARCHAR) + ‘_’ + CAST(DATEPART(SECOND, GETDATE()) AS VARCHAR)) + ‘.csv’); […]

Categories
Database Development

Unable to resolve column level collations

Getting below error from after executing the query from the –Adding missing headers into the file—- error: SQLState = 22008, NativeError = 241 Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string. SQLState = S1000, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]Unable to resolve […]