Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Long-running query


Long-running query

Author
Message
Qira
Qira
SSC-Enthusiastic
SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)

Group: General Forum Members
Points: 104 Visits: 724
I'm using SQL Server 2005 Service Pack 3. My monitoring tools was SQL Monitor from Red Gate. One of my Long-Running query as following

(@_no_akaun nvarchar(4000))Select * from MSTUMASTER where studentn=@_no_akaun



Why the Select Statement looks weird?? It's a correct syntax? Really have no idea. Please help

Please see the attachment
Attachments
RG-3.png (12 views, 54.00 KB)
RG-2.png (9 views, 31.00 KB)
RG-1.png (9 views, 39.00 KB)
Andrew Kernodle
Andrew Kernodle
SSChasing Mays
SSChasing Mays (610 reputation)SSChasing Mays (610 reputation)SSChasing Mays (610 reputation)SSChasing Mays (610 reputation)SSChasing Mays (610 reputation)SSChasing Mays (610 reputation)SSChasing Mays (610 reputation)SSChasing Mays (610 reputation)

Group: General Forum Members
Points: 610 Visits: 8135
That sort of syntax is denoting that a parameterized stored procedure plan was used to run the query; the (@_no_akaun nvarchar(4000)) bit indicates that the procedure was called with a value passed in for the @_no_akaun parameter, which is later called in the WHERE clause of the query.

Granted, if you try to run the query as-is, it definitely won't run :-). It's just a bit of the internal notation you're seeing, but, in most cases, it's good to see it, as you're getting good parameterization on your query.

At the same time, it can also indicate a problem point, as bad parameter sniffing could be interfering with the execution time of the query.

It's difficult to provide more information than that presently, though; if the notation was the only point of confusion, great! If more detail is desired, though, please provide some sample data, DDL, and an execution plan, and further investigation can be done.

- :-D
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search