x
login about faq Site discussion (meta-askssc)

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 '12 at 02:06 PM in Default

ignaciooliver gravatar image

ignaciooliver
120 1 2 3

Jonathan Allen Solution doesn’t work. I think those objects are in sql 2005 and above

May 11 '12 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 '12 at 12:19 PM

Grant Fritchey gravatar image

Grant Fritchey ♦♦
62.1k 12 20 66

(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 125alt text125

View_DDL_V7.png (39.4 kB)
more ▼

answered May 11 '12 at 02:18 PM

Fatherjack gravatar image

Fatherjack ♦♦
38.8k 55 69 104

+1 for sp_helptext.

May 11 '12 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



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x272
x26

asked: May 11 '12 at 02:06 PM

Seen: 592 times

Last Updated: May 14 '12 at 12:19 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.