concept metadata in category sql

appears as: metadata, metadata
SQL Server MVP Deep Dives Vol. 2

This is an excerpt from Manning's book SQL Server MVP Deep Dives Vol. 2.

  • Store the file in the table column, and decide on the retrieval mechanism— This approach is a little more self-contained and less vulnerable than the first two. You’ve put the content with the metadata and you can back it up when you back up the database. You have the ability to put permissions on that column or table so that permission vulnerabilities can be addressed. But here’s the challenge: the size of the files are growing, which poses problems with scalability and storage concerns. The issue isn’t just the sheer size of the database: with BLOBs getting larger, the buffer pool is taking a hit on putting those files through and out the stream to the client. How do you know where to put these bigger files?
  • Listing 1. Enabling Service Broker and setting up transport security: DataReceiver
    USE master -- SET UP TRANSPORT SECURITY -- create a master key for the master database -- DO NOT FORGET THIS PASSWORD AND STORE IT SOMEWHERE SAFE CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Put_Your_Custom_Password_For_DataReceiver_Master_DB_Here' GO -- create certificate for the service broker TCP endpoint for secure --communication between servers CREATE CERTIFICATE CertificateDataTransferReceiver WITH -- BOL: The term subject refers to a field in the metadata of -- the certificate as defined in the X.509 standard SUBJECT = 'CertDataTransferReceiver', -- set the start date yyyyMMdd format START_DATE = '20111001', -- set the expiry date EXPIRY_DATE = '20500101' -- enables the certificate for service broker initiator ACTIVE FOR BEGIN_DIALOG = ON GO -- save certificate to a file and copy it to the DataSender instance -- so we can enable secure connection BACKUP CERTIFICATE CertificateDataTransferReceiver -- this path must be somewhere where we have permissions TO FILE = 'c:\CertificateDataTransferReceiver.cer' GO -- create endpoint which will be used to receive data from DataSender -- instance CREATE ENDPOINT ServiceBrokerEndPoint -- set endpoint to actively listen for connections STATE = STARTED -- set it for TCP traffic only since service broker only supports TCP --protocol -- by convention, 4022 is used but any number between 1024 and 32767 -- is valid. AS TCP (LISTENER_PORT = 4022) FOR SERVICE_BROKER ( -- authenticate connections with our certificate AUTHENTICATION = CERTIFICATE CertificateDataTransferReceiver, -- default value is REQUIRED encryption but let's just set it --to SUPPORTED -- SUPPORTED means that the data is encrypted only if the -- opposite endpoint specifies either SUPPORTED or REQUIRED. ENCRYPTION = SUPPORTED ) GO -- Finally grant the connect permissions to public. GRANT CONNECT ON ENDPOINT::ServiceBrokerEndPoint TO PUBLIC
    Returning metadata with a Dynamic Management View

    This is one of those little-known secrets that, with some creativity, you can use to take your solutions to a completely new level. Data Management Views return metadata about database objects such as object names, attribute values, and member sets. Dynamic Management View (DMV) queries can return information for just about any system object. This example will touch only the tip of the iceberg. Data Management View queries are parsed by the Analysis Services data provider, but the query execution is handled by a different set of objects than the OLAP storage engine. As such, the syntax isn’t standard MDX. It’s a blend of SQL, but it’s not really pure MDX, and the rules are a little different.