SQLServer-QA.net - Knowledge Sharing Network (SSQA.net)
Invisible community contributions, Visible success to users
Browse by Tags
All Tags
»
columns
(
RSS
)
best practice
check
computed
databases
enterprise manager
FAQ
included
indexes
information schema
kalen delaney
merge
performance
replication
schema
script
snapshot
sp_help
sp_helpindex
sql queen
sql server
statistics
structure
table
tablename
tables
transactional
tsql
Different ways to know structure of a table
Published 28 February 8 2:51 AM |
SSQA.net
You can use one of the following to know the structure of a table 1 Generate SQL Script option from Enterprise Manager/Management Studio 2 select * from information_schema.columns where table_name='table_name' 3 EXEC sp_help 'table_name'...
SQL Server SP_HELPINDEX - updated version that includes column names
Published 3 January 8 1:46 PM |
SSQA.net
Here is the incentive for the SQL Server users (this new year), you may be aware then using SP_HELPINDEX or SP_HELP could give some part of information on the indexes and database objects. But to know more about depedant columns you need to query INFORMATION_SCHEMA...
Replication FAQ series - Which columns are published in snapshot or transactional or merge publications in this database?
Published 11 December 7 6:48 PM |
SSQA.net
Here is script you can find which columns are published in the replication that is using either snapshot or transactional or merge publications. --For snapshot or transactional publications select object_name(object_id) as tran_published_table, name as...
TSQL to check whether the table has a column with the specified name?
Published 19 September 7 5:51 PM |
SSQA.net
Within SQL Server 2005: if Exists( select * from sys.columns where Name = N '<ColumnName>' and Object_ID = Object_ID ( N '<TableName>' ) ) begin --write your own code print relevant code columns for existence end else begin...
Getting table name from column name
Published 15 September 7 7:23 AM |
SSQA.net
If you know the name of one column you want to find from which table that is originated, to retrieve the table name you can use following TSQL: SELECT CASE (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS AS c2 WHERE c2.TABLE_NAME = c1.TABLE_NAME AND...
TSQL to find computed column expression columns
Published 27 July 7 2:34 AM |
SSQA.net
USE <dbname>; GO SELECT OBJECT_NAME(d.referenced_major_id) AS referenced_name ,COL_NAME(d.referenced_major_id, d.referenced_minor_id) AS referenced_columns ,OBJECT_NAME(referenced_major_id) AS dependent_object_name ,COL_NAME(d.object_id, d.column_id...
How do I find all the statistics and statistics columns on a specified object?
Published 16 July 7 7:46 AM |
SSQA.net
USE <database_name>; GO SELECT s.name AS statistics_name ,c.name AS column_name ,sc.stats_column_id FROM sys.stats AS s INNER JOIN sys.stats_columns AS sc ON s.object_id = sc.object_id AND s.stats_id = sc.stats_id INNER JOIN sys.columns AS c ON...
Search
Go
This Blog
Home
Contact
About
Tags
2005
2008
best practice
best practices
blogs
conference
database
databases
dmv
download
error
high availability
indexes
kba
management
microsoft
performance
query
replication
security
sql server
ssis
ssms
tsql
webcast
Community
Home
Blogs
Media
Groups
Archives
January 2009 (10)
December 2008 (24)
November 2008 (20)
October 2008 (14)
September 2008 (26)
August 2008 (32)
July 2008 (27)
June 2008 (39)
May 2008 (60)
April 2008 (35)
March 2008 (48)
February 2008 (59)
January 2008 (63)
December 2007 (58)
November 2007 (43)
October 2007 (100)
September 2007 (110)
August 2007 (146)
July 2007 (106)
June 2007 (114)
May 2007 (78)
April 2007 (2)
News
Syndication
RSS for Posts
Atom
RSS for Comments
Email Notifications
Go