Showing posts with label functions. Show all posts
Showing posts with label functions. Show all posts

Friday, March 30, 2012

Migrating form access to SQL

I am facing problems in migrating my application from Access to SQL.
Few of the fuctions like CBDATE (userdefined functions) are not working.
Please let me know how to overcome this problem.
ThanksHi Manas. I am unaware of a function within Access called CBDATE...is it something you designed and coded (in VBA possibly)? There are a many things you can do in SQL to get the same functionality, but could you post an example code snipet for what that function does?|||

Note he stated it was a user defined function.

You will have to migrate that function into SQL, along with the rest of the database.

|||Did you define the function in the database itself (can you do that in Access?), or in the front end?|||In access you can write functions in VBA that can be called from queries...I'm assuming that's what was being done...|||Ah yes, you are most probably correct. In that case, I presume he will have to write an analagous function in SQL to correct that, with the same name and return type?|||Yeah, I would assume that to be the case...problem would be if the VBA function is doing anything you can't do in T-SQL...then it would be more difficult...

Wednesday, March 28, 2012

Migrating database

Can anyone tell me how I can migrate database from one server to another
I need to migrate all the tables, stored procedures, functions and so on

thank youYou can use the Copy Database Wizard to achieve this. See BOL for more info.

As you are moving the database to a new server, you will have to manually delete the data and log files on the old server once the copy process has completed.|||Can anyone tell me how I can migrate database from one server to another
I need to migrate all the tables, stored procedures, functions and so on

thank you

As noted earlier, you can use the Copy Database Objects wizard. Or:

1. You can load a backup of your database onto the new database (you will have to manually add in SQL Logins and resynch those logins with the users in the new database).

2. You can detach the old database, copy over the .mdf and .ldf files and then attach it to a new server (again, you will have to manually handle SQL Logins and synch them to the new db).

Regards,

hmscott|||I dont want to detach the old database. That needs to stay the way it is. Can I just copy over all the tables, sp, views and fns along with the logins. Would it work that way. I know its going to be a lot of work but it seems like the simplest way to go without making changes to the old database