Skip to content
Code Project
CODE PROJECT For Those Who Code

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
  • Stored procedure not returning all the rows expected

    database question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • many fields linked to one

    question database learning
    2
    0 Votes
    2 Posts
    0 Views
    M
    You need to make 3 joins to the user table, one for each of your user fields in lab_inestigations, something like SELECT * FROM lab_inestigations I INNER JOIN sysem_users S1 ON SI.UserID = I.CreatedBy INNER JOIN sysem_users S2 ON S2.UserID = I.ProcessedBy INNER JOIN sysem_users S3 ON S3.UserID = I.ClosedBy Never underestimate the power of human stupidity RAH
  • Failed to connect to server

    database help csharp sql-server
    3
    0 Votes
    3 Posts
    5 Views
    D
    Without changing your connection string, you should be able execute this SQL statement: SELECT name FROM master..sysdatabases You could then determine whether or not your database is installed on that server. This of course will only work if the user you are connecting with has the proper permissions to access the master tables. Give it a shot. :thumbsup:
  • Derived Columns in where clause

    database question
    14
    0 Votes
    14 Posts
    0 Views
    L
    The WHERE clause isn't used to specify which columns you want to retrieve, but to limit the amount of records returned. It's a filter :) What you want to do can only be done using dynamic SQL. You'll have to know what columns you want to retrieve, or use a wildcard (*) to retrieve them all. I are Troll :suss:
  • Decimals in integer operations

    database question sql-server sysadmin
    12
    0 Votes
    12 Posts
    2 Views
    D
    One word of warning with this technique, the following give different results: 859 / 5 * 1.0 1.0 * 859 / 5 If you go down this route, you will need to understand how SQL Server applies its rules for implicit datatype conversion.
  • MSAccess 2003 flexGrid Error loading ActiveX

    help css com windows-admin question
    4
    0 Votes
    4 Posts
    0 Views
    S
    I found the issue - the FlexGrid version on my PC(s) was incorrect. I installed VB6 and patched to SP6 then downloaded the Microsoft Visual Basic 6.0 Service Pack 6 Cumulative Update (see http://support.microsoft.com/kb/957924[^]) Only then did I get the latest version (from March 2009) of FlexGrid.
  • Select * from @TableName

    database sql-server sysadmin help question
    11
    0 Votes
    11 Posts
    0 Views
    D
    You will have to use dynamic queries or a series of if/else blocks to do this. Dynamic queries are not a good way to do things. If/else, will look ugly if you have even 10 of them. So, either live with dynamic queries or redesign things.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Self Referential table

    help question
    5
    0 Votes
    5 Posts
    0 Views
    L
    Learn something new every day. :doh: Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
  • Table with Multiple Foreign Keys

    help database oracle tools json
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    2 Posts
    0 Views
    Y
    How to manually remove a replication in SQL Server 2000 or in SQL Server 2005[^] Yusuf May I help you?
  • Retrieve table structure with OPENXML

    sharepoint xml help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • SQL INSERT ISSUE

    help sharepoint database sales
    8
    0 Votes
    8 Posts
    0 Views
    L
    from the forum guidelines: 6. Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you. 8. Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job. :| Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
  • Get Previous number

    database sql-server sysadmin question
    2
    0 Votes
    2 Posts
    0 Views
    M
    DECLARE @ID INT SET @ID = 4 SELECT TOP 1 ID FROM tablename WHERE ID < @ID ORDER BY ID DESC Test the result for null and replace with 0 OR Put the results into a variable in the procedure and test the variable and return the results. Never underestimate the power of human stupidity RAH
  • Get list of OleDb providers with C#

    csharp database sql-server winforms sysadmin
    2
    0 Votes
    2 Posts
    0 Views
    M
    Hi I`m searching for the same thing. The only thing i have found is using SQL function EXEC master..xp_enum_oledb_providers
  • 0 Votes
    3 Posts
    1 Views
    L
    X| Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
  • another query

    database tutorial question
    3
    0 Votes
    3 Posts
    0 Views
    R
    thanks it does work fine!
  • sql problem

    database help sharepoint sales question
    4
    0 Votes
    4 Posts
    0 Views
    G
    Not this way. First Execute Comm = New SqlClient.SqlCommand("InsertNewPlot", LetsGo.AndGetConnection) Comm.CommandType = CommandType.StoredProcedure Comm.Parameters.Add("@Village", SqlDbType.NVarChar).Value = ComboBox1.SelectedItem.ToString Comm.Parameters.Add("@District", SqlDbType.NVarChar).Value = ComboBox2.SelectedItem.ToString to Insert Plot where InsertNewPlot is the first SP to insert plot then something like this Dim iPlotID as integer For I As Integer = 0 To AddName.Count Comm = New SqlClient.SqlCommand("InsertNewCustomerDetails", LetsGo.AndGetConnection) Comm.CommandType = CommandType.StoredProcedure Comm.Parameters.Add("@FirstName", SqlDbType.NVarChar).Value = AddName(I) Comm.Parameters.Add("@PlotId", SqlDbType.NVarChar).Value = iPlotID Dim da As SqlDataAdapter = New SqlDataAdapter(Comm) da.Fill(ds) iPlotID = ds.Tables(0).Rows(0)("PLOTID") Next
  • 0 Votes
    1 Posts
    0 Views
    No one has replied