Check if extended property description already exists before adding

This first script checks if the extended property describing the table exists: IF NOT EXISTS (SELECT NULL FROM SYS.EXTENDED_PROPERTIES WHERE [major_id] = OBJECT_ID(‘Table_Name’) AND [name] = N’MS_Description’ AND [minor_id] = 0) EXECUTE sp_addextendedproperty @name = N’MS_Description’, @value = N’This table is responsible for holding information.’, @level0type = N’SCHEMA’, @level0name = N’dbo’, @level1type = N’TABLE’, @level1name … Read more

Can you explain the use of sys.sp_addextendedproperty in the following code?

It looks like you used the GUI designer to create the view. In order to save the graphical layout of your tables in the designer, it’s storing this metadata as an extended property. It doesn’t affect how the view is actually processed. It’s just so that you can run the designer again and have it … Read more

Read/Write ‘Extended’ file properties (C#)

For those of not crazy about VB, here it is in c#: Note, you have to add a reference to Microsoft Shell Controls and Automation from the COM tab of the References dialog. public static void Main(string[] args) { List<string> arrHeaders = new List<string>(); Shell32.Shell shell = new Shell32.Shell(); Shell32.Folder objFolder; objFolder = shell.NameSpace(@”C:\temp\testprop”); for( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)