Home Forums SQL Server 2005 Development Error = [Microsoft][SQL Native Client][SQL Server]Invalid object name 'dbo.auditrec' RE: Error = [Microsoft][SQL Native Client][SQL Server]Invalid object name 'dbo.auditrec'

  • Thanks for your reply.

    I debug step by step and then i found as below.

    1. use DM_SCNYLDMS03_docbase ==> pass

    2. IF OBJECT_ID ('auditrec', 'view') IS NOT NULL DROP VIEW auditrec ==> pass

    3. create view dbo.auditrec as

    select u.scnyl_pol_no,u.scnyl_box_id,u.object_name,u.event_name,u.user_name,

    u.event_description,u.time_stamp from

    (select dbo.scnyl_supertype_sp.scnyl_pol_no, dbo.scnyl_supertype_sp.scnyl_box_id, dbo.scnyl_supertype_sp.object_name,

    dbo.dm_audittrail_sp.event_name, dbo.dm_audittrail_sp.user_name, dbo.dm_audittrail_sp.event_description, dbo.dm_audittrail_sp.time_stamp

    FROM dbo.dm_audittrail_sp INNER JOIN dbo.scnyl_supertype_sp ON

    dbo.dm_audittrail_sp.chronicle_id = dbo.scnyl_supertype_sp.r_object_id)u

    ==> pass

    4. exec master..xp_cmdshell 'IF EXIST D:\AuditExport\Report\policies_log-%date:~10%%date:~4,2%%date:~7,2%.txt DEL D:\AuditExport\Report\policies_log-%date:~10%%date:~4,2%%date:~7,2%.txt'

    ==> pass

    5. exec master..xp_cmdshell 'bcp "select * from dbo.auditrec order by scnyl_pol_no desc" queryout "D:\AuditExport\Report\temp_policies_log-%date:~10%%date:~4,2%%date:~7,2%.txt" -U scnyl\Administrator -P Passwords1 -S DISERVE-DB-01 -c -T -t ";"'

    ==> found the error

    Error = [Microsoft][SQL Native Client][SQL Server]Invalid object name 'dbo.auditrec'.

    SQLState = 37000, NativeError = 8180

    Error = [Microsoft][SQL Native Client][SQL Server]Statement(s) could not be prepared.

    I already config at DISERVE-DB-01 (it's database server and the same instance name) as

    1. open DB Engine remote connections to be "using TCP/IP and name pipes"

    How can i do anymore????? Many thanks!!!