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
  • T-SQL Developer needed for hire.

    sql-server database sysadmin career
    6
    0 Votes
    6 Posts
    0 Views
    M
    I was not denigrating the fact that you are trying, just the fact that experience is just that, experience and cannot be transferred, you can however learn from the experienced which is what you are trying to do. Your problem is finding an experienced person with the spare time to teach and transfer that knowledge. Never underestimate the power of human stupidity RAH
  • select in star schema

    database com xml question
    9
    0 Votes
    9 Posts
    0 Views
    B
    Change your place table: add the column name. And then move your data to the correct place, and get rid of the name column in those other tables.
  • select in star schema

    database com xml question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Paging in SQL

    database design help question
    3
    0 Votes
    3 Posts
    0 Views
    B
    Thank You For Your Response...AnyWay I Have FigureOut the Solution....After implementing Paging the SQL Server Query Looks Like this: I Have created a temporary table and inserted data to that table...and from there i calculated the pagenumber and size..the query will explain more..Hope this will help somebody... :) set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go -- ============================================= -- Author: -- Create date: <11/04/2012> -- Description: -- ============================================= --exec iSRPDb_Sp_Search_WO 1,0,'0','T',10,2 --select * from tblProject where ProjectID=13849 --select * from tblProject where ProjectID=22412 --select * from tblProject where ProjectCode='B20904' --select * from tblSubContractor where SubContractorID=88420 --select top 10* from tblWorkOrderHeader where ProjectID=22412 ALTER PROCEDURE [dbo].[iSRPDb_Sp_Search_WO] @pBusinessUnitID as int=0, @pProjectID as int, @pSubcontractorID as int, @pWONumber as varchar(10), @PageSize as int, @PageNumber INT AS BEGIN SET NOCOUNT ON; DECLARE @BusinessUnitFilter Varchar(255) DECLARE @NameFilter Varchar(255) DECLARE @SubConNameFilter Varchar(255) DECLARE @WONumFilter Varchar(255) DECLARE @Filter Varchar(2000) DECLARE @StatusFilter VARCHAR(255) DECLARE @RowStart int DECLARE @RowEnd int DECLARE @condition varchar(255) SET @StatusFilter='' IF @pBusinessUnitID > 0 SET @BusinessUnitFilter = 'TWO. BusinessUnitID=' + Convert(Varchar(10),@pBusinessUnitID) ELSE SET @BusinessUnitFilter = '' IF LTRIM(RTRIM(@pProjectID)) > 0 SET @NameFilter = ' AND TP.ProjectID =' + Convert(Varchar(255),@pProjectID) ELSE SET @NameFilter = '' IF LTRIM(RTRIM(@pSubcontractorID)) > 0 SET @SubConNameFilter = ' AND TS.SubcontractorID =' + Convert(Varchar(255),@pSubcontractorID) ELSE SET @SubConNameFilter = '' If ltrim(rtrim(@pWONumber))<> '' Set @WONumFilter = 'AND TWO.WONumber LIKE ''%' + @pWONumber + '%''' Else Set @WONumFilter = '' SET @FILTER =@StatusFilter + @BusinessUnitFilter + @NameFilter + @SubConNameFilter + @WONumFilter CREATE TABLE #TempTable ( RowNumber bigint , WONumber varchar(250) , Name varchar(250) , ProjectCode varchar(250) , Description varchar(250) , StartDate datetime , EndDate dat
  • Combobox in datagrid

    database csharp help
    2
    0 Votes
    2 Posts
    0 Views
    M
    So you already have the data you need to populate the combo in your code, extract a list of the tagtypes into another collection, possibly a simple string collection, and bind that to the combobox via it's data source. Never underestimate the power of human stupidity RAH
  • SQL Server script to find table dependencies

    html database sql-server com sysadmin
    14
    0 Votes
    14 Posts
    0 Views
    M
    jujiro wrote: So, unless you know the context, you can say an emphatic "wrongful approach." No no no not the approach you took with the code, I never even looked at it, the wrong way to PRESENT it here. There are always requirements for hacks and workarounds, I was not dumping on your code, just the way you presented it! Never underestimate the power of human stupidity RAH
  • 0 Votes
    4 Posts
    0 Views
    L
    Zhenjie Fu wrote: Do I have to create a lot of temp tables? Nope, only for the two tables that you're importing with the OpenRowSet-command. Zhenjie Fu wrote: Is it a bug or some mis-understand by me? It's an error in one of the imports. Hence the suggestion to select those two first into a temporary table, and then to union on those. Bastard Programmer from Hell :suss:
  • SSIS Development Workflow

    sql-server database sysadmin tools question
    4
    0 Votes
    4 Posts
    0 Views
    C
    Just wondering if your devs do have SQL installed? I can't find any thing suggesting its possible! :)
  • SQL Top n By Group

    database tutorial csharp sales question
    5
    0 Votes
    5 Posts
    0 Views
    R
    Also at work, but on my way home, will test when I get home - and yes, using 2008
  • Native paging on Sql Server

    database c++ sql-server sysadmin question
    7
    0 Votes
    7 Posts
    0 Views
    K
    Hi, Try below If you want page index 1 (between 10-9 and 10) page index 2 (between 20-9 and 20) . . page index 25 (between 250-9 and 250) SELECT * FROM ( SELECT ROW_NUMBER() OVER(ORDER BY OBJECT_ID) AS [PageIndex],* FROM sys.objects ) AS TB1 WHERE PageIndex BETWEEN 10-9 AND 10
  • 0 Votes
    5 Posts
    0 Views
    J
    So either you are getting it wrong from the spreadsheet or you are inserting it wrong.
  • Weird character conversion

    database sql-server sysadmin help question
    2
    0 Votes
    2 Posts
    0 Views
    F
    Hi Again, It took a while but I figured out what is the cause and the solution (google helped a lot). Cause: each night the procedure is recompiled using 'OSQL' (to keep a development server up to date after copying the real server's data bases just before that). That command line utility uses OEM code page 437 and when reading the usual ANSI format SQL files it converts various things which causes the character to change. Solution: when reading UNICODE format files OSQL makes no conversions and everything works. Both the Query analyzer and OSQL produce the same result. Once you know its a piece of cake and very logical but it definitely does not show up in any manuals, at least none that I have seen. Bye for now, Filip
  • connection to database

    database help question
    2
    0 Votes
    2 Posts
    0 Views
    L
    You can start here[^]. Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
  • Append data within XML file using form

    html database xml help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    M
    gdmoland wrote: I have seen some scripts and code that got close, but I did not understand how to modify to my needs. That is called a learning process and for that you need a book and possibly a teacher. This is a support forum where we help developers solve problems not teach how to develop applications. Your lack of understanding cannot be solved by a forum post! Never underestimate the power of human stupidity RAH
  • Database

    database question
    5
    0 Votes
    5 Posts
    0 Views
    L
    Ngobi Arthur wrote: How can i connect SQL database with Vb6.0 application? :-D By writing code. VB6 is antique, there should be some manuals in the library. If there aren't, there's always the online tutorials[^]. If you are looking for a language to learn, then go for VB.NET. Bastard Programmer from Hell :suss:
  • SQL Query enhancement

    database question
    8
    0 Votes
    8 Posts
    0 Views
    L
    Hi, It's clear that you have met some trouble in this problem, why not try esProc to solve it? esProc is a tool for mass data computation, especially fit for the complex data computation like yours. Check below for more details: A Query Language Over-perform SQL[^]
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • How do you lock records in Access 2007

    question csharp
    15
    0 Votes
    15 Posts
    5 Views
    J
    I haven't done any tests on record locking, so I may not be the best person to ask. but as I understand it, there are two type of locking (optimistic and pessimistic). Pessimistic only allows one user to use it at a time and will hold the lock. Optimistic, however, only locks the record at the moment it is updating then releases it. I am not sure what type of locking is implemented by the command line instruction above, but if it is optimistic it may not be possible to test it reliably. Sorry I can't be more helpful on that. Jack of all trades ~ Master of none.
  • Get a datarow with a query OLEDB - VB.net

    database csharp
    5
    0 Votes
    5 Posts
    0 Views
    L
    Richard.Berry100 wrote: but I was wondering if there was a way to eliminate declaring a DataTable, and then equating the DataRow to the first row from the DataTable? Why? You can simply load the reader in your datatable and return the first row from a method. That way the table is out of scope and discarded. If you really think that's consuming too much memory, then you should not use a DataRow, but an array of values[^]. Take a look at the section[^] that says "Working with DataReaders". Bastard Programmer from Hell :suss:
  • sql server

    database sql-server sysadmin tutorial
    3
    0 Votes
    3 Posts
    0 Views
    P
    Get some data 1) Look for commonalities amongst the data 2) Draw diagrams of the data and the relationships therein 3) Create tables that reflect the relationships in the diagrams 4) Done