Showing posts with label trouble. Show all posts
Showing posts with label trouble. Show all posts

Wednesday, March 28, 2012

Need Help - UDF SQL 00 to Scalar SQL 05

I'm having trouble with the UDF's I had in SQL 2000 that were migrated to SQL 2005 under the SCALAR FUNCTION item. Before in 2000 you just created the UDF, named it and saved. IN SQL 2005 you create/modify and then have to save it as a .SQL file to a folder. First of all, what folder should it go to so that all can use and secondly, when I do this and run the functions it doesn't work... I need to modify the scalar function and
save it with out saving to a .SQL file. How do I do this or is this the new way to create/modify functions. Any help is much appreciated
thanksHuh? I don't know what you are talking about. I've created functions in 2005 using the same code as in 2000.

Here is an example of a scalar function I created in 2005:create function [dbo].[CleanText](@.TextString varchar(max))
returns varchar(max)
as
begin
return replace(@.TextString, char(14), '')
end|||Understood. But how do you save them, does it ask you to save them to a .SQL file? Can you tell me the steps to modifying an existing scalar and saving...
thx|||The code I gave you creates a UDF in the database. As with any code you edit in Management Studio (or the old Query Analyzer), when you exit the program it prompts you whether you want to save your code to a file. Whether you want a copy of the script on your hard drive is up to you, and has nothing to do with the operation of the database.
To edit a function, right click on the function in Management Studio and select Modify. When you are through editing the code, run the script to execute it.|||Here is what I'm doing.

Go to Management Studio
Select Database Engine
Select DB working with
Select Programmability
Select Functions/Scalar
Right pane select function
Modify function
Tab pops up in right pane named ...SQLquery4.SQL
Right click it asks to save I say Yes, goes to dialog asks for name
I then close. When I open the function again, change wasn't made.
What am I doing wrong.
thx|||Thank You Execute Is The Key|||...or just hit F5.

Friday, March 23, 2012

Need dtsrun help

I am trying to run two dts jobs using a batch file obviously using dtsrun but im having trouble. I've never attempted this before and it looked easy but not as easy as I thought.

I have two dts jobs, call them package1 and package2. I also saved these as .dts files. I made a .bat file and put it in the same location as the .dts files.

My batch file looks like this:

dtsrun /F package1
dtsrun /F package2
pause

This does not work and I get the following:

C:\WINDOWS>dtsrun /F package1
DTSRun: Loading...

Error: -2147287038 (80030002); Provider Error: 0 (0)
Error string: The system cannot find the file specified.

Error source: Microsoft Data Transformation Services (DTS) Package
Help file: sqldts80.hlp
Help context: 704

Can anyone help and tell me what I am doing wrong?

Thanks

Neil.What happens when you fully path out the package files?|||check this link ,it may help u.
http://www.sqlteam.com/item.asp?ItemID=16512|||By fully path I guess you mean C:\folder\xyz etc...?

If so then I just tried that and still the same error.|||Oh dear, I'm definately having a slow day today...

I had a thought about where I was running the batch file from. I was running it from my PC even though it is located on the server. I then remote connected to the server and ran it there, IT WORKS!

Sorry for trouble but thanks for the link

NeilAsql