Showing posts with label copy. Show all posts
Showing posts with label copy. Show all posts

Thursday, March 29, 2012

Export Empty Database

This is kind of a elementary question, but how do you export an empty copy of a SQL 2005 database to a backup file? Basically I need a backup without any of the data. Thanks!what you want is just the scripts for the objects then.

you can use GSW for this, or this console app: http://www.codeplex.com/scriptdb|||I think I already accomplished this using SQL Management Studio. Is that all I need?|||yea, that works. that's what I meant by GSW - "generate scripts wizard" in ssms.

Friday, March 23, 2012

Export and Import Database from Sql 2000 to Sql 2005

Need help exporting a database from Sql 2000 Exterprise and Import it to Sql 2005 using Sql Developer.

I have tried to do a detach - copy mdf & ldf to new syatem and then do an attach - This doesn't seem to work

Also tried backup on 2000 and then Resore on 2005. This doe not seem to work.

Source system is 64bit and destination system is 32bit

Not 100% certain but the problem is probably with the 64bit to 32bit conversion problem. The binary files are probably incompatible.

Try and straight db copy Management Studio by right clicking the on the database | Tasks | Copy DB. Make sure not use the detach and re-attach method.

Monday, March 12, 2012

Expiry Time on Eval SQL Server

Hi,
How do find out when the Eval Copy of SQL Server 2000
will expire ?. Thanks in advance.
Perhaps you can look at the date the "Microsoft SQL Server" folder was =
created under Program Files. This should indicate the date SQL Server =
was installed. Add 120 days and that should give you the expiration =
date.
--=20
Keith
"MB" <m1brooks@.hotmail.com> wrote in message =
news:1a8bf01c44f16$bf953cc0$a601280a@.phx.gbl...
> Hi,
> How do find out when the Eval Copy of SQL Server 2000=20
> will expire ?. Thanks in advance.

Expiry Time on Eval SQL Server

Hi,
How do find out when the Eval Copy of SQL Server 2000
will expire ?. Thanks in advance.Perhaps you can look at the date the "Microsoft SQL Server" folder was =created under Program Files. This should indicate the date SQL Server =was installed. Add 120 days and that should give you the expiration =date.
-- Keith
"MB" <m1brooks@.hotmail.com> wrote in message =news:1a8bf01c44f16$bf953cc0$a601280a@.phx.gbl...
> Hi,
> How do find out when the Eval Copy of SQL Server 2000 > will expire ?. Thanks in advance.

Expiry Time on Eval SQL Server

Hi,
How do find out when the Eval Copy of SQL Server 2000
will expire ?. Thanks in advance.Perhaps you can look at the date the "Microsoft SQL Server" folder was =
created under Program Files. This should indicate the date SQL Server =
was installed. Add 120 days and that should give you the expiration =
date.
--=20
Keith
"MB" <m1brooks@.hotmail.com> wrote in message =
news:1a8bf01c44f16$bf953cc0$a601280a@.phx
.gbl...
> Hi,
> How do find out when the Eval Copy of SQL Server 2000=20
> will expire ?. Thanks in advance.

Expirting a copy of DB

Hi,

I am trying to send a copy of my database to a 3rd party.

I initally thought that a simple CSV woult be the perfect solution. However, their database columns are labeled differently to mine, and also in a different order.

Is it possible to create a custom header to a csv file (so I can rename the columns), and also read from the columns in a certain order?

I waould also like this CSV to be generated automatically, at the end of every day. Is this possible?

Thanks,

Glyn.

The best solution is to backup the database and zip the .bak file and email it or put it in a CD and send it to the person with the instructions to place the .bak file in the backup sub folder in Microsoft SQL Server under programs and use the backup and restore wizard to recreate it with the restore from a device option. If you need to send data to the person daily you can use a DTS package or manual insert into. Hope this helps.|||

Thanks for the quick response, I'm not sure that this would work. Pleease correct me if I'm wrong.

The third party requires the file to have a .blm extension (I think it's a custom extension; .txt renamed)
The .blm file needs to contain a header (to show the DB columns) followed by the data, and should look something like this:

#Header#
DB_Field1^DB_Field2^DB_Field3^DB_Field4^DB_Field5^~
#Data
Row1Field1Data^Row1Field2Data^Row1Field3Data^Row1Field4Data^Row1Field5Data^~
Row2Field1Data^Row2Field2Data^Row2Field3Data^Row2Field4Data^Row2Field5Data^~
Row3Field1Data^Row3Field2Data^Row3Field3Data^Row3Field4Data^Row2Field5Data^~
...
...
...
#END#

I do not know much about backing up a databases... Which is the best way to go? CSV or BAK?

Thanks

Glyn

|||If the third party is running the same version of SQL Server all you need is the .bak file I know I have restored a .bak file from CD and emailed. And I cannot help you with CSV files because it is not RDBMS (relational database management systems) file. Hope this helps.|||

I have no idea what sort of database the third party are using. Their support people say they need a 'Data Stream' (as they call it), in the format I showd in my previous post. This format is very close to that of a CSV, which is why I was going down the CSV route.

Can anyone help with custom CSV's, or post some links to good articals??

Thanks.

Wednesday, March 7, 2012

Expanding Hierarchies - SQL 2000

>Ideas, thoughts, links to examples where this has already been done? <<

Get a copy TREES & HIERARCHY IN SQL and look at the Nested Sets model
for BOM. It will be much easier than what you are doing.i second that
its pretty simple and easy to implement. no recursion is a plus

On Dec 19, 12:21 am, --CELKO-- <jcelko...@.earthlink.netwrote:

Quote:

Originally Posted by

Quote:

Originally Posted by

Quote:

Originally Posted by

Ideas, thoughts, links to examples where this has already been done? <<


>
Get a copy TREES & HIERARCHY IN SQL and look at the Nested Sets model
for BOM. It will be much easier than what you are doing.

Friday, February 24, 2012

Existing Stored Procedures

hi,

is there someway I can use to copy an existing stored procedures to another database?

Thanks!

jocker_wow:

copy an existing stored procedures to another database?

This is one way:
Goto Enterprise Manager then select Server, DB and Select the stored procedure
Tip: To select more that one proc do Shift and select.
After selecting stored proc or procs right click and

select "All Task" and then "Generate SQL Script".
Then you see a screen Pop-Up - then select "Options" in that Tab.
Please Check- Script Object-Level Permissions - for permissions.
Then say ok and give the path where you want to store the file.

Next step is open the file created by SQL server in Query analyser and execute it on the destination Database.

Another way of doing this:

Sp_helptext "Stored Proc name" for the list of stored you need move.
Note: Only one proc name at a time. eg:
Sp_helptext "Proc1"
Sp_helptext "Proc2" etc

Tips: change the display mode of the query analyser to Text mode
Then copy all the result to another window and execute it against desitnation DB.
Note: In this way it will not copy permissions.

another helpful link..

Need help with copy stored procedure from one database to another - MSDN Forums

hope it helps./.

|||

Thankskaushalparik27! I've already found that solution, but my problem still exists!

Coping the stored procedures was a part from my big problem, I want to copy my local database to a remote database, you can check my posthere if you can help

|||

Hi

copy means, i can'tunderstandexactly what you need? anyway we can use a store procedure to another database if the same table and fields are there what you mentioned in existingstored procedure by create procedure on new database

|||

Yes it is the same database but it exists in the remote host. I've solved the SP part, but I'm stuck in other problem:

http://forums.asp.net/p/1193730/2057106.aspx#2057106

Thanks in advance

|||

if you generate Script for your table from "All Task" then it will also script the PK, FK relation ships between tables...

here is one sample script generated...

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Table_1]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Table_1](
[id] [nchar](10) NOT NULL,
CONSTRAINT [PK_Table_1] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Table_2]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Table_2](
[id] [nchar](10) NULL
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_Table_2_Table_1]') AND parent_object_id = OBJECT_ID(N'[dbo].[Table_2]'))
ALTER TABLE [dbo].[Table_2] WITH CHECK ADD CONSTRAINT [FK_Table_2_Table_1] FOREIGN KEY([id])
REFERENCES [dbo].[Table_1] ([id])

GO
ALTER TABLE [dbo].[Table_2] CHECK CONSTRAINT [FK_Table_2_Table_1]