Database Problems

Thursday, November 15, 2012

How to select all tables with a particular name in database

Either sysobjects (where type='u'),
or (more correctly) the info-schemas:

SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE '%CUSTOMER%' -- or "='CUSTOMER'" for exact

Posted by Unknown at 12:48 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: SQL Server

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2013 (7)
    • ►  October (1)
    • ►  May (6)
  • ▼  2012 (17)
    • ▼  November (17)
      • How to do a SQL NOT NULL with a DateTime?
      • How to set a check on SQL Server?
      • How to get total sum
      • How to add the column by default in sql server 2005
      • How to call a stored procedure from a user defined...
      • How to use BETWEEN in a reference table
      • How to sort date in mssqlserver
      • How to check if the log-in exists in sql server?
      • Search all tables for a particular GUID
      • How to select all tables with a particular name in...
      • On what basis relationship between tables are defined
      • Do i need a special database constraint on this ta...
      • Constraint for one-to-many relationship
      • The values of one column cannot be greater than an...
      • Scalar functions, inlining, and performance
      • How many join have in SQL?
      • How to update all varchar, nvarchar or char field ...
Simple theme. Powered by Blogger.

adf.ly