Skip to content

Database

Discussions on database access, SQL, and ADO

This category can be followed from the open social web via the handle database@forum.codeproject.com

17.1k Topics 61.8k Posts
  • where are stored procedures stored.

    database mysql sql-server sysadmin tutorial
    2
    0 Votes
    2 Posts
    0 Views
    H
    khurram_shahzad wrote: Such that if i created a database then i know all my data is in this created database ..... but if i talk about creating/using stored procedures then were are they stored They are stored in hidden table of same database. You could access it using following. select * from sys.sql_modules where object_id=object_id('Name_of_your_sp') Regards, Hiren. My Recent Article: - Way to know which control have raised a postback My Recent Tip/Trick: - The ?? Operator.
  • joining two tables

    com question
    7
    0 Votes
    7 Posts
    0 Views
    E
    yeah it works with order too..thanks for your time vemedya.com
  • Recursive query "SQL Server 2000"

    database csharp tutorial sql-server sysadmin
    5
    0 Votes
    5 Posts
    0 Views
    J
    I am rather certain that your given table structure requires looping. You can use either actual loops or procs (recursive) for this but the result is the same. Doing it in the database would probably be better than C# (per your other post.) If you can modify the table then there are probably other solutions. See the following link and drill down on the sublinks on it as there are other solutions. http://www.sqlteam.com/article/more-trees-hierarchies-in-sql[^] You might also try googling with the following: sql hierarchy query -cte
  • Creating view in Access

    database algorithms tutorial question
    3
    0 Votes
    3 Posts
    0 Views
    J
    ok..Thanks for the answer! :thumbsup: "For as long as men massacre animals, they will kill each other. Indeed, he who sows the seed of murder and pain cannot reap joy and love." Pythagoras
  • 0 Votes
    5 Posts
    0 Views
    L
    With MS Access I had to use VB function which does similar thing. Anyway thanks for an idea.
  • wrapper program

    database tutorial
    4
    0 Votes
    4 Posts
    0 Views
    S
    Not sure if this is possible as I haven't tried it but what I would try would be to do a bulk insert from your sql file into a single column temporary table. Then you could select this into a temporary varchar variable. You should then be able to use the EXEC() function to run the query in the varchar variable.
  • 0 Votes
    2 Posts
    0 Views
    S
    I've had a similar problem to this before, rebuilding or reorganizing wouldn't make a difference. I ended up dropping the index and recreating it.
  • 0 Votes
    19 Posts
    0 Views
    J
    I got it to work. Followed your advise from your previous reply and after a few tries, bingo, it worked. Here's the code in case it can help others. I am leaving the print statements I used for testing. Declare @colname varchar(200), @Eid varchar(50),@message varchar(80),@command varchar(200) Declare my_cursor CURSOR For Select replace(replace(replace(SecurityRole,' ',''),'/',''),'-','') as SecRole,EmployeeID from EmergencyContact.dbo.CSEEmployeeRoles order by EmployeeID, SecRole open my_cursor fetch next from my_cursor into @colname,@Eid while @@fetch_status = 0 begin select @message = @colname+' '+@Eid --print @message select @command= 'update EmergencyContact.dbo.CSERolesRolledUp set '+@colname+' = ''Yes'' where EmployeeID = '+@Eid exec (@command) print @UpdDate --print @colname --print @command fetch next from my_cursor into @colname,@Eid --print @colname end close my_cursor deallocate my_cursor Thanx again for your help. Having never used Cursor or Dynamic SQL before, I just needed to know it can be done and I was on the right track. Happy Holidays! :-D
  • Explain Explain for me!

    database oracle visual-studio cryptography code-review
    6
    0 Votes
    6 Posts
    0 Views
    C
    I'm going to try different hints for the cursor to see what happens. Thanks. Ultimately I expect to have to re-develop this whole procedure. It was originally written for Oracle 7 and then had several changes when migrated to 8. Since then it has not been touched, but I think I'll be heavily testing over the holidays. :) Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
  • converting column values to column. [modified]

    database help
    6
    0 Votes
    6 Posts
    0 Views
    R
    This Link[^] may help you.
  • Error Can't serliase access for the transaction

    csharp oracle wcf help
    2
    0 Votes
    2 Posts
    0 Views
    J
    "The maximum value suggested for INITRANS is 100 and settings over this size rarely improve performance. Therefore a setting of INITRANS to the average number of simultaneous DML users and setting MAXTRANS to 100 will most likely result in the best utilization of resources and performance"[^]. "When did ignorance become a point of view" - Dilbert
  • 0 Votes
    9 Posts
    0 Views
    J
    An OS crash is a pretty severe problem and one which has nothing to do with your code. It just simply shouldn't be possible. Some possible avenues. 1. Try it on another machine. Perhaps you have some significant failure (like hardware) on your current box. 2. Try a different Oracle driver, if that is possible. 3. Insure the OS is up to date. Solutions: 1. Is the target run machine going to be windows 7 (or server 2008)? If not then use a different OS for development. 2. Use a proxy server. I would suggest java. That is going to require a lot of work. But your app connects to the proxy app, it does the database work, and then returns the result. The last is a rather severe solution but so is an OS crash.
  • 0 Votes
    3 Posts
    0 Views
    N
    Hi Thanks for the query, but the query gives only today's transactions. Is there any way to get old transactions? Naina Naina
  • 0 Votes
    13 Posts
    0 Views
    E
    Hi... i dont have any network problem but still i'm not able to connect to MS SQL Server which is in another system of my LAN.... Please provide me what to chect wit SQl server and Connection string... pLZZZZZZZZ.......
  • SQL Server Memmory problem

    help database csharp c++ sql-server
    2
    0 Votes
    2 Posts
    0 Views
    M
    Well you are doing something wrong, we load 1000s of table every day, peak is about 2k per hour. There is not enough info to be able to help here. How are you loading the data in, BCP, BulkCopy, 1 record at a time? Is you client having the problem or is it just relaying the error from the server. Have you checked the transaction log size of the server, the event log of the server, the database properties of the server. Never underestimate the power of human stupidity RAH
  • 0 Votes
    13 Posts
    2 Views
    J
    Ray Cassick wrote: I just never makes sense to me to store the actual images or documents in the DB itself since it really provides you nothing in the way of performance or search capabilities and I think really adds more weight to your DB than is needed. The link I posted does show a performance difference. Additionally a factor could be access control, especially when users are managed as data versus actual db users or system users.
  • run dynamic sql [mysql]

    database question mysql
    6
    0 Votes
    6 Posts
    0 Views
    J
    Hi, I tried it and it's working BUT it's just executing the first query so f i type any other quesry it will just show the first query result with no error unless i signout my application or restart it.. why is this? here is the code:
  • Adding mysql data to postgresql

    database mysql postgresql tutorial question
    3
    0 Votes
    3 Posts
    0 Views
    R
    Addy already given you a perfect Link, you can also try the given link Exporting MySQL and PostgreSQL Database Contents[^] Hope it will work for you.
  • \r\n ignored when executing queryies using ADO

    database help c++ oracle sysadmin
    5
    0 Votes
    5 Posts
    0 Views
    F
    My first thought was unix as well. The user swears that it's a windows. Is there a query I can run to figure out what is the server is running on?
  • 0 Votes
    9 Posts
    0 Views
    C
    As stated before: "I copied it out and reformatted, then decided I did not have enough time to decipher all the queries within queries." Sorry