Results 1 to 3 of 3

Thread: Query record in tables..

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Query record in tables..

    I would like to know, the general consept how to query the tables?

    I have the piece of SQL command here..
    Code:
    sSqlCmd = "CREATE PROCEDURE UMNO as SELECT PLOT FROM Pemilik"
    How I can delete the UMNO Query tables?I got error because this query tables already exist.. so I want to delete this query tables if found

  2. #2
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Query record in tables..

    Why not just:
    Code:
    sSqlCmd = "SELECT PLOT FROM Pemilik"
    ?

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Query record in tables..

    Code:
    IF EXISTS(SELECT 1 FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'tablename') AND type = (N'U')) 
    BEGIN
       DROP TABLE tablename
    END

Posting Permissions

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



Click Here to Expand Forum to Full Width