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
  • Set RowCount Alternatives [solved]

    database question csharp sql-server sysadmin
    5
    0 Votes
    5 Posts
    0 Views
    D
    :thumbsup: Generally it's a very good idea. But the thing is this. I have a production app(scanners and all that) and normally a interface for setting up the lines,projects... I did not allow them to delete a PN. Now they want that feature. But in order to not delete any production data I need to check if any production data exists for that PN and if not, then and only then delete all stuff related to that PN. Else refuse it. Yeah I know SQL would return an error complaining about FK and stuff but I don't want the user to see that. So first check and if not exists then delete. Else show a message to the user that production datas exists for that PN and delete has been aborted. :) All the best, Dan modified on Thursday, June 9, 2011 5:05 AM
  • 0 Votes
    3 Posts
    1 Views
    M
    Thank you. You confirmed my thoughts. We live in a Newtonian world of Einsteinian physics ruled by Frankenstein logic
  • SQL Server. Insert into table whiles querying

    database sql-server sysadmin question
    12
    0 Votes
    12 Posts
    1 Views
    S
    Eli Nurman wrote: i cannot insert new rows into that table, how is this possible to do How are you trying to update (insert) the table? By default SSIS for example trys to lock the table before doing any data changes, that behavior can be changed. Common sense is admitting there is cause and effect and that you can exert some control over what you understand.
  • SQL View returning different results

    database design question
    3
    0 Votes
    3 Posts
    0 Views
    S
    Etienne_123 wrote: some of the columns come back as NULL. However, when I SELECT TOP 1000 rows from the view, the records in these columns are returned with the correct values Sounds like a data conversion issue. Common sense is admitting there is cause and effect and that you can exert some control over what you understand.
  • SQL Server 2008

    help database sql-server sysadmin question
    8
    0 Votes
    8 Posts
    1 Views
    M
    thanks for replies
  • Remote Server(DB) conn from local DB

    database csharp sql-server sysadmin help
    2
    0 Votes
    2 Posts
    0 Views
    J
    ravi11038 wrote: I have created one Ssis pkg in my local DB You are using SSIS. ravi11038 wrote: I am connecting to the the remote server by using C# code in this Ssis pkg And SSIS is using C# code. And the C# code is handling the connection. ravi11038 wrote: But some cases(machines) it's giving error(user-component failure). So? The solution is obviously to figure out what the connection ravi11038 wrote: So i need to conn remote DB and i have to execute Stored procedure in that DB. A stored procedure on a remote machine will not fix a connection problem to the remote machine. Now perhaps you want to create a stored procedure on the local machine and it will connect to the remote machine. But that is just moving the connection problem from one place to another and is unlikely to solve the problem if you do not figure out what is actually causing the connection failure.
  • How to build this partial SUM...

    database sales tutorial question
    8
    0 Votes
    8 Posts
    0 Views
    D
    I'd prefer tinyints too, but it was our client's table. We were providing a solution to monitor, filter, and visualize the data for them.
  • sql server hangs with multi queries

    database sql-server sysadmin windows-admin help
    4
    0 Votes
    4 Posts
    0 Views
    J
    Eli Nurman wrote: So how can i solve this Use more than one connection. Eli Nurman wrote: Why are queries via SSMS not affected? Because it is using a different connection.
  • Top 1 distinct or something like that

    database question
    8
    0 Votes
    8 Posts
    0 Views
    P
    This did it thanks. apologies for the vagueness, well I knew what I meant. To hopefully clear up any questions - the table can have many thousands of rows each one holds the details of application events used for auditing purposes. There are about 40 event types that are logged (eventid) and the details column holds the data associated with a particular event e.g this one describes a simple page view. Other columns are things like hold details of user ids, timestamps etc but in this instance were not required I jut needed one example of each event type to test a reporting application. Reading that I could have been clearer in my original post. Thanks again everyone.
  • 0 Votes
    3 Posts
    2 Views
    J
    Normally the second. But, again normally, there are far better reasons for doing that than performance.
  • Distinct + Count

    question
    6
    0 Votes
    6 Posts
    0 Views
    S
    If country is null, it need not be shown. I would say select country, count(country) from countrytable where country is not null group by country
  • SQL SERVER Training Videos..

    database sql-server sysadmin
    2
    0 Votes
    2 Posts
    0 Views
    R
    You can check following resources: SQL Server 2008 Demo Videos and Webcasts[^] SQL Server 2008 Videos[^] SQL Server Training.[^] SQL Server for Developers[^] Some Channel 9 Videos[^] // ♫ 99 little bugs in the code, // 99 bugs in the code // We fix a bug, compile it again // 101 little bugs in the code ♫
  • MSSQL Backup database - without BACKUP command

    database sql-server csharp com sysadmin
    6
    0 Votes
    6 Posts
    0 Views
    S
    No problem :)
  • Select Distinct by an Image Field

    csharp question asp-net sharepoint
    8
    0 Votes
    8 Posts
    0 Views
    L
    Use the T-SQL function hashbytes like this: select hashbytes('MD5', 'your value')
  • 0 Votes
    2 Posts
    0 Views
    C
    BCP is tricky at best.
  • Stored Procedure

    database question
    3
    0 Votes
    3 Posts
    0 Views
    S
    Depends on what Database you're targetting.
  • Problem with POWER

    help database sql-server sysadmin question
    7
    0 Votes
    7 Posts
    0 Views
    T
    We live and learn and live to learn another day! Thanks again. Once I have uncrossed by eyes I will see if I can assimilate any of that and become 1 of 10^666 Neat PDF that on Wolfram. Devilishly cunning stuff!
  • Reseting memory in DB [modified]

    database help csharp c++ sharepoint
    2
    0 Votes
    2 Posts
    0 Views
    R
    My ex-colleague came across similar message. Not sure about this, but if sql server is running in mixed authentication mode and you are using sql authentication, this must have occurred. // ♫ 99 little bugs in the code, // 99 bugs in the code // We fix a bug, compile it again // 101 little bugs in the code ♫
  • Copy table 1 to table 2 for missing data only

    help
    6
    0 Votes
    6 Posts
    0 Views
    D
    SQL Server supports a rather convenient MERGE[^] command that lets you specify criteria of two records being 'identical', actions to take on finding a match, and actions to take on finding missing records. The documentation at the link supplies several large examples, so you should be able to construct your statement relatively easily.
  • Oracle invalid character

    help csharp database oracle question
    16
    0 Votes
    16 Posts
    0 Views
    J
    The second is not a statement. It is two statements. Investigate the use of Begin/End. Do it in a SQL browser/gui first before attempting to code it in C#.