Is There any way to share SQL Server 2008 Diagrams - sql-server-2008

Is there any way we can share the SQL Server 2008 database Diagram (Other then capturing the jpeg).

I've used the 2005 version of this tool which did the job very nicely.
EDIT: The original link is dead. However http://devnuggets.blogspot.com/2011/04/script-diagram-really.html seems to be the same person's code for scripting/moving diagrams.

The SQL Server 2008 diagrams are stored in a sysdiagram table in the same database as a binary value.
We can copy the binary data and then reinsert them at another databse to recreate them there. But the table structure of the database needs to be there as well. So in this case it is of no important use for sharing.

Related

From Access to SQL Server 2008

I am struggling a bit with the following. Our forecasting tool generates some 100k of records of forecast information in Access each month. The tool is an Excel - Access combination. I want to upload the data from Access to SQL Server after the forecast is done (for multiple purposes). I tried to look up the most easy way but not sure what to use. ADO seems handy where I could integrate that in an existing macro that cleans up the database. Anybody done this before and has some snippet of code to use?
We use SQL Server Management Studio 2008, but not sure whether that's relevant here.
Thanks in advance,
Michiel
In Access, link via ODBC the tables in SQL Server you wish to upload to.
Then create and run append queries to insert the data in the linked tables.
I suggest using SSIS package which is started by job on sql server side (by shedule or manual). You can create package with the help of sql server import/export wizard. I think this is the best way to import data from access to sql server.
Thanks for the answers. I will try to do the linked table way, but I already had a look to that and it seems that due to the fact that I use citrix server I was not able to link it directly to SQL server via ODBC. So I have to check what's different there. Not familiar with the SSIS package yet but I will definitely look into that if the first option does not seem to work out.
Thanks again guys

Data in SQL Server 2008 Express edition does not show up after insert?

I have a SQL Server 2008 Express edition database and I am inserting data to it via a windows application, using Linq-to-SQL. I know the data exists in database because when I query the database I get some data but in SQL Server Management Studio when I right click on a table and click even : 'Edit top 200 rows' or 'Select top 1000 rows' I can not view any data ! any helps ?
Assuming you're using the User Instance and AttachDbFileName= approach - I would argue this approach is severely flawed. Visual Studio will be copying around the .mdf file and most likely, your INSERT works just fine - but you're just looking at the wrong .mdf file in the end!
If you want to stick with this approach, then try putting a breakpoint on the myConnection.Close() call - and then inspect the .mdf file with SQL Server Mgmt Studio Express - I'm almost certain your data is there.
The real solution in my opinion would be to
install SQL Server Express (and you've already done that anyway)
install SQL Server Management Studio Express
create your database in SSMS Express, give it a logical name (e.g. VictoryDatabase)
connect to it using its logical database name (given when you create it on the server) - and don't mess around with physical database files and user instances. In that case, your connection string would be something like:
Data Source=.\\SQLEXPRESS;Database=VictoryDatabase;Integrated Security=True
and everything else is exactly the same as before...
I believe LinqToSql has a "Save" command that actually writes the data to the database. Until that happens you are merely holding it in memory.
ETA: see this question and its answers

How to dump specific tables to a sql script using SQL Server or bcp.exe

Is there a way to dump the content of a few SQL Server tables into a file consisting of standard INSERT INTO statements of my SQL Server database?
You can use Ms Sql Publisher wizard . This will help you to create scripts based on your database schema, data or even both. Please check this link if you want to do it in Visual Studio 2008
Also, there is this article on codeproject which uses Ms Sql Publisher Wizard
A step by step process to support my answer.
If you need it as one-off, look here
http://www.codeproject.com/KB/database/sqlinsertupdategenerator.aspx

sql-server-2008 audit tables

In one of my application Iam using SQL SERVER 2008, I like to implement audit tables for few tables. One option I have to create triggers on the respective tables. Can anyone suggest me any other good, robust and secure option.
SQL Server 2008 has a new auditing feature: Auditing in SQL Server 2008.
There is also Change Data Capture
Triggers are the usual way to go. Another option could be to handle this in your stored procedures. Of course this assumes, that all data modification goes via stored procedure. Since you are on SQL Server 2008 and assuming you don't care about any lower version, check out the new auditing features here: http://msdn.microsoft.com/en-us/library/dd392015.aspx
You don't mentione which edition of SQL Server you are using as the Auditing features are only available in the Enterprise edition.
You should download a copy of the free eBook Developing Time-Oriented Database Applications in SQL by Richard T. Snodgrass from here: http://www.cs.arizona.edu/people/rts/tdbbook.pdf.
He talks about auditing and many other time related issues in databases.

Convert a MySql database to MS SQL Server 2005 with data?

I'm trying to create a completely new database from an existing MySQL database, bringing over both data and schema, but so far the only way I've been able to do this is to first import the MySQL database into MS Access, and then into SQL Server 2005? Crazy right? Surely, there is a way that doesn't involve a tedious, custom time-consuming programming, right (perhaps using SSIS)?
A few additions to my original description above:
Its a pretty good size database (easily a few gigs).
I'm working in an MS environment (asp.net, C#)
I'm under a tight deadline so I'm looking for an automated process that requires little to no effort in the conversion process.
SSIS would be the preferred way via BIDS (VS 2005)
Thanks for all the great input!
I believe that using the phpMyAdmin tool you can script the MySQL database structure and data into a sql script. Then you simply run those two scripts on your SQL Server 2005 database and it should, in most cases, create the database and fill it with data. It's been a couple years since I had to do it myself, but as I recall that was the process I used to transfer a MySQL database to SQL Server in the past. You will probably have to alter the structure script to change some of the data types to their SQL Server equivalents, but the data should load just fine once you've got the data types all sorted.
I think you can use SQLYog to generate some fairly standard SQL which will dump out and recreate your db, with data. You may have to massage its output for SQL Server's dialect of SQL a bit, though...
The responses I received were certainly helpful, but the solution it would seem is to do a mysqldump and then run that script from SSIS, massaging the output as needed; however, AFAIK it is not possible to use VS 2005 BIDS to create an SSIS package that completely transfers a MySQL database to a SQL Server 2005 database (data and schema) using Windows Vista 64. I said AFAIK, but who knows the interwebs have much to reveal :)