Hot answers tagged c#
7
At our company we have that exact setup. When you create a CLR assembly a binary representation of the assembly is stored within the database that you create it in. This enables you to take it with you (and even script it out) should you move the database at any point in time.
A couple of months back our data center got flooded - filling several servers ...
6
The assembly binary is stored as a blob in the database, so it's carried wherever the database goes. CLR is only enabled on the instance -- there are no database-specific settings for that.
In any event, why are you trying to do this?
(I'm not trying to be argumentative; I just want to hear the motives involved, because perhaps the problem could be solved ...
3
@Mark is absolutely right. AND has higher precedence, so what your query is really saying is:
WHERE record_number >= 500 AND (column_a LIKE '%something%')
OR
column_c LIKE '%something else%'
OR
column_e LIKE ...
What you want it to say is:
WHERE record_number >= 500
AND
column_a LIKE '%something%' OR column_c LIKE '%something else%' OR ...
...
3
Strongly recommend you look into Table-Valued Parameters and treat your insert/update as a set (using MERGE probably) instead of calling a singleton stored procedure 25,000 times. You can skip a lot of steps here (in C# you can just stuff your 25K rows into a DataTable, for example, making it easy to pass to a stored procedure in a single call), and reduce ...
3
Your procedure is missing two OUT parameters:
PROCEDURE myprocedure (myinput IN Varchar2,
myretcursor OUT sys_refcursor,
p_count OUT NUMBER,
p_message OUT VARCHAR2) IS
BEGIN
OPEN myretcursor FOR
SELECT * FROM MYTABLE;
p_count := 123;
p_message := 'message';
...
3
If there's a where clause in the DELETE statement, then the server still needs to perform a SELECT internally to the DELETE statement in order to delete only the specified records.
You may be only issuing one DELETE statement, but that's a convenience of SQL. The Database software has to process that statement and perform the necessary logic to do the job ...
2
I would suggest that instead of deleting the rows rather create a new table which will have the data you would like to keep in the table. Create appropriate constraints and index.
Then drop the original table and then rename the new table. This would be best if you are deleting lots of data.
Deleting batches is good when you delete only very few data as ...
2
No, there's no way to do this.
Any option that did what you want would be extremely confusing because there would need to be a way to turn it off within the string literal syntax. There are other considerations (like storage size) to be aware of when choosing data types, so a setting like this could be very dangerous to put in play.
With regards to .NET ...
2
If you are using csv , you can not do this. But if you are willing to use other tools like Microsoft SQL Server Reporting Services or Crystal Reports you may do this.
SSRS Chart Example, here another one with code example.
If you can not install Reporting Services Server or do not want to, you can still use it for basic reporting purposes. Take a look at ...
2
Your OR clause is breaking your filter.
SELECT [record_number], [column_a], [column_b], [column_c], [column_d], [column_e], [column_f], [column_g], [column_h], [column_i], [column_j]
FROM [schema].[table_name]
WHERE record_number >= 500 AND
([column_a] LIKE '%' + @column_a + '%')
OR ([column_c] LIKE '%' + @column_c + '%')
OR ([column_e] LIKE '%' + ...
2
Use an OR to check if either the parameter matches the value, or both the parameter and the value are NULL, like this:
WHERE
(
[TBL_OUTBOUND_REVIEW].[ERROR_FREE] = @Status
OR
([TBL_OUTBOUND_REVIEW].[ERROR_FREE] IS NULL AND @Status IS NULL)
)
You could also use a CASE statement as your IF if you really wanted to, but I think it's easier to ...
2
If you want to clone prod. db into dev. env. regulary I would recommend you to use RMAN for whole database. Or exp/imp (expdp/impdp) for single schema.
RMAN is not easy to use for developers who have no Oracle experience, but finally you will find this approach fastest and safest.
If you're about to clone your prod db into some reporting server maybe you ...
1
It's difficult to understand your question. Do you mean that you want to copy the data in a table into new rows, but update DATE values?
For example, is the following what you're trying to do?
ORIGINAL TABLE_1:
TABLE_ID | VALUE_1 | VALUE_2 | DATEFIELD
1 | 'Somedata' | 'Someotherdata' | 2012-05-01 ...
And you want to produce:
UPDATED ...
1
There are some useful hints in this SO post.
If you are looking for alternatives to Oracle Text, have a look at this.
1
Instead of using maintenance plans, check out Ola Hallengren's free maintenance stored procedures. They're way more powerful than maintenance plans and they don't require SSMS (per your requirements) to implement. You can set them up with any T-SQL connection.
Only top voted, non community-wiki answers of a minimum length are eligible
