Showing posts with label figure. Show all posts
Showing posts with label figure. Show all posts

Tuesday, March 27, 2012

copy error

Can someone point me in the right direction to figure out
what's wrong here?
I'm trying to copy a very simple DB between two servers
using the SQL 2000 Enterprise Manager DB Copy Wizard. All
steps looks good up to detaching the source DB, but then
the actual copy of the share database mdf file to the
destination server fails. The Error Code in the Task
Detail box is 'failed'. The Error Code in the Step Detail
box is '-2147467259'.
The Package Log Error Description is:
Step Error Source: Microsoft Data Transformation Services
(DTS) Package
Step Error Description:Unspecified error
Step Error code: 80004005
Step Error Help File:sqldts80.hlp
Step Error Help Context ID:1100The reason and solution to your exact error/problem are given at:
http://support.microsoft.com/default.aspx?scid=kb;en-us;274463&Product=sql2k
"Tech - SBT" <bglynn@.sbtontheweb.com> wrote in message
news:1MCjb.147527$Of2.4215035@.twister.tampabay.rr.com...
> Can someone point me in the right direction to figure out
> what's wrong here?
> I'm trying to copy a very simple DB between two servers
> using the SQL 2000 Enterprise Manager DB Copy Wizard. All
> steps looks good up to detaching the source DB, but then
> the actual copy of the share database mdf file to the
> destination server fails. The Error Code in the Task
> Detail box is 'failed'. The Error Code in the Step Detail
> box is '-2147467259'.
> The Package Log Error Description is:
> Step Error Source: Microsoft Data Transformation Services
> (DTS) Package
> Step Error Description:Unspecified error
> Step Error code: 80004005
> Step Error Help File:sqldts80.hlp
> Step Error Help Context ID:1100
>|||I read that and don't see the exact problem. MORE INFO does not give me any
details nor an exact error.
"I_AM_DON_AND_YOU?" <user@.domain.com> wrote in message
news:%23eK7ukClDHA.2060@.tk2msftngp13.phx.gbl...
> The reason and solution to your exact error/problem are given at:
>
http://support.microsoft.com/default.aspx?scid=kb;en-us;274463&Product=sql2k
>
> "Tech - SBT" <bglynn@.sbtontheweb.com> wrote in message
> news:1MCjb.147527$Of2.4215035@.twister.tampabay.rr.com...
> > Can someone point me in the right direction to figure out
> > what's wrong here?
> >
> > I'm trying to copy a very simple DB between two servers
> > using the SQL 2000 Enterprise Manager DB Copy Wizard. All
> > steps looks good up to detaching the source DB, but then
> > the actual copy of the share database mdf file to the
> > destination server fails. The Error Code in the Task
> > Detail box is 'failed'. The Error Code in the Step Detail
> > box is '-2147467259'.
> >
> > The Package Log Error Description is:
> >
> > Step Error Source: Microsoft Data Transformation Services
> > (DTS) Package
> > Step Error Description:Unspecified error
> >
> > Step Error code: 80004005
> > Step Error Help File:sqldts80.hlp
> > Step Error Help Context ID:1100
> >
> >
>
>

Thursday, March 8, 2012

Copy data from tables with script!

Hello!

I cant figure out how to copy data from tables in my default database to my new automate-generated database.

I can generate Store Procedures, I can generate the Tables but are there anyone one who knows how to copy the data from tables and put it into my new automate-generated shell. The automate-generate funktion i have built just creating a shell/empty database. How to fill it with a sql-script or similar?

Anyone have any tip?

Regards

If you mean you want to script out the data into the same script with the DDL for the tables try the Database Publishing Wizard:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=29B4FFD8-AC3A-4481-B352-9B185619A901

|||

It worked perfectly!

Thanks!

Tuesday, February 14, 2012

Converting text to date

I have a field that stores a date as text (121205). I need to convert this field to a date, but since it is text, I cannot figure out how to do it. Any ideas? Thanks! :Dwhich database? informix? sybase? db2? access? firebird? oracle? mysql? sql server? postgresql?|||SQL Server|||Moving this thread to Microsoft SQL Server forum, but I'd use:SELECT t, Convert(DATETIME, Stuff(Stuff(t, 5, 0, '/'), 3, 0, '/'))
FROM (SELECT '121205' AS t UNION SELECT '111105' UNION SELECT '101005') AS z
-PatP|||As you can tell, Pat likes to STUFF things...

CREATE PROC mySproc99 @.x text
AS
SELECT CONVERT(datetime, CONVERT(varchar(25),@.x))
GO

EXEC mySproc99 '121205'
GO

DROP PROC mySproc99
GO

So who's to say it's not 2012?|||Brett is correct, you don't need the slashes in the US, and maybe not in the UK either... They assume a string of digits are MMDDYY. As far as I know, the slashes work in any locale.

-PatP

Converting string to int

Hi,

This probably is a basic question but I can't figure it out...

Because SQL Server's ISNUMERIC function allows some strange values to count as numeric (such as '\'), I want to create my own function that will only return an integer if the value is able to be converted (otherwise it will return 0). I have created the following function to do this:

CREATE FUNCTION [dbo].[fnConvertToInt]
(
@.str nvarchar(30)
)
RETURNS int
AS
BEGIN
DECLARE @.s int

BEGIN TRY
SET @.s = convert(int, @.str)
END TRY
BEGIN CATCH
SET @.s = 0
END CATCH
-- Return the result of the function
RETURN @.s
END

When I run this however, I get errors from having the TRY CATCH in a function:

Invalid use of side-effecting or time-dependent operator in 'BEGIN TRY' within a function.

How can I convert a string to an integer without getting an error? I am using SQL Server 2005.

Hi,

the isnumeric function is hazle, but you can implement some isreallynumeric, like aaron did this on his website:

http://www.aspfaq.com/show.asp?id=2390

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de