SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to find the table name in specified query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

manju3606
Yak Posting Veteran

India
78 Posts

Posted - 12/28/2011 :  05:28:47  Show Profile  Reply with Quote
Hi to all ,

i am storing query's witch are used in ssms through application. I want to know which are tables used in those queries through application. My problem is i can't see those queries but i want to know which tables are used in those queries.

thanks



Manju

DonAtWork
Flowing Fount of Yak Knowledge

2161 Posts

Posted - 12/28/2011 :  06:32:23  Show Profile  Reply with Quote
storing queries? PLEASE say you mean as a stored procedure and not a varchar(max) column.

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

manju3606
Yak Posting Veteran

India
78 Posts

Posted - 12/28/2011 :  06:58:51  Show Profile  Reply with Quote
Hi Donatwork,

yes i am storing queris in a table, not a stored procedure and please dont tell me about profiler i dont want to use that.

Thanks

Manju
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 12/28/2011 :  07:21:16  Show Profile  Reply with Quote
why do you need to store queries themselves as values in a table. thats certainly not a good approach.

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

Go to Top of Page

manju3606
Yak Posting Veteran

India
78 Posts

Posted - 12/28/2011 :  07:29:47  Show Profile  Reply with Quote
Hi Visakh,

client want to see witch query's are useing or used in ssms.

so for that purpose i am storing those query's witch are used in ssms.

Thanks


Manju
Go to Top of Page

DonAtWork
Flowing Fount of Yak Knowledge

2161 Posts

Posted - 12/28/2011 :  10:15:03  Show Profile  Reply with Quote
quote:
Originally posted by manju3606

Hi Donatwork,

yes i am storing queris in a table, not a stored procedure and please dont tell me about profiler i dont want to use that.

Thanks

Manju


If you do not want to use the correct tool for the job, then i cannot help you.

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 12/28/2011 :  11:39:57  Show Profile  Reply with Quote
quote:
Originally posted by manju3606

Hi Visakh,

client want to see witch query's are useing or used in ssms.

so for that purpose i am storing those query's witch are used in ssms.

Thanks


Manju


why should you store it in table?
FOr that you can make use of dmvs or profiler traces

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

Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 12/28/2011 :  12:01:02  Show Profile  Reply with Quote
which

in any case...TELL Your client you'll be glad to allow ONLY Sproc access to the data...and ask them for a BRD

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

manju3606
Yak Posting Veteran

India
78 Posts

Posted - 12/29/2011 :  00:38:25  Show Profile  Reply with Quote
quote:
Originally posted by visakh16

quote:
Originally posted by manju3606

Hi Visakh,

client want to see witch query's are useing or used in ssms.

so for that purpose i am storing those query's witch are used in ssms.

Thanks


Manju


why should you store it in table?
FOr that you can make use of dmvs or profiler traces

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




client don't want to use profiler,and from Dmvs i cant get all data, in some case like dmvs have some time of pired to store data and if server restart then i cat get old data from dmvs and etc.

Thanks


Manju
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 12/29/2011 :  00:48:44  Show Profile  Reply with Quote
hmm...ok
what will these queries be used for? just analysing or they'll try executing it too?

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

Go to Top of Page

manju3606
Yak Posting Veteran

India
78 Posts

Posted - 12/29/2011 :  01:07:56  Show Profile  Reply with Quote
They want to analys these queries and now they want most used data in the database so for that they want to cxecut these query and i told them thats not a good idea but they are not listening me could you please tell me any way to get most used data and not used data from database

Thanks

Manju
Go to Top of Page

DonAtWork
Flowing Fount of Yak Knowledge

2161 Posts

Posted - 12/29/2011 :  06:42:40  Show Profile  Reply with Quote
quote:
Originally posted by manju3606

client don't want to use profiler,and from Dmvs i cant get all data, in some case like dmvs have some time of pired to store data and if server restart then i cat get old data from dmvs and etc.

Thanks


Manju


Then the client does not understand what they want.


http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 12/29/2011 :  09:18:51  Show Profile  Reply with Quote
I'm sorry...but why does all the insanity
Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/



Edited by - X002548 on 12/29/2011 09:59:35
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000