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
 General SQL Server Forums
 New to SQL Server Programming
 sql tables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

a4u6178
Starting Member

India
11 Posts

Posted - 08/04/2011 :  04:20:16  Show Profile  Reply with Quote
Hello enveryone,

How can i make exec sp_tables accept database name explicitly..

when i execute the exec sp_tables this query, it takes database name by defualt (current database) how can i make it accept database name as parameter.


Thanks & Regards,
Asif


Edited by - a4u6178 on 08/04/2011 04:37:35

khtan
In (Som, Ni, Yak)

Singapore
17584 Posts

Posted - 08/04/2011 :  04:58:13  Show Profile  Reply with Quote
quote:
How can i make exec sp_tables accept database name explicitly

It is a system stored procedure. You can't change it.

You can write your own stored procedure or when execute sp_tables prefix it with the database name

exec [your database name]..sp_tables '<table name>'



KH
Time is always against us

Go to Top of Page

a4u6178
Starting Member

India
11 Posts

Posted - 08/04/2011 :  05:42:37  Show Profile  Reply with Quote
Thank You very much khtan. ur code snippet working fine for me..


Thanks & Regards,
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.12 seconds. Powered By: Snitz Forums 2000