• Your stored proc is written to take 3 parameters and you're passing it 4.

    Create procedure dbo.IMPEXPFROMDB

    @filepath varchar(255), --filepath

    @direction varchar(5) , --direction(In/Out)

    @tablename varchar(255) --Valid tablename/viewname

    as

    ...

    Exec IMPEXPFROMDB 'databaseTest' 'tableNameOne', 'OUT', 'C:\testOne\testzz.txt'

    The proc takes as a 1st parameter the file path and name, as a second parameter the direction and as a third parameter the table name.

    In your call to it, you're passing first a db name (I assume), second the table name, third the direction and lastly the file name.

    Based on the proc's declaration, the call to it should be

    Exec IMPEXPFROMDB 'C:\testOne\testzz.txt', 'OUT', 'tableNameOne'

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass