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

avatar image

120 2 2 4

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, but I have no clue if it's good or not.

more ▼

answered May 14, 2012 at 12:19 PM

avatar image

Grant Fritchey ♦♦
137k 20 46 81

(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]
 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}}


Some others have suggested some other options 125alt text125

View_DDL_V7.png (39.4 kB)
more ▼

answered May 11, 2012 at 02:18 PM

avatar image

Fatherjack ♦♦
43.8k 79 101 118

  • 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



Answers and Comments

SQL Server Central

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



asked: May 11, 2012 at 02:06 PM

Seen: 1546 times

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

Copyright 2018 Redgate Software. Privacy Policy