x

View definition for SQL 7.0

We have to get the definition of a view in order to reproduce it in another server. The problem is that the view is in SQL 7, and SSMS can't connect to it. I can get data using oldb or odbc but not the definition.

Also I'm connecting from a clients production server, so I can't install programs. And the SQL 7 server is not available using RDP.

Any ideas on how to get the definition?
more ▼

asked May 11, 2012 at 02:06 PM in Default

ignaciooliver gravatar image

ignaciooliver
120 2 2 3

Jonathan Allen Solution doesn’t work. I think those objects are in sql 2005 and above
May 11, 2012 at 02:47 PM ignaciooliver
(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

I'm with sp_helptext, but first, you have to connect to to the 7.0 server. I'd try using sqlcmd.exe first. If that doesn't work, you'll need to find a 7.0 utility. It's been a VERY long time since I needed one, so I'm not sure what's worth getting. [Here's one example][2], but I have no clue if it's good or not.

[2]: http://www.activedbsoft.com/overview-querytool.html
more ▼

answered May 14, 2012 at 12:19 PM

Grant Fritchey gravatar image

Grant Fritchey ♦♦
103k 19 21 74

(comments are locked)
10|1200 characters needed characters left

I am not sure if the objects exist but you could get it from a later version by using this code

USE [msdb]
GO

SELECT  [asm].[definition]
FROM    sys.[all_sql_modules] AS asm
    INNER JOIN sys.[objects] AS o ON [asm].[object_id] = [o].[object_id]
WHERE o.name = {{your view name}}

[edit]

Some others have suggested some other options 125![alt text][1]125

[1]: http://ask.sqlservercentral.com/storage/temp/191-View_DDL_V7.png
View_DDL_V7.png (39.4 kB)
more ▼

answered May 11, 2012 at 02:18 PM

Fatherjack gravatar image

Fatherjack ♦♦
42.8k 75 79 108

+1 for sp_helptext.
May 11, 2012 at 08:12 PM ThomasRushton ♦
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x348
x33

asked: May 11, 2012 at 02:06 PM

Seen: 1107 times

Last Updated: May 14, 2012 at 12:19 PM