Instead of: CASE "OtherAsset"."otherdescription"
WHEN ISNULL THEN "OtherAsset"."othertype"
ELSE "OtherAsset"."otherdescription"
END
Why not use:
ISNULL("OtherAsset"."otherdescription", "OtherAsset"."othertype")
sp_server_info reads information out of the spt_server_info table in the master database. This table should be updated when installing a service pack, etc. Apparantly this is not correctly done.
@@version calls an extended stored procedure master.dbo.xp_msver. This checks the version of files...
Hi,
I have orders with unique numbers. These orders have orderlines. How can I do an update query to update all order lines in a table to autonumber all lines from 1 to n?
Background info: I have orderlines. Some have to be summed and combined to one order line. I get these plus others in a...
Ok, this is how I do it now. I just want to get rid of the whole "Let's create a nice query in a string and execute this in a procedure as if we can not do this in .Net code"
I want a nice stored procedure that is easy to maitain, debug, etc. Not building a sql string.
That's what I want a...
Why is this not normal? Ok, I can put these in a seperate table, but that's not the problem here.
For the article different prices are used in different situations. That's why it's possible to have 5 different prices. The reason why this table is this way does not matter in this case, since the...
Hi,
I have a parameter called @Type. This parameter can have different values, like 'STOP', 'START', etc.
Based on this value I have to built different where clauses
LIKE when 'STOP' I have to set: "WHERE STATUS = 0", while when it's 'START' I have to set: "WHERE CHECKED_OUT = 0"
What is the...
Hi,
I have the following question: My SP has a paramter @GROUP_MODEL, and based on this value, a different query will be built, for example:
IF @GROUP_MODEL = '1'
begin
set @sql = 'SELECT MO.MODEL_TYPE AS SORTGROUP_3, ' +
'Max(M.SORTGROUP_2) SORTGROUP_2, '
/*'''0'' AS...
Hi,
I have a parameter called @version which can be 1, 2, 3, 4, 5
I have 5 columns in my table, price_1, price_2, etc.
I have a stored procedure to get a price which has a parameter called @version
So depending on the value, I have to get price_1, _2, etc.
Right now I build an SQL string and...
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.