Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
azamsharp
Posting Yak Master
201 Posts |
Posted - 2009-10-07 : 13:15:12
|
| Hi, Let's say I have a simple query: select FirstName, LastName, MiddleName from Customers How can I find out from the Query above that the MiddleName field is nullable and allows null. The actual query is little complicated with views and stuff but how can I achieve the above.Mohammad Azam www.azamsharp.net |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
azamsharp
Posting Yak Master
201 Posts |
Posted - 2009-10-07 : 13:19:51
|
| sp_help Customers will give me schema information related to Customers table. What I want is the query results to indicate the schema of the tables used in the query. select c.FirstName, c.LastName, c.MiddleName, o.OrderName, o.Quantity from Customers c join Order o on c.CustomerId = o.OrderId In the above query I want to know that if the OrderName, Quantity is allow nullable in the database. Is that possible?Mohammad Azam www.azamsharp.net |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2009-10-07 : 14:28:23
|
I don't know how to do it for a query, but if you know the table names you can use the INFORMATION_SCHEMA views:SELECT *FROM INFORMATION_SCHEMA.ColumnsWHERE TABLE_NAME IN ('Customers', 'Order') |
 |
|
|
|
|
|