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
  • 0 Votes
    9 Posts
    0 Views
    M
    GuyThiebaut wrote: the only people using SSMS should be the DBAs NNnnnnnnooooo, don't make the developers use VS for Ghus sake. We have a bunch of DBA's who are so divorced from the developers I have never even met one. They only look after production and accept scripts from us for changes. Never underestimate the power of human stupidity RAH
  • 0 Votes
    3 Posts
    0 Views
    I
    I am sorry but that was not the issue even without putting the select statement error was coming. I put that select statement in process of debugging it. Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
  • LDF file Size is so increased

    sysadmin help question
    25
    0 Votes
    25 Posts
    0 Views
    A
    Thank you so much its work for me. thank you so much for you cooperation.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • DB2 Please Help Here

    database help
    3
    0 Votes
    3 Posts
    0 Views
    CHill60C
    Hello? Is there anybody there? Which version of DB2 are you running? (It is relevent to how this could be answered)
  • Query Response Time - SQL Server Replication

    database csharp sql-server com sysadmin
    5
    0 Votes
    5 Posts
    1 Views
    J
    Thanks for all the replies, I'm gonna go back and ask some more questions!! :omg: Personal Blog: A Software Programmer Twitter: JammoD
  • 0 Votes
    3 Posts
    0 Views
    L
    CREATE TABLE Class ( Id BIGINT PRIMARY KEY ,Name VARCHAR(50) ) INSERT INTO Class (Id, Name) VALUES (1, '7th Class') INSERT INTO Class (Id, Name) VALUES (2, '8th Class') INSERT INTO Class (Id, Name) VALUES (4, '10th Class') CREATE TABLE Marks ( StudentId BIGINT, ClassId BIGINT, Marks BIGINT ) INSERT INTO Marks (StudentId, ClassId, Marks) VALUES (1, 1, 35) INSERT INTO Marks (StudentId, ClassId, Marks) VALUES (2, 1, 90) INSERT INTO Marks (StudentId, ClassId, Marks) VALUES (3, 2, 75) INSERT INTO Marks (StudentId, ClassId, Marks) VALUES (4, 2, 30) Try something like SELECT c.Name, (SELECT COUNT( * ) FROM Marks WHERE ClassId = c.Id AND Marks >= 50) AS [Passed], (SELECT COUNT( * ) FROM Marks WHERE ClassId = c.Id AND Marks < 50) AS [Failed] FROM Class c If you try the query here[^], you'll not just see the actual result, but also get timings and a nice execution plan. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
  • Compare Database Projects

    csharp database visual-studio tutorial announcement
    3
    0 Votes
    3 Posts
    0 Views
    A
    Yes Mycroft I am using SQL Server, let me try your idea. Thanks
  • 0 Votes
    5 Posts
    0 Views
    S
    If there's exactly one matching record to each other and they're in the same order you could use the ROWID to join them / to update the tables without ID with the ID from CUSTOMER_CARDDATA. If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
  • Separating names from a single column to 2 columns

    csharp design json tutorial
    4
    0 Votes
    4 Posts
    0 Views
    Kornfeld Eliyahu PeterK
    You're welcome... Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
  • 0 Votes
    4 Posts
    1 Views
    L
    Restore[^] on MSDN. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
  • Sql Server

    database sql-server sysadmin question announcement
    3
    0 Votes
    3 Posts
    0 Views
    Richard DeemingR
    How to use SQL Server in Windows 8, Windows 8.1, Windows Server 2012, and Windows Server 2012 R2[^]: SQL 2005: Not supported. SQL 2008: Needs at least SP3. SQL 2008 R2: Needs at least SP2 on Windows 8.1 / Server 2012 R2; Needs at least SP1 on Windows 8 / Server 2012; SQL 2012: Needs at least SP1 on Windows 8.1 / Server 2012 R2; No SP required for Windows 8 / Server 2012; SQL 2014: No SP required.; "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • Provide large data updates to desktop users

    announcement database help question
    4
    0 Votes
    4 Posts
    0 Views
    M
    You will get better ideas if you reply through the forum! There are others who will be able to help better than I. Kukreja Sonu wrote: Thanks Holmes. As of now we write all the changed data into an XML file at server and upload the same to a centralized location. Then client downloads the xml and executes queries one by one accordingly to update target DB. But this is a long process: 1. Populating DB at server with change only data 2. Initiate process to prepare XML based on above data. 3. Client downloads the XML and update target DB. This takes around 3-4 days for single run. So, we want to have some other process if possible to minimize the time The more I think about this the nastier it gets, are you up to changing the way you identify your change sets or do you have to stick with the current design/structure? First I would look into change the format from xml to something less verbose. XML is fine for communication as a transport medium it sucks. We use CSV. It sounds like each client has a different requirement! Never underestimate the power of human stupidity RAH
  • 0 Votes
    10 Posts
    0 Views
    Richard DeemingR
    No, what you have posted is working-but-vulnerable code which executes a query that includes the values of some C# variables in the results. At no point does the code you've posted update the value of any C# variables. Either you've forgotten to post that part of the code, or the code isn't doing what you think it's doing. "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • I'm trying to concat 2 columns into a single result

    5
    0 Votes
    5 Posts
    0 Views
    S
    You're welcome! :) If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
  • 0 Votes
    3 Posts
    0 Views
    M
    I use a view and a holiday table as I need to keep holidays for a number of countries/currencies. The view starts at the beginning of last year and goes for 10 years, arbitrarily picked by me, it has date part DayOfWeek so I can exclude weekends. It will be fairly simple to combine the two as Eddy suggested, fiddling with the filters/joins to get the last working sate. Never underestimate the power of human stupidity RAH
  • strange Sql Server error

    database learning sql-server sysadmin testing
    6
    0 Votes
    6 Posts
    0 Views
    T
    You are right my friend .... executing the query you suggested I realized I am actually using Sql Server 2008 .... and this maybe will solve some other problems I think I have ... Thank you very much
  • RDBMS

    2
    0 Votes
    2 Posts
    0 Views
    T
    Use a search engine; look for concepts. Start reading. If you have a particular question, post your code/SQL statement here and someone will probably try to help.
  • Do you use MongoDB ?

    mongodb question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Do you love to hate MongoDB?

    mongodb question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied