Viewing 5 posts - 1 through 5 (of 5 total)
Hi George,
One way of achieving this would be to create and define your temp table first and the insert into from the proc, for example -
declare
July 11, 2018 at 6:03 am
paul.knibbs (1/22/2014)
There's a -W parameter to SQLCMD that removes trailing spaces from fields--would that work for you?
Thanks Paul, Passing the -W parameter did the trick.
Many Thanks
January 22, 2014 at 7:27 am
Hi,
Thanks for your reply. The reason why I added that was to remove the row count on the output of the CSV. However I removed the section as you suggested...
January 22, 2014 at 3:19 am
Hi, Sorry yes I am replacing <SERVERNAME>. Thanks
So the cmd looks like -
sqlcmd -S MyServerName -E -h -1 -d AdventureWorks -Q "SET NOCOUNT ON; SELECT U.[UserId] ,U.[UserName] ,U.[DateCreated] FROM dbo.Users...
January 21, 2014 at 7:56 am
Hi,
You can simply do a group by statement, unless I have misunderstood your request. See below example -
SELECT FirstName, LastName, MAX(DateCreated)
FROM dbo.Customer
GROUP BY FirstName, LastName
January 21, 2014 at 6:21 am
Viewing 5 posts - 1 through 5 (of 5 total)