Additional SQL Server features and topics not covered by specific categories
My guess is that you had created the function inside a transaction which you had not committed. When the other dev restarted SQL Server, the transaction was rolled back.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi. A have a database. After backup I cannot find User Defined Functions. How can I solve it?
Additional SQL Server features and topics not covered by specific categories
My guess is that you had created the function inside a transaction which you had not committed. When the other dev restarted SQL Server, the transaction was rolled back.
Hi @Zokir Sobirjonov ,
Welcome to Microsoft Q&A!
Firstly, you can use the following script to check if the UDF is gone:
SELECT
name AS 'Function Name',
SCHEMA_NAME(schema_id) AS 'Schema',
type_desc AS 'Function Type',
create_date AS 'Created Date'
FROM
sys.objects
WHERE
type in ('FN', 'IF', 'FN', 'AF', 'FS', 'FT');
Yes. As TiborKaraszi said, > That shouldn't happen either.
You can use DBCC CHECKDB to check is the database corrupted.
If there is any corruption, you can restore another good backup. If you don't have a good backup, consider using the DBCC CHECKDB option REPAIR_ALLOW_DATA_LOSS. Of course, in order to prevent data loss, the best option is to restore a new good backup.
Best regards,
Seeya
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.