Professional Web Applications Themes

What is ad hoc query or script? - Microsoft SQL / MS SQL Server

What's the different between ad hoc and regular query or script? Thanks! CM...

Sponsored Links
  1. #1

    Default What is ad hoc query or script?

    What's the different between ad hoc and regular query or script?
    Thanks!
    CM


    Sponsored Links
    CM Guest

  2. #2

    Default Re: What is ad hoc query or script?

    An ad-hoc query is something that is not known prior to execution. Each
    execution of the query might be different (both in structure and in
    results). SQL Server will not be able to optimize for these queries. Regular
    queries or scripts and pre-compiled blocks of SQL code (for example
    procedures, triggers) that SQL Server can optimize.
    --
    HTH,
    SriSamp
    Please reply to the whole group only!
    [url]http://www32.brinkster.com/srisamp[/url]

    "CM" <caomin111hotmail.com> wrote in message
    news:%230LzRVXQDHA.2316TK2MSFTNGP12.phx.gbl...
    > What's the different between ad hoc and regular query or script?
    > Thanks!
    > CM
    >
    >

    SriSamp Guest

  3. #3

    Default Re: What is ad hoc query or script?

    The ad-hoc query is ideally created by your application and sent to SQL
    Server. For example, assume a VB code that does something like this:

    Dim strSQL As String
    IF (someCondition)
    strSQL = "SELECT * FROM authors WHERE " & whereClause
    ELSE
    strSQL = "SELECT * FROM authors WHERE " & whereClause & orderbyClause
    END IF
    ' Execute the statement using ADO

    Here, in the above example, you can see that the "whereClause" is quite
    dynamic and not known prior to execution. This can make SQL Server really
    work hard in determining what to do to get the results.
    --
    HTH,
    SriSamp
    Please reply to the whole group only!
    [url]http://www32.brinkster.com/srisamp[/url]

    "CM" <caomin111hotmail.com> wrote in message
    news:uNGVU5XQDHA.2320TK2MSFTNGP12.phx.gbl...
    > Hi Srisamp
    > If an ad-hoc query is not known prior to execution, who creates the ad-hoc
    > query? Could you give me an example how it is look like and how it is
    > generated?
    > Thank you!
    > CM
    >
    > "SriSamp" <ssampathsct.co.in> wrote in message
    > news:Og7Q2cXQDHA.2320TK2MSFTNGP12.phx.gbl...
    > > An ad-hoc query is something that is not known prior to execution. Each
    > > execution of the query might be different (both in structure and in
    > > results). SQL Server will not be able to optimize for these queries.
    > Regular
    > > queries or scripts and pre-compiled blocks of SQL code (for example
    > > procedures, triggers) that SQL Server can optimize.
    > > --
    > > HTH,
    > > SriSamp
    > > Please reply to the whole group only!
    > > [url]http://www32.brinkster.com/srisamp[/url]
    > >
    > > "CM" <caomin111hotmail.com> wrote in message
    > > news:%230LzRVXQDHA.2316TK2MSFTNGP12.phx.gbl...
    > > > What's the different between ad hoc and regular query or script?
    > > > Thanks!
    > > > CM
    > > >
    > > >
    > >
    > >
    >
    >

    SriSamp Guest

Similar Threads

  1. Problem with this query string conversion script
    By jpesolutions in forum Coldfusion - Advanced Techniques
    Replies: 3
    Last Post: July 20th, 03:26 AM
  2. Action script to Coldfusion query not working
    By chrism59 webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: January 26th, 02:08 PM
  3. sort by script for sql query results
    By Lurk Master Flex in forum PHP Development
    Replies: 3
    Last Post: November 25th, 07:53 PM
  4. Replies: 0
    Last Post: August 22nd, 10:37 PM
  5. Generate Table script from query yzer...
    By Andrew J. Kelly in forum Microsoft SQL / MS SQL Server
    Replies: 2
    Last Post: July 10th, 12:08 AM

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