Monthly Archives: January 2010

Get All Tables and Storeprocedure of the Database in Sqlserver

Sometimes we have to   collect all tables or stored procedures of your database with schema name.Use the below script to get all the tables or stored procedures.  To Get all Tables Below script  SELECT ”+SCHEMA_NAME(schema_id)+’.’+name+” AS AllTable FROM sys.tables  To Get … Continue reading

Posted in Articles | Tagged , , | Leave a comment

Location of Data File Using T-SQL

Some times we need know the location of Data file of databases of sqlserver.Below script display the all the .mdf and .ldf files of sqlserver. select Name as DataBasename,Physical_name as Location From master.sys.master_files

Posted in Articles | Tagged , , | Leave a comment