Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2004
    Location
    Tokyo, Japan
    Posts
    17

    Unanswered: How to manage the version of Tables,View, and so on

    Hi.
    I am managing the SQL script files for constructing tables,views,and so on with Visual Source Sefe.

    But once I run these scripts with a tool like Query Analyzer
    for the database in SQL Server,
    I do not know How to get the versions of the scripts which were installed now, with using Enterprise Manager or any tool associated with SQL Server2000.

    Please tell me How are you managing and
    know which version of scripts have been installed on database in SQL Server.

    Sorry for my poor English.

    Thanks for reading.
    Last edited by maekawa; 01-12-04 at 23:20.
    Takanobu Maekawa

  2. #2
    Join Date
    Dec 2003
    Posts
    454
    What do the versions of the scripts mean? I'm not very clear to what you want to know. Can you post more details?

  3. #3
    Join Date
    Jan 2004
    Location
    Tokyo, Japan
    Posts
    17
    Thanks for Reply.
    I want to manage the scripts for tables,views,etc, and I think it is possible with using Visual Source Safe(VSS) from view of source code level.
    Using VSS, each scripts are version controled, as you know,
    like this for example:

    --------- T_Person.sql --------------

    version 1 new created
    version 2 null problem bug fix
    ....
    ----------------------------------------

    In my developer team, if scripts in VSS are edited and updated,
    the most new scripts are applied to the database that we use for develop
    (with Query Analyzer).

    And now, we think there is a problem.
    We can controll the source code's version with VSS,
    but there is one question "which script version in VSS Is this database using?"

    I wish there is someone who had the problem similer to us and solved it.

    I wish I would tell you what I mean as I think in Japanese exactly.
    Sorry for my poor English.

    Thanks for reading.
    Takanobu Maekawa

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    Basically, if I understand correctly, you are looking at adding something to the scripts so you can look at a somewhere and go "ah, table SystemUser was created using version 5 of the table creation script"....

    With stored proces and the like I have seen other people do this by adding headers or footers to the stored procedure that hold comments regarding what version of the script is being used.

    With tables you are a bit stuck though.... unless in each table creation script you include a line that does an insert into a system table to say what script was used to create the table....

    Does that make sense??

  5. #5
    Join Date
    Jan 2004
    Location
    Tokyo, Japan
    Posts
    17
    "ah, table SystemUser was created using version 5 of the table creation script"

    YES!!! That was I meant,thanks.

    As you said,I also had thought using comments and
    inserting version info to a table that has version infomation.

    but it may be a little difficult to maintain,
    so I think there may be a better way I do not know.

    If nothing such a good method,
    I will do setting comments and prepareing table
    which has database version infomation, afterall.

    I am also looking for answer as hard as possible,
    But If anyone have any idia to solve a problem like this,
    would you tell me,please.

    Sorry for my poor English.
    Thanks for reading.
    Last edited by maekawa; 01-13-04 at 01:42.
    Takanobu Maekawa

  6. #6
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    It's a problem that has been around for a while. I haven't heard of any really good solutions to be honest. Most require a lot of extra work that most of the developers simple refuse to do.

    Whatever you come up with as a solution try to keep it simple so that developers will comply with it.

  7. #7
    Join Date
    Jan 2004
    Location
    Tokyo, Japan
    Posts
    17
    Thanks for reply.
    Although I had been looking for the another answer,
    As you said, there is no way to aboid to write comments and more...

    Now I will try to plan these works as simple as possible.
    I am grad and thank All for help me.

    Thanks for reading.
    Takanobu Maekawa

  8. #8
    Join Date
    Jan 2003
    Location
    India
    Posts
    523
    Originally posted by maekawa
    Thanks for reply.
    Although I had been looking for the another answer,
    As you said, there is no way to aboid to write comments and more...

    Now I will try to plan these works as simple as possible.
    I am grad and thank All for help me.

    Thanks for reading.
    I am facing a similar situation, here is what i got on other forum may be it will be of some help:
    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=31784

  9. #9
    Join Date
    Dec 2003
    Posts
    454
    In Visual Source Sefe, when you check out the file, you can put the note in which you can describe what the thing changes.

  10. #10
    Join Date
    Jan 2004
    Location
    Tokyo, Japan
    Posts
    17
    Thanks for help all. And now I have another probrem.
    Please help if you can.

    As you know, there is the label setting function in VSS.
    Now my team uses the label for the current database version.

    I hope I can embed the label infomation within SQL script file's comment.like this:

    ------------CreateTables.sql---------------
    /*
    * $Current DB version : 1
    *
    * $History: CreateTables.sql$
    *
    * ***** Version 1 *****
    * User:maekawa Date:14/01/04 Time:10:02a
    * Created
    * Comment: Defined ranges for IDs.
    */
    --------------------------------------------------

    Anybody knows to solve such problem?
    I hope I could tell you exactly what I mean.
    Sorry for my poor English.

    Thanks for reading.
    Takanobu Maekawa

  11. #11
    Join Date
    Jan 2004
    Location
    Tokyo, Japan
    Posts
    17
    Hi.
    After reserch for all 2 days,
    I realize that there is no way to embed a Label(used in VSS)
    to a source code automatically:-)

    Thanks for all help.
    Takanobu Maekawa

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •