Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Create script of SQL 05 DB

Participant ,
Sep 30, 2008 Sep 30, 2008
Do you know how to generate a script that will get all the FK,PK,indexes,views,contsraints of a SQL 05 DB?


I am using Rapid SQL...
Any solution....Thank you.
TOPICS
Database access
647
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 30, 2008 Sep 30, 2008
google "ms sql 2005 system tables"
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Sep 30, 2008 Sep 30, 2008
Take a look at the sys.objects and sys.indexes views
http://msdn.microsoft.com/en-us/library/ms189783(SQL.90).aspx
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Sep 30, 2008 Sep 30, 2008
emmim44,

Are you trying to get creation scripts for these objects or just check for existence in the database?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 30, 2008 Sep 30, 2008
get creation scripts is needed...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Sep 30, 2008 Sep 30, 2008
To get the definition for views (functions, and stored procedures) you can query sys.sql_modules.

USE AdventureWorks

SELECT definition
FROM sys.sql_modules
WHERE OBJECT_NAME(object_id) = 'vEmployee'


If you have access to Microsoft SQL Server Management Studio you can use it to generate scripts.

http://msdn.microsoft.com/en-us/library/ms178078(SQL.90).aspx
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 01, 2008 Oct 01, 2008
LATEST
I used SQL Management studio it does create script but since the presedence of tables are important.. the created script throws lots of error...There are lots of circular constraints on tables...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources