Showing posts with label exist. Show all posts
Showing posts with label exist. Show all posts

Wednesday, March 28, 2012

Invalid use of INSERT within a function.

Is it possible to insert into a table from a function. I have a function that searches for a unique group id, and if the group does not exist, it inserts and returns the id. I created a procedure with the same code (except for the returns) and it operated properly, so it shouldn't be a logic issue. I cannot find any resources that say inserting from within a function is disallowed. Microsoft even does it on one of their sql server 2000 examples in msdn.

Any help would be greatly appreciated.You cannot INSERT, UPDATE, or DELETE from tables in a FUNCTION. The examples you probably saw did so to locally defined variables of type TABLE.

You can return a value from a stored procedure to get the new ID. You can do this with an output parameter or with a RETURN in the stored procedure. To get the value of the RETURN, execute the stored procedure like this:

DECLARE @.ResultCode int
EXEC @.ResultCode = uspGetMyGroup

Originally posted by saderax
Is it possible to insert into a table from a function. I have a function that searches for a unique group id, and if the group does not exist, it inserts and returns the id. I created a procedure with the same code (except for the returns) and it operated properly, so it shouldn't be a logic issue. I cannot find any resources that say inserting from within a function is disallowed. Microsoft even does it on one of their sql server 2000 examples in msdn.

Any help would be greatly appreciated.

Friday, February 24, 2012

intersection of dimension?

i have a query that counts the number of stores that both exist in two dimension:

nonemptycrossjoin(descendants(dimlocation.currentmember,9,leaves),descendants(dimtargetset.currentmember,9,leaves)).count

dimlocation is a parent child dimension while dimtargetset is a star schema...

later i realized that im only counting the stores with data and excluding stores with no data in the count.. i tried crossjoin only but it doesnt return the correct count...

is there any way i could count them? im using as 2000... thanks...

any ideas?|||

See this post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2139906&SiteID=1

Best regards

- Jens

intersection of dimension?

i have a query that counts the number of stores that both exist in two dimension:

nonemptycrossjoin(descendants(dimlocation.currentmember,9,leaves),descendants(dimtargetset.currentmember,9,leaves)).count

dimlocation is a parent child dimension while dimtargetset is a star schema...

later i realized that im only counting the stores with data and excluding stores with no data in the count.. i tried crossjoin only but it doesnt return the correct count...

is there any way i could count them? im using as 2000... thanks...

any ideas?|||

See this post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2139906&SiteID=1

Best regards

- Jens

Sunday, February 19, 2012

Internet explorer script error

When trying to configure task scheduler on my mcafee virus scan i get the error notice: keyset does not exist The specific error is 0x80090016 It also says General page initialisation failed. An error has occurred attempting to retrieve task account onfo. You may continue editing task object but will be unable to change task account info. Does anyone have a solution so I can schedule automatic updates for my virus scanner?What's this got to do with Internet Explorer scripting?|||Sorry the original error was: Internet explorer script error. An error has occurred on the csript on this page. Error is: Keyset does not exist Line 719 Char7 after further attempts to schedule antivirus scans on mcafee I got the error notice I first listed in this forum|||

This is a forum for SQL Server Reporting Services, not virus scanners. I think you'll have more luck trying to post your problem at http://forums.mcafeehelp.com/.

|||

I have also begun getting this error message and I do not use McAfee, I use Norton 2006. Since I installed it I get this error ?

|||Mcafee not able to sort this problem they suggested this forum but thankyou for your suggestion|||

Try posting your issue to the ASP "Client Side Web Development" forum, which deals with "Client-side programming discussions, including CSS, DHTML, JScript/Javascript, etc".

http://forums.asp.net/130/ShowForum.aspx

They may be able to help you out. I'd try including alot more information, though:

what's the error number?|||I have the same problem with Norton and other items in task scheduler. Symantic responds that it is a Windows problem in Task Scheduler. Windows Article ID 246183 responds to this problem, but only applies to Windows 2000. It requires a change in the registry. Look at it and see if it helps.