ForeignKeyofall tables for a sqlserver db with tables and columns
/* Foreign Key of all tables for a sqlserver db with tables and columns */
WITH ConstraintAndTableName AS
(SELECT sysobjects1.name AS ChildTablename,
sysobjects.name AS ConstraintName
FROM sysforeignkeys INNER
JOIN sysobjects ON sysforeignkeys.constid = sysobjects.id
AND sysforeignkeys.fkeyid = sysobjects.parent_obj INNER
JOIN sysobjects AS sysobjects1 ON sysobjects.parent_obj = sysobjects1.id
syso1.name AS TableName,
sysc1.name AS ColumnName,
sysc1.colid AS Pos,
syso2.name AS MasterTableName,
sysc2.name AS MasterColumnName,
FROM sysforeignkeys sysfk INNER
JOIN sysobjects syso1 ON sysfk.fkeyid = syso1.id INNER
JOIN sysobjects syso2 ON sysfk.rkeyid = syso2.id INNER
JOIN syscolumns sysc1 ON sysfk.fkey = sysc1.colid AND sysc1.id = syso1.id INNER
JOIN syscolumns sysc2 ON sysfk.rkey = sysc2.colid AND sysc2.id = syso2.id INNER
JOIN ConstraintAndTableName ON sysfk.constid = ConstraintAndTableName.id
AND syso1.name = ConstraintAndTableName.ChildTablename
ORDER BY TableName
I have always read that 8060 bytes is the maximum size. This is stated over and over again in Books Online, the MS site and numerous other sites, including this one. However a post in our forum recently questioned this. I decided to verify the problem and do a little research.
The User_Defined_Functions.exe file contains the User-Defined Functions white paper. The User-Defined functions white paper outlines the characteristics of the new user-defined function (UDF) feature that is introduced in Microsoft SQL Server 2000. The white paper also summarizes how you can create your own Transact-SQL functions to extend the programmability of Transact-SQL.
The following stored procedure will demonstrate the use of cursor metadata. Using cursor metadata we can get information about an SQL statement and use that information to dynamically generate other code such as HTML or other stored procedures.
ne of the issues you face when building Web applications is handling the errors you encounter when interacting with a back-end database. I was recently working with someone to create a new Web site with SQL Server™, ActiveX® Data Objects (ADO), and ASP. Lots of little things came up that I thought were worth sharing with MIND readers, so I'll focus this column on what I learned from this experience and the solutions to many of the problems I faced.