SQL Prompt Popular Snippets: CDB (CREATE DATABASE)

preview_player
Показать описание

In this tip Data Platform MVP Steve Jones explains how to make best use of one of SQL Prompt's most popular snippets, CDB, to create new databases in a flash.

Transcript:
Hi I'm Steve Jones and I've got another quick SQL Prompt tip brought to you by Redgate Software. One of things that I often do is I'll end up creating a database and typically I'll do with something like this which is a simple and easy way to do that. But I can't customize anything and this doesn't necessarily meet the standards for my organization.

SQL Prompt makes this easier. You’ll notice I have this CDB snippet, and when I hit tab I actually get the chance to enter that database name here at the top, and it will fill out the proper virtual file name and physical file names for me for both the date and the log and these other items and comments here. Let me customize a snippet that will work a little better for me. I’ve gone ahead and customized this snippet. You'll notice this time when I type this in and hit tab what I actually get is not only the name here but I've got the full path for this particular system setup. So if I have a standard path for all my servers that's there. Notice I've actually changed virtual name to be T log here so there's no confusion as well. And I've set trustworthy on because typically when I’m creating databases I've got trustworthy on because they’re development databases. If I execute this entire statement it runs just fine and then I will see that I've in fact got a demo database here in my system.

Hopefully this is a quick tip for SQL Prompt that will help you when you build databases.

I'm Steve Jones for SQL Server Central and Redgate Software.
Рекомендации по теме
welcome to shbcf.ru