Showing posts with label design. Show all posts
Showing posts with label design. Show all posts

Friday, March 9, 2012

Email a DB

Hi folks
If I wanted to email a database (not including any data - just the design),
is there a way it can be done?
Thanks in advance
Kind regards
Ross PetersenYou can script the database and send the script across,
so that the receiver can rebuild the database from the script.
--
Roji. P. Thomas
Net Asset Management
http://toponewithties.blogspot.com
"Ross" <Ross@.discussions.microsoft.com> wrote in message
news:DCEE4255-CC31-4D00-A02A-C04E5B36857F@.microsoft.com...
> Hi folks
> If I wanted to email a database (not including any data - just the
> design),
> is there a way it can be done?
> Thanks in advance
> Kind regards
> Ross Petersen|||"Ross" <Ross@.discussions.microsoft.com> wrote in message
news:DCEE4255-CC31-4D00-A02A-C04E5B36857F@.microsoft.com...

> If I wanted to email a database (not including any data - just the
> design),
> is there a way it can be done?
Why not just script the whole database, save it to a file, and email that?
The recipient can then use the script to create an exact copy of your
database...|||Ross
You may want to look at
http://support.microsoft.com/defaul...b;en-us;Q320125
Also , you can script the database , zip or rar it and then send it to the
someone.
"Ross" <Ross@.discussions.microsoft.com> wrote in message
news:DCEE4255-CC31-4D00-A02A-C04E5B36857F@.microsoft.com...
> Hi folks
> If I wanted to email a database (not including any data - just the
> design),
> is there a way it can be done?
> Thanks in advance
> Kind regards
> Ross Petersen|||hi
you can generate the script and then e-mail the script to the destination
please let me know if u have any questions
--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://groups.msn.com/SQLResource/
---
"Ross" wrote:

> Hi folks
> If I wanted to email a database (not including any data - just the design)
,
> is there a way it can be done?
> Thanks in advance
> Kind regards
> Ross Petersen

Sunday, February 19, 2012

Efficient table record size

I understand that I can put a massive 8K varchar in one data page, but I want to know if that is the best design.

I have a data stream that can be from 10 to 7000 characters. 90% of the time the field data length is less than 700 characters. Is it better to create one massive varchar field or to create multiple smaller varchar fields? (Perhaps varchar(700) fields ten times.) Or does it matter?

(Also, the record is primarily inserted once then just read from then on.)

The query with the smaller fields would look like this:

SELECT RTRIM(
LEFT( ReportStream1 + SPACE(700), 700) +
LEFT(ISNULL(ReportStream2 , '') + SPACE(700), 700) +
LEFT(ISNULL(ReportStream3 , '') + SPACE(700), 700) +
LEFT(ISNULL(ReportStream4 , '') + SPACE(700), 700) +
LEFT(ISNULL(ReportStream5 , '') + SPACE(700), 700) +
LEFT(ISNULL(ReportStream6 , '') + SPACE(700), 700) +
LEFT(ISNULL(ReportStream7 , '') + SPACE(700), 700) +
LEFT(ISNULL(ReportStream8 , '') + SPACE(700), 700) +
LEFT(ISNULL(ReportStream9 , '') + SPACE(700), 700)
)
FROM ReportStream
WHERE StreamID = 123

It depends on what you want to do with the data. If the data is always selected as one chunk, performance wise, it is better to store it as a single column.

For each varchar column, you get a little bit storage overhead (about 2 bytes per column) that will be stored as well, so having one column is better from storage point of view.

However, if you frequently want to query subsets of your string (i.e. you only are interested in the first few characters, and want to do queries based on that), it makes more sense to have multiple columns, so that you can more easily query and index these substrings.

Thanks,

Marcel van der Holst
[MSFT]

Wednesday, February 15, 2012

Editing table design

Is there anyway possible to edit table design with data already entered in the table.
If not, is there anyway I can cut and paste the info back in.
Ive tried importing to access and then back to SQL, however,
when i tried to view my table design in ASP.NET webmatrix, it gave me an error.Try the link below for ALTER Table in SQL Server. Run a search for same in SQL Server BOL(books online) to do the same in Enterprise Manager. Hope this helps.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_aa-az_3ied.asp