Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
fastmichaels
Yak Posting Veteran
71 Posts |
Posted - 2009-01-07 : 07:42:12
|
| Hi everyone.I am using visual web developer 2008 express and sql server express 2005.My web application has the default ASPNETDB.MFD database and I have set up a connection to a separate database of my own so i can display the contents of the database on the website. What I want to do is to control access to my database on the website by combining it with the aspnetbd (login) so I can create some relationships between the two so if you are logged in you can only see data connected to your login details.I think I can do this if I made one database out of the two but the express version of sql managment sudio does not have the import/export wizard, so is there any other way of importing and merging the login database (ASPNETDB.MFD) with my other database?Thanks everyone! |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-01-07 : 10:45:56
|
| Have you looked at Linked Server or Opendatasource? |
 |
|
|
fastmichaels
Yak Posting Veteran
71 Posts |
Posted - 2009-01-07 : 11:04:06
|
quote: Originally posted by sodeep Have you looked at Linked Server or Opendatasource?
To be honest I don't know what they are but I have ran aspnet_regsql.exe and created a new membership database for sql server, so now I have the aspnetdb membership database in sql server format. I will be merging the two together. I havn't worked out how to do that yet. Any ideas?How can you merge two sql express 2005 databases together because in sql management studio if you right click on a table there is no option to copy.ThanksJames |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-01-07 : 11:10:00
|
| Does both databases exist in same instances of SQL Server? |
 |
|
|
fastmichaels
Yak Posting Veteran
71 Posts |
Posted - 2009-01-07 : 11:15:47
|
quote: Originally posted by sodeep Does both databases exist in same instances of SQL Server?
Yes |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-01-07 : 11:26:26
|
| Then use:Script definition for required tables from source to destinationUse:Insert into [Destinationdb].[schema].[Tablename]select * from [SourceDB].[Schema].[Tablename]Apply constraints from Source tables by scripting.You can script SP and views and functions if you have to. |
 |
|
|
fastmichaels
Yak Posting Veteran
71 Posts |
Posted - 2009-01-07 : 12:07:58
|
quote: Originally posted by sodeep Then use:Script definition for required tables from source to destinationUse:Insert into [Destinationdb].[schema].[Tablename]select * from [SourceDB].[Schema].[Tablename]Apply constraints from Source tables by scripting.You can script SP and views and functions if you have to.
Do you have to copy each table seperately? can you just use:insert into [destinationdb]select * from [sourcedb]GO |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-01-07 : 16:10:54
|
quote: Originally posted by fastmichaels
quote: Originally posted by sodeep Then use:Script definition for required tables from source to destinationUse:Insert into [Destinationdb].[schema].[Tablename]select * from [SourceDB].[Schema].[Tablename]Apply constraints from Source tables by scripting.You can script SP and views and functions if you have to.
Do you have to copy each table seperately? Yescan you just use:insert into [destinationdb]select * from [sourcedb]No.GO
|
 |
|
|
fastmichaels
Yak Posting Veteran
71 Posts |
Posted - 2009-01-08 : 05:19:18
|
quote: Originally posted by sodeep
quote: Originally posted by fastmichaels
quote: Originally posted by sodeep Then use:Script definition for required tables from source to destinationUse:Insert into [Destinationdb].[schema].[Tablename]select * from [SourceDB].[Schema].[Tablename]Apply constraints from Source tables by scripting.You can script SP and views and functions if you have to.
Do you have to copy each table seperately? Yescan you just use:insert into [destinationdb]select * from [sourcedb]No.GO
Thanks, but when I do not use GO when putting the instruction into sqlcmd, it does not carry out the instruction but goes onto line 3 like its waiting for further instruction |
 |
|
|
|
|
|