01: /*
02: * SqlServerConstraintReader.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.db.mssql;
13:
14: import workbench.db.AbstractConstraintReader;
15:
16: /**
17: *
18: * @author support@sql-workbench.net
19: */
20: public class SqlServerConstraintReader extends AbstractConstraintReader {
21: private static final String TABLE_SQL = "select c.text \n"
22: + "from sysobjects cons, \n" + " syscomments c, \n"
23: + " sysobjects tab \n" + "where cons.xtype = 'C' \n"
24: + "and cons.id = c.id \n"
25: + "and cons.parent_obj = tab.id \n"
26: + "and tab.name = ? \n";
27:
28: public SqlServerConstraintReader() {
29: }
30:
31: public String getPrefixTableConstraintKeyword() {
32: return "check";
33: }
34:
35: public String getColumnConstraintSql() {
36: return null;
37: }
38:
39: public String getTableConstraintSql() {
40: return TABLE_SQL;
41: }
42:
43: }
|