Sql Database with linked table (SQL view) Restore errors

zutzu
Member Posts: 86
NAV 5 sp 1, sql server 2005.
I want to restore a sql database with linked table (sql view).
I have read this post:
http://www.mibuso.com/forum/viewtopic.php?f=23&t=27236&hilit=restore+linked
and i create a dummy view, after creating database from NAV.
It starts restoring database without problems (without dummy view, it stopped) with this dummy view.
But when it is finishing, this error appears:
Sql server error accesing XXX (linked table):
an object or column is missing or empty. For select into statements, verify each column has a name.
For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed.
Add a name or single space as the alias name.
SQL:
Create table XXX (a lot of fields, ...) CONSTRAINT "" PRIMARY KEY CLUSTERED (the fields)
I want to restore a sql database with linked table (sql view).
I have read this post:
http://www.mibuso.com/forum/viewtopic.php?f=23&t=27236&hilit=restore+linked
and i create a dummy view, after creating database from NAV.
It starts restoring database without problems (without dummy view, it stopped) with this dummy view.
But when it is finishing, this error appears:
Sql server error accesing XXX (linked table):
an object or column is missing or empty. For select into statements, verify each column has a name.
For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed.
Add a name or single space as the alias name.
SQL:
Create table XXX (a lot of fields, ...) CONSTRAINT "" PRIMARY KEY CLUSTERED (the fields)
0
Comments
-
Don't create an index on the dummy view.There are no bugs - only undocumented features.0
-
The dummy view has no index.
The Navision table linked with with the view has index.0 -
:oops: I need to read closer
Could you post your CREATE VIEW statement? Do you have any NULL values being returned?There are no bugs - only undocumented features.0 -
CREATE VIEW [dbo].[XXX$Trazabilidad Doc_ Compras]
AS
SELECT 'X' AS [No_ Solicitud], 1 AS [No_ pedido], 1 AS [Line No_], GETDATE() AS [Order Date], 'X' AS [No_ Vendor], 'X' AS [Nombre proveedor],
'X' AS [No_ producto], 'X' AS [Descripción producto], 1.1 AS [Cant_ pedido], 'X' AS [Valor dim_ 1], 'X' AS [Dim_ 1 name], 'X' AS [No_ Albarán], GETDATE()
AS [Fecha Albarán], 'X' AS [No_ Factura], GETDATE() AS [Fecha factura], 1.1 AS [Cant_ albarán], 1.1 AS [Cant_ factura], 1.1 AS [Cant_ a recibir],
1.1 AS [Cant_ a facturar], 'X' AS [No_ alb_ int_], 'X' AS [No_ fac_ int_]
FROM dbo.[Record Link]
There is no 'null' returned:
X 1 1 06/11/2008 14:29:05 X X X X 1,1 X X X 06/11/2008 14:29:05 X 06/11/2008 14:29:05 1,1 1,1 1,1 1,1 X X0 -
create it as a dummy table instead, then replace it with the real view after you have restored.
since your select looks like data per company = yes, if you have more than one company, repeat it for each company.David Machanick
http://mibuso.com/blogs/davidmachanick/0 -
[Topic moved from 'NAV/Navision' forum to 'SQL General' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions