Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Execution Plan ( checking out the query text

Author  Topic 

kudzen
Starting Member

12 Posts

Posted - 2012-04-01 : 16:38:50
Hi there.

I'm trying to learn how to use the Execution Plan to check what's going on inside the SQL Server.

I saved the most expensive queryplan that was cached in SQL Server and when i open it, i do right click 'Edit query Text' but it's not complete, there is a lot of lines missing. This is normal ? Whats going on?

It breaked at line 100.

Any suggestions ? Thanks for your help.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-04-01 : 23:35:35
how did you save query plan? in graphical or xml format?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

kudzen
Starting Member

12 Posts

Posted - 2012-04-02 : 06:08:18
Hi there,

I did 'right click "Save execution Plan as" and saved as .sqlplan extension.

I think this is graphic mode right ? I dont know where is the option to save as XML. The only way to see XML is right click 'show Execution Plan XML'

Thanks

quote:
Originally posted by visakh16

how did you save query plan? in graphical or xml format?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/



Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2012-04-02 : 06:49:24
Yes, the query text can get cut off it it's very long.

And the save as .sqlplan is the XML format.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

kudzen
Starting Member

12 Posts

Posted - 2012-04-02 : 07:23:29
Thanks for your reply.
And how can i provide the full info for a external DBA ?

I used the sys.dm_exec_query_stats to check out what's the most expensive queryplan. There is another way to get the SQL text?

I know i can use the dm_exec_sql_text but the query is in a single line and it's very annoying to ident all the code :(


quote:
Originally posted by GilaMonster

Yes, the query text can get cut off it it's very long.

And the save as .sqlplan is the XML format.

--
Gail Shaw
SQL Server MVP

Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2012-04-02 : 07:55:05
sys.dm_exec_sql_text, or if it's a procedure pull the definition out of sys.sql_modules.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -