Page 1 of 1

Wacky SQL Server requirement

Posted: 25 Jan 2012, 12:46
by RuadRauFlessa
Hi ppls... so I sit with this wonderful system I have to do some stuff on... but... and it is a big but... all updates to any data is only allowed o be made through their own scripting language. Now the good news is that this scripting language of theirs can take SQL queries and execute them. Now the bad news... It will only run said query if it starts with a SELECT. Some good news... it does also allow update... even more bad news... the piece of ******* checks the query and if you try to update certain relations, what they call tables, it throws you a finger.

Solution I was looking at was to create a Scalar valued function to do the work... buuuut... more bad news... You can not run any statement within a function that updates a data storage area that is not declared within the function... otherwise stated... you can only read now write. So second thought naturally goes to stored procedures... good idea as you can run all your update and/or inserts and such... but again with the bad news... I can't for the life of me find a way to call on a stored procedure from a select statement....

Oh yeah... almost forgot to mention... I already set up a linked server to the localhost and tested out the use of OPENQUERY([LINK SERVER], 'SQL COMMAND') but to no avail. The command works if I run it directly on the server but if I run it through the link it returns with what I would expect but without any of the updates to the data made.

Anyone got any ideas it would be brilliant.

Re: Wacky SQL Server requirement

Posted: 25 Jan 2012, 13:17
by hamin_aus
Can you not run SQL through management studio?
If you have sysadmin rights in SQL find out how they do this and remove those restrictions..
It's most likely some funky implementation of Policy-based management if it's SQL Server 2008.

Who decided this rubbish was a good idea to use?

Re: Wacky SQL Server requirement

Posted: 25 Jan 2012, 13:23
by RuadRauFlessa
Nothing to do with SQL Server itself. As said I can do everything I want to in SQL Server but the framework we have to work in sux.... I won't mention what.