Professional Web Applications Themes

Getting 1 row with SELECT - SQL 6.5 - Microsoft SQL / MS SQL Server

Toto, Yeah. TOP was introduced from SQL7 sp 2 and up. you can use SET ROWCOUNT, as in SET ROWCOUNT 1 SELECT * FROM dbo.<tablename> WHERE... --to set the rowcount to default SET ROWCOUNT 0 -- Dinesh. SQL Server FAQ at http://www.tkdinesh.com "Toto" <com> wrote in message news:039001c361ce$440a2a60$gbl... ...

  1. #1

    Default Re: Getting 1 row with SELECT - SQL 6.5

    Toto,

    Yeah. TOP was introduced from SQL7 sp 2 and up.

    you can use SET ROWCOUNT, as in

    SET ROWCOUNT 1
    SELECT *
    FROM dbo.<tablename>
    WHERE...
    --to set the rowcount to default
    SET ROWCOUNT 0


    --
    Dinesh.
    SQL Server FAQ at
    http://www.tkdinesh.com

    "Toto" <com> wrote in message
    news:039001c361ce$440a2a60$gbl... 


    Dinesh.T.K Guest

  2. #2

    Default Re: Getting 1 row with SELECT - SQL 6.5

    Tom,

    Even in a SQL6.5? I think what you said holds good if the user database compatability is < 70 for a SQL7 or SQL2000.


    --
    Dinesh.
    SQL Server FAQ at
    http://www.tkdinesh.com
    "Tom Moreau" <spam.me.cips.ca> wrote in message news:phx.gbl...
    You can also run the query from master or tempdb and run the TOP query with 3-part naming.

    --
    Tom

    ---------------------------------------------------------------
    Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
    SQL Server MVP
    Columnist, SQL Server Professional
    Toronto, ON Canada
    www.pinnaclepublishing.com/sql


    "Dinesh.T.K" <mail.tkdinesh.com> wrote in message news:O4$Uo#phx.gbl...
    Toto,

    Yeah. TOP was introduced from SQL7 sp 2 and up.

    you can use SET ROWCOUNT, as in

    SET ROWCOUNT 1
    SELECT *
    FROM dbo.<tablename>
    WHERE...
    --to set the rowcount to default
    SET ROWCOUNT 0


    --
    Dinesh.
    SQL Server FAQ at
    http://www.tkdinesh.com

    "Toto" <com> wrote in message
    news:039001c361ce$440a2a60$gbl... 


    Dinesh.T.K Guest

  3. #3

    Default Re: Getting 1 row with SELECT - SQL 6.5

    Ignore that :)

    --
    Dinesh.
    SQL Server FAQ at
    http://www.tkdinesh.com
    "Dinesh.T.K" <mail.tkdinesh.com> wrote in message news:phx.gbl...
    Tom,

    Even in a SQL6.5? I think what you said holds good if the user database compatability is < 70 for a SQL7 or SQL2000.


    --
    Dinesh.
    SQL Server FAQ at
    http://www.tkdinesh.com
    "Tom Moreau" <spam.me.cips.ca> wrote in message news:phx.gbl...
    You can also run the query from master or tempdb and run the TOP query with 3-part naming.

    --
    Tom

    ---------------------------------------------------------------
    Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
    SQL Server MVP
    Columnist, SQL Server Professional
    Toronto, ON Canada
    www.pinnaclepublishing.com/sql


    "Dinesh.T.K" <mail.tkdinesh.com> wrote in message news:O4$Uo#phx.gbl...
    Toto,

    Yeah. TOP was introduced from SQL7 sp 2 and up.

    you can use SET ROWCOUNT, as in

    SET ROWCOUNT 1
    SELECT *
    FROM dbo.<tablename>
    WHERE...
    --to set the rowcount to default
    SET ROWCOUNT 0


    --
    Dinesh.
    SQL Server FAQ at
    http://www.tkdinesh.com

    "Toto" <com> wrote in message
    news:039001c361ce$440a2a60$gbl... 


    Dinesh.T.K Guest

  4. #4

    Default Re: Getting 1 row with SELECT - SQL 6.5

    The OP said "I am using SQL Server 7.0 with 6.5 compatibility".

    --
    Tom

    ---------------------------------------------------------------
    Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
    SQL Server MVP
    Columnist, SQL Server Professional
    Toronto, ON Canada
    www.pinnaclepublishing.com/sql


    "Dinesh.T.K" <mail.tkdinesh.com> wrote in message news:phx.gbl...
    Tom,

    Even in a SQL6.5? I think what you said holds good if the user database compatability is < 70 for a SQL7 or SQL2000.


    --
    Dinesh.
    SQL Server FAQ at
    http://www.tkdinesh.com
    "Tom Moreau" <spam.me.cips.ca> wrote in message news:phx.gbl...
    You can also run the query from master or tempdb and run the TOP query with 3-part naming.

    --
    Tom

    ---------------------------------------------------------------
    Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
    SQL Server MVP
    Columnist, SQL Server Professional
    Toronto, ON Canada
    www.pinnaclepublishing.com/sql


    "Dinesh.T.K" <mail.tkdinesh.com> wrote in message news:O4$Uo#phx.gbl...
    Toto,

    Yeah. TOP was introduced from SQL7 sp 2 and up.

    you can use SET ROWCOUNT, as in

    SET ROWCOUNT 1
    SELECT *
    FROM dbo.<tablename>
    WHERE...
    --to set the rowcount to default
    SET ROWCOUNT 0


    --
    Dinesh.
    SQL Server FAQ at
    http://www.tkdinesh.com

    "Toto" <com> wrote in message
    news:039001c361ce$440a2a60$gbl... 



    Tom Guest

  5. #5

    Default Re: Getting 1 row with SELECT - SQL 6.5

    Toto,

    If you change the database compatibility to 70 and up, TOP would work.To
    change that, refer 'sp_dbcmptlevel' in BooksOnLine.

    --
    Dinesh.
    SQL Server FAQ at
    http://www.tkdinesh.com

    "Dinesh.T.K" <mail.tkdinesh.com> wrote in message
    news:O4$Uo%phx.gbl... 
    >
    >[/ref]


    Dinesh.T.K Guest

  6. #6

    Default Re: Getting 1 row with SELECT - SQL 6.5

    Thanks again and by the way, two questions:

    1) I've just get my hands on this 6.5 DB and don't have a
    good reference to manage/program it. Could you please
    recommend a good one (book, tutorial, other) ?

    2) Any recommendation about any literature concerning the
    migration of 6.5 DBs to 7.0 and above ?

    Thanks a lot in advance
     
    TOP would work.To 
    message [/ref][/ref]
    seem 
    >>
    >>[/ref]
    >
    >
    >.
    >[/ref]
    Toto Guest

  7. #7

    Default Re: Getting 1 row with SELECT - SQL 6.5

    Toto,

    SQL6.5 Books
    http://www.mssqlserver.com/books/sqlserver65.asp

    Tutorial
    http://www.mssqlserver.com/tsql/


    Articles
    ---

    INF: How to Use Check65.exe to Check for Problems Before You Upgrade to SQL
    Server 7.0
    http://support.microsoft.com/support/kb/articles/Q255/2/54.ASP

    Chapter 17 - Upgrading to SQL Server 7.0
    http://www.microsoft.com/TechNet/prodtechnol/sql/reskit/sql7res/part11/sqc16.asp

    Chapter 3 - Upgrading from an Earlier Version of SQL Server
    http://www.microsoft.com/TechNet/prodtechnol/sql/proddocs/intro/part2/75515c03.asp

    Upgrading to Microsoft SQL Server 7.0
    http://www.microsoft.com/TechNet/prodtechnol/sql/deploy/upgrdmigrate/upgrade.asp

    How to Upgrade SQL Server 6.5 and 7.0 to SQL Server 2000
    http://www.microsoft.com/SQL/howtobuy/howtoup.asp

    PRB: Passwords Unusable After 6.5 to 7.0 Upgrade w/Diff Sort Ord
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q249671

    PRB: Upgrading SQL Server 6.5 Databases with Integrated Logins
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q291366

    INF: Supported Windows Versions for SQL Server
    http://support.microsoft.com/default.aspx?scid=kb;en-us;Q122352

    INF: How to Move a Device to Another Location
    http://support.microsoft.com/default.aspx?scid=kb;en-us;Q181602

    Product life cycle
    http://support.microsoft.com/default.aspx?scid=fh;[ln];LifeSrvr



    --
    Dinesh.
    SQL Server FAQ at
    http://www.tkdinesh.com

    "Toto" <com> wrote in message
    news:109701c361e5$4a7d8150$gbl... 
    > TOP would work.To 
    > message [/ref]
    > seem 
    > >
    > >
    > >.
    > >[/ref][/ref]


    Dinesh.T.K Guest

Similar Threads

  1. Replies: 4
    Last Post: April 4th, 08:21 AM
  2. Replies: 0
    Last Post: September 24th, 03:24 AM
  3. Replies: 0
    Last Post: September 11th, 11:26 AM
  4. Replies: 0
    Last Post: September 11th, 12:19 AM
  5. Replies: 0
    Last Post: April 15th, 01:22 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139