Anyone have a work around for using sp_executesql like in the situation below within a user defined function.
EXEC sp_executesql @rule,N'@check_rule bit OUTPUT',@check_rule OUTPUT
I have tested the function parts in query analyzer the results are what I want but when I create the function I...
Check your systems group permissions.
The latest windows patches may have changed some permissions or defaulted them for some specific groups.
And definitely test your package execution from the command line on the SQL box logged in as SQLservice. If this errors then you will get a better...
i have run into this problem with non converted 6.5 SQL databases in a 2000 environment.
Check to make sure that the database type is sql 8.0.
You can try this though:
Run your query from a known 8.0 version database (using query analyzer) and point it towards your database that your trying...
I tried the help, I have no msdn loaded and can't find my library disks.
When I do a search for Mod on microsofts msdn I cant find it.
Thanks you get a star, for fast delivery.
Bygs
You can avoid all that extra hokus - pokus.
In your original query you mentioned that you may excede 4000 char.
If you are dynamically creating your query, break it up into segments that you know will not execede any thing
For example:
set @sql_select = 'Select <field1>,<field2>,<fieldN>...
Yes, the function will be run on every record. A lot less code to manage also for that matter.
A couple of reasons not to use cursors:
(1) very resource intensive and slow.
(2) may cause some bad table locking(when multiple instances are run) which will render your Database tables useless.
(3)...
An even better solution/practice is making a stored procedure on the SQL side that does the insert for you. if you pass in variables (with single ticks) from your asp to execute your stored proc, it will be inserted with a single tick.
Then you don't have to handle the double tick later on when...
I believe the If Exist() statement will only evaluate a true or false. I dont believe it supports holding/setting scope of a variable.
Thats what makes the exists statements so efficient.
Is there any reason why you dont set the variable before then evaluate?
DECLARE @UserID int
select...
What I have posted requires no cursor....
It will run the updates as records are being pulled dynamically.....
I thought you were looking for a way to get the same thing done without cursors, which is what I recommend.
Cursors should only be used as a last resort..... Very last resort.
If...
I convert with the same yyyymmdd character format all the time.
convert(datetime,SUBSTRING(@data_string, 54, 8))
the only way this will fail is if the date was not a legitimate date.
For Example 20030832
If that doesnt work I have another method.
hope this helps..
Bygs
Like I mentioned early when you use the utility to write to a file in Query Analyzer, it uses a text stream. So it is taking everything that is literal and writing it to the .txt.
There is a way to turn off the NULLs in the query analyzer settings tab as a setting but I dont recommend it.
DTS...
I think it really depends on how big your denormalized table is. If it is huge maybe some Indexes should be made according to the criteria being generated from your dynamic query.
Is your EXEC(@strSQL) making numerous transactions. If that is the case you may want to break it up into...
user defined function executable within a stored proc should do the trick
make your addUpdateColourDescription a user defined function
CREATE PROCEDURE dbo.updateRNFdesc
@locale AS char(2),
@NRFColourCode AS varchar(50),
@NRFDescription AS varchar(255)
@descTableName AS varchar(50)
AS...
try exporting this...
select
null as temp1,
null as temp2,
isnull(null,'') as temp3,
isnull(null,'') as temp4
since its a text stream that is being written, instead of streaming a 'null' text it will be written as blank only when it is <null>
If thats not what you are looking for please let...
I dont think you need the spaces after each switch either.
dtsRun /SSERVER01444 /UMyUserName /PMyPassword /N"dts package" /Aglobalvar_name:8="globalvar value"
Make sure you have persmissions on the Box to run command lines
hope that helps
--bygs
I am aware of the DSN - Less connections not being available in MX and Im a bit dissapointed that the flexibility has been taken away.
That being the case have you ever added an OLAP Cube (MS SQL Server) to the ODBC settings.
If so can you point me in the direction of some literature or the...
You can reference your 1-12 to a made up table that has 2 fields 1 and January ect. Then re-create your dimension as a snowflake and incorporate your new table with the new field
OR
You can make a view of your existing dimension as long as its not huge and use star schema. When I say huge I...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.