|
mrfafa wrote: the C# side of my software con not connect to the oracle database side You didn't share any error details. Always include that in your question.
Where did you store the connectionstring? in web.config file? Then make sure you're using the right host. Check these
Remote ORACLE server connection string[^]
Oracle connection strings[^]
thatrajaNobody remains a virgin, Life screws everyone
|
|
|
|
|
I have a sql select statement that returns a list of codes and I need to edit the results to reflect the description of the codes.
For example:
Code = Description
1 = Happy
2 = Sad
3 = Mad
etc...
So how do I translate my code values to the description values in SQL? The description values are not in a table and would need to be hard-coded in the sql statement.
Hopefully this questions makes sense. I tried google before posting with limited results because I'm not sure if what I am asking can be done.
I'd appreciate any assistance!
Thanks!
|
|
|
|
|
mrfalk wrote: The description values are not in a table
That is where your error is, the description should be another column in the table, that why you will not find a sensible answer to your searches it just is not correct to put the description anywhere but the table.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
This is a one-time extract for a third party vendor who requires us to translate our code to their description. I'd rather not create a table in my production environment for one-time use.
|
|
|
|
|
I believe that one more table will not hurt (and no such thing that one time)...
But,
you can write also CASE like this:
CASE CODE
WHEN 1 THEN 'HAPPY'
WHEN 2 THEN 'SAD'
WHEN 3 THEN 'MAD'
END
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
mrfalk wrote: This is a one-time extract
There is no such thing, whichever method you use (mood table, case query) make sure you retain the script, you WILL need it again!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Quote: The description values are not in a table
SQL is designed to handle table data - so if you have a list of codes with descriptions, then put them into a table and join it to get the description.
For instance:
PERSON table
id name status
1 Peter 2
2 mrfalk 1
3 Larry 3
MOOD table
code description
1 Happy
2 Sad
3 Mad
SELECT ID, NAME, DESCRIPTION
FROM PERSON
LEFT JOIN MOOD ON CODE = STATUS
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
|
codestar007 wrote: Need suggestion from you guys.. My first suggestion would be to not crosspost. It feels as if you're simply not satisfied with the answers already given there.
The person owning the database-server will be the owner of the database and hence, of the data. It's not "your" database. Password-policies aren't going to help; the local admin is in charge. You could encrypt your TSQL procedures, just for fun.
If you're afraid someone steals your design then don't give away the database. Host it yourself on a server and provide some webservices to it. Call it a cloud if you want.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
We have two different production environments, in literally two different locations physically, with the same table layouts. For purposes of data warehouse, the two environments.
I want to copy over data from server 1 to server 2. The table has only 4000 rows. The date format of this data is of the form
2013-10-01 10:28:35.560 . so, i worry if I try to export this data into excel from server 1 and try to import this data back into server 2's table if I would lose any of the information.
What would be the best way to copy over the table?
Thanks so much!
|
|
|
|
|
Is this a one time or daily.
If daily think about replication.
Can the two systems talk to each other? If you must export to a table one option would be .CSV which would not loose the data like Excel will.
|
|
|
|
|
it is a one time deal only.
And the two systems don't talk to each other.
Thanks!!
|
|
|
|
|
|
The environments don't talk to each other - the servers are physically located in different states.
And if i export to excel, I am worried about losing some of the data, as I have specified above.
Thanks.
|
|
|
|
|
vkEmerson wrote: The environments don't talk to each other - the servers are physically located in different states. Which is why I suggested the Export/Import Wizard.
vkEmerson wrote: And if i export to excel, I am worried about losing some of the data, as I have specified above. Why do you want to use Excel? And if you are storing dates and times in your database as strings you are heasding for trouble.
Veni, vidi, abiit domum
|
|
|
|
|
vkEmerson wrote: What would be the best way to copy over the table? Create a backup of the database on server A.
Restore the backup on server B under a new name. Do a "SELECT INTO" from the new database into the target-table.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
You will be surprised at to how many restrictions smaller size companies have
The database size is huge, and no FTP services set up. Not allowed. If I try to copy the file from production server, with a simple copy and paste onto my server, it takes for ever and sometimes just disconnects. And to top this, we cannot do many things on the production server, since they don't want to slow down the website it feeds to
|
|
|
|
|
How about reversing the process first? On the source server, create a new empty database and use SELECT INTO to copy just the table(s) you want. Back up the (much smaller) database, copy the backup to the destination server, restore, and SELECT INTO the destination table.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
vkEmerson wrote: You will be surprised at to how many restrictions smaller size companies have If the restriction makes the request technically impossible, it's usually the restriction that's changed - not the request.
vkEmerson wrote: If I try to copy the file from production server, with a simple copy and paste onto my server How about writing your own BITS client[^]?
vkEmerson wrote: they don't want to slow down the website it feeds to Then why are they allowing copy/paste? One will "have to" write files on the server if the server is to be updated
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Save the .mdf and .ldf from the origin, and then ATTACH them to the target. No connections. No interface required. Other than the ATTACH script. See BOL for ATTACH details. While there, see other methods.
|
|
|
|
|
you can directly use DTS package. I Ensures you not to lose data.
Mani Prabhakar
|
|
|
|
|
you can Save the .mdf and .ldf from the origin, and then ATTACH them to the target
|
|
|
|
|
i have two tables a and b.a has 7 different columns and b has 20 different columns. i want to insert rows from a to b.how to insert.
so plz provide solution
|
|
|
|