Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)

  • RE: execute strored procedure through OPENROWSET-SYNTAX ERROR

    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

  • RE: T-SQL Export to CSV help

    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

  • RE: T-SQL Export to CSV help

    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...

  • RE: T-SQL Export to CSV help

    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...

  • RE: select latest records

    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

Viewing 5 posts - 1 through 5 (of 5 total)