database questions...need some help....

Discussion in 'Databases' started by dylanbutler84, May 15, 2008.

  1. #1
    Hi.. I am new here...
    I am studying on database management. honestly I get difficult on this and I really need some help. maybe this just a very basic from you and hope you could share ideas.

    heres the question i had collected
    * How do I know which version of SQL Server I'm running?
    * How do I debug my SQL statements?
    * How do I simulate an array inside a stored procedure?


    thanks....
     
    dylanbutler84, May 15, 2008 IP
  2. JenniP

    JenniP Peon

    Messages:
    250
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    For your first question its quite easy just run this

    select @@version

    Which should return you a recordset of something like

    Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

    Which tells you I'm running SQL 2005 Express with SP2 applied.

    Your second question is a little more difficult, personally I put known data into a database,work out what data should come out, run the stored procedure and compare the two results. I do this in a transaction so either way I can just roll it back at the end and the data is back to its "Known" state.

    Your third question is even more tricky still, it kind of depends what you want the array to do, since database operations are set based the kind of logic you would write in an application may not be the right thing to do, if its possible at all.

    In case it helps

    http://databases.aspfaq.com/database/how-do-i-simulate-an-array-inside-a-stored-procedure.html

    Other things that may help

    http://weblogs.sqlteam.com/jeffs/archive/2007/04/30/60192.aspx

    Jen
     
    JenniP, May 16, 2008 IP