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
  • SQL Wildcard (%) query

    csharp database visual-studio regex
    11
    0 Votes
    11 Posts
    0 Views
    J
    Sorry about the delayed reply - christmas / new year break over here in sunny Australia! I tried all of the things above, and get identical results when using R% as I do R_. I have found that when using R%% I do get all records, but I have since discovered this is only because the maximum length of a record is 3 characters. I get the same result if I use R%%%. However, when I use the wildcard part of the query on the Locality choice, it works as I would expect it too, and returns all results that start with, say, 'Hob', if I enter Hob%. The only difference I can think of between the two is that Locality is stored as 'NVARCHAR(50)' and Land_Use_Code as 'NCHAR(5)'. I would not have thought this would cause a problem, but I may be wrong! In the mean time I will work around it and add multiple %% signs to the parameter before the query is executed. Unfortunately I have tried to get my head around writing parametrized queries from scratch, but have not been able to find a good resource that explains it along with using it to then fill a DataGridView. Thanks for all your help though guys - has been great and I feel like I have learnt a lot!
  • 0 Votes
    7 Posts
    0 Views
    J
    OK, thank you, I'll think along the lines of DELETE and INSERT. The next step is to have this work with an SqlDataSource1_Updating method with my Gridview control in C#. Thanks to all for your help.
  • 0 Votes
    8 Posts
    0 Views
    V
    I tried this. Looks like RPC needs to be enabled on the remote server? is that the only way to go about?
  • Blocking Read of some rows.

    sharepoint sysadmin help question
    4
    0 Votes
    4 Posts
    0 Views
    C
    Just another idea. Could you select the data and then delete it from the table. The data would then have to be persisted in memory or perhaps a different table. Once the process is complete and want's to make the data 'visible' again, it would then restore it to the original table. :) 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]
  • Database design

    database oracle design help question
    30
    0 Votes
    30 Posts
    0 Views
    J
    I've been thinking about this one for a while. If I understand you correctly (and it's quite possible I don't), you're getting XY coords from an external source that you load into a table, and you want them transformed into a sdo_geometry datatype which you do via a materialized view. And for some reason you can't do this at the import. One possible solution is to add a virtual column into the master gazetteer that calculates the sdo_geometry. From 11g you can index, gather statistics and partition by a virtual column, which makes them a lot faster and quite useful nowadays. There are probably other limitations that makes it impossible to drop the view, but nothing I could find on a quick google. "When did ignorance become a point of view" - Dilbert
  • error in sql

    database tools help
    3
    0 Votes
    3 Posts
    0 Views
    H
    First of all it's a Repost[^]. I think answer you've got of adding dbo.[name of table] may solve your problem. Rather then posting code in different forum Discuss with people answered you over there. Regards, Hiren. My Recent Article: - Way to know which control have raised a postback My Recent Tip/Trick: - Building Hierarchy using Recursive CTE
  • Index with two columns of table

    database question
    2
    0 Votes
    2 Posts
    0 Views
    C
    How big is your table? Yes an index on two columns do work.
  • lack of index in mysql document

    csharp html database mysql visual-studio
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Can you tell how to Sort in Oracle DB?

    database oracle tutorial question
    7
    0 Votes
    7 Posts
    0 Views
    O
    thank you
  • Query at database level

    database sysadmin question
    10
    0 Votes
    10 Posts
    0 Views
    T
    Hi, try something like this and build on a sql string, I hope this helps. DECLARE @sql VARCHAR(MAX), @db VARCHAR(255) DECLARE c CURSOR FOR SELECT [name] from master.dbo.sysdatabases OPEN c FETCH NEXT FROM c INTO @db WHILE @@FETCH_STATUS = 0 BEGIN SET @sql = 'Use ' + @db + SPACE(2) SET @sql = @sql + ' SELECT t.name As TableName, i.name As IndexName FROM sys.tables t, sys.indexes i WHERE i.object_id = t.object_id ORDER BY t.Name' FETCH NEXT FROM c INTO @db END CLOSE c DEALLOCATE c --PRINT @SQL EXEC(@sql) TJR We Came! We Saw! We Listened! We Eliminated Ambiguity and developed a system the user wanted, not what we thought they wanted. Enough Said!
  • 0 Votes
    9 Posts
    0 Views
    S
    oh that something new learnt today it also works executing it on sys.sp_databases too :-D As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
  • Best practices design

    database sql-server design sysadmin xml
    3
    0 Votes
    3 Posts
    0 Views
    J
    Normalize![^] "When did ignorance become a point of view" - Dilbert
  • backup database not working

    help question database testing beta-testing
    5
    0 Votes
    5 Posts
    0 Views
    M
    I agree with you. But in mine case, I don;t have any DB with same name. I just got a BAK file from some other server and tried to restore the same on another server. G-U-R-U
  • Tables records deleted !!!

    database help question
    6
    0 Votes
    6 Posts
    0 Views
    S
    All depends on the recovery model. if you have a "full" recovery model then use a third party product to do if for you how do i recover data from sql server s log files[^] As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
  • 0 Votes
    2 Posts
    0 Views
    S
    Have you thought of doing a maintenance plan? It will allow you to do full backups and differential backups on a given schedule Maintenance plans[^] As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
  • designing this database .... ?!

    database com design help question
    6
    0 Votes
    6 Posts
    0 Views
    C
    Well, I wouldn't tackle the problem that way at all. Assuming you are using a 'grown up' database, and you don't have millions of records under 'Electronics', then I would just have two tables. The first would hold the records of all the 'Electronics' items, with a 'Category' column containing a unique code for TV, DVD player and so on. Other than the essential columns, like Name etc, I would have Descr1, Descr2, Value1, Value2, etcetera, enough to accommodate the most complex item. Some columns would have normal names, for instance, 'Price', or 'Cost'. The second table would reference the first through the Category Code, have the same columns and column headers as the first table, but the rows would each contain descriptive values for the equivalent column headers in the first table.
  • problems

    database question java
    3
    0 Votes
    3 Posts
    0 Views
    T
    It's a java question. You should have posted in java forum. Also you should have post the code here which you have tried so that we can at least guess the thing. And then what database? Also your image link is broken(it's redirecting to this forum) but I can see the image by pasting the link text http://img80.imageshack.us/img80/2290/whylikethis.png, so here after correct that. cheers. thatraja |Chennai|India| Brainbench certifications My Dad had a Heart Attack on this day so don't...
  • about how ebay categories are designed in DB

    database tutorial question
    3
    0 Votes
    3 Posts
    0 Views
    M
    yes I have but isn't exactly what I need ! thanx
  • 0 Votes
    3 Posts
    0 Views
    D
    Often wrapping the table in brackets fixes problems with naming conflicts, especially if the name conflicts with a reserved word. Of course I have no idea if that applies in your case. CQ de W5ALT Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
  • Transpose in SQL 2k5

    database question
    6
    0 Votes
    6 Posts
    0 Views
    H
    Glad it helped you. Regards, Hiren. My Recent Article: - Way to know which control have raised a postback My Recent Tip/Trick: - The ?? Operator.