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
  • Reading variables in Insert Query

    database question mysql help
    8
    0 Votes
    8 Posts
    0 Views
    D
    Rather than guessing this time, let me ask straight out: what library are you using for the SQL functionality? Is it mysqlclient? As far as I am aware mysqlclient has support for prepared statements, at least since version 5, I think. I don't think it supports binding parameter variables otherwise (I could be wrong, so it might be best to RTFM on that one). If you don't want to or can't use prepared statements, then the question pretty much boils down to a straightforward question about string handling in C++.
  • DB Backup Sql query

    database help sharepoint
    2
    0 Votes
    2 Posts
    0 Views
    M
    Try this link below: sql-server-restore-database-backup-using-sql-script-t-sql/[^] Thanks Md. Marufuzzaman I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
  • Restrict showdialog only to the parent window ? [modified]

    question
    3
    0 Votes
    3 Posts
    0 Views
    F
    sorry I am in the wrong message board...
  • Access 2007 calculation query

    database question
    6
    0 Votes
    6 Posts
    0 Views
    A
    The approach loyal ginger referred to would be to use something like: SELECT Price, Quantity, Price * Quantity AS Total FROM table WHERE condition This gives you a record set that has a total field, without saving one on the disk. For an entry form you would use something like David Mujica's suggestion for the UI. This does violate your stated requirement of saving the field to disk. You might want to explore getting that requirement changed. All database fanatics will tell you so. :) According to the rules of relational databases, the total field does not belong stored in the table. It would be a violation of "normal form" (3rd normal form if I am not mistaken). Practically, it adds no information not already present and is subject to the creation of data anomalies from updates. If someone else wrote a program that uses the same database and in one place changes quantity, but forgets to update total, well, you get the picture. Triggers could be a way to deal with this, but the Access (Jet) backend doesn't have them. If you use an Access front end to a different database backend, that backend might have this capability. Please do not read this signature.
  • SQl Query

    database
    10
    0 Votes
    10 Posts
    0 Views
    A
    Oh .. sry .. I think 'cursors' can only solve this ... Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)
  • Problem with query

    database help mysql question
    3
    0 Votes
    3 Posts
    0 Views
    G
    Im not sure what you mean. Could u edit my example to show me what you mean?
  • Incoporate the UDF functionality into the Sp

    csharp asp-net sharepoint com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    5 Posts
    0 Views
    U
    I looked up UDTs today, and one thing that has come up is that they aren't supported in Azure, which is somewhat part of the long term plan.
  • A newbie to MySql

    csharp c++ database mysql visual-studio
    2
    0 Votes
    2 Posts
    0 Views
    L
    Alan Kurlansky wrote: What do I need to download/install to be able to create mysql db's and to access the db's? The Community Server, and optionally a connector. You can use the Workbench to execute queries against the database, a bit similar to SQL Management Studio. I are Troll :suss:
  • Oracle View Schema

    database oracle xml question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Simple Table Design Question

    question design tutorial announcement
    5
    0 Votes
    5 Posts
    0 Views
    D
    Using separate tables also allows you to create foreign key references so that you can guarantee that the data in your tables remain consistent. For example: Tbl_Patient ID: Sex: Work_type: Blood_type: additional fields, blah, blah ... On this new table,Tbl_Patient, you would create foreign key references to tbl_sex, tbl_worktype, tbl_bloodtype, so that only valid values can be stored in those columns. Good luck on your project and keep asking questions ... it's the only way to learn. :cool:
  • Need A MSSQL Trigger

    database sql-server help question announcement
    8
    0 Votes
    8 Posts
    0 Views
    M
    Try like this: DECLARE @MyId VARCHAR(50) SET @MyId = SELECT ID FROM INSERTED UPDATE ........ WHERE ID = @MyId Thanks Md. Marufuzzaman I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
  • Query help

    database help
    4
    0 Votes
    4 Posts
    0 Views
    M
    Just one more think that i would like to add is the datatype/format of your datetime variables, you may need to convert. Thanks Md. Marufuzzaman I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
  • SQL SERVER 2008

    database tutorial sharepoint sql-server sysadmin
    3
    0 Votes
    3 Posts
    0 Views
    J
    Hi, I have a list of table that I need to make them available for auditing by using that particular procedure. I had in mind to call that procedure in a cursor which identifies the table names, builds the script for that procedure by passing the table name and the source to the procedure and executes it. This procedure will be repeated for all the tables. This will avoid hard coding the procedure for all the tables (which I have over 150). Yes yu're right they should be as listed below; DECLARE Alter_tables_cursor CURSOR FAST_FORWARD FOR select table_name from information_schema.tables where table_name<>'dtProperties' and table_type<>'VIEW' OPEN Alter_tables_cursor DECLARE @tablename sysname FETCH NEXT FROM Alter_tables_cursor INTO @tablename WHILE ( @@FETCH_STATUS = 0 ) BEGIN EXECUTE 'sys.sp\_cdc\_enable\_table @source\_schema = N''dbo'', @source\_name = N''TBL\_ACTIVITY\_ACT'', @role\_name = NULL' FETCH NEXT FROM Alter\_tables\_cursor INTO @tablename END DEALLOCATE Alter_tables_cursor Thanks for your reply.
  • 0 Votes
    2 Posts
    0 Views
    A
    tonyonlinux wrote: Then visual studios tells me that it wants to make the files local so I hit yes( should i hit no, cause i wanna use the one that is on the server not local). Anyway I hit yes. Try and edit your connection string to change the "UserInstance=True" to "UserInstance=False" and see what happens. You maybe copying the db to the output directory every time you run debug and the changes you make are not persisted in the db on the server. Just a guesss. I have been through all these issues many years ago. Just wish I had written everything down. I don't speak Idiot - please talk slowly and clearly 'This space for rent' Driven to the arms of Heineken by the wife
  • 0 Votes
    2 Posts
    0 Views
    N
    Why not look at Microsoft Sync Framework[^] I know the language. I've read a book. - _Madmatt
  • 0 Votes
    3 Posts
    0 Views
    T
    ha thanks. let me give that a go. i appreciate it!
  • SQLServer 2005 User Permission

    tools help question
    2
    0 Votes
    2 Posts
    0 Views
    M
    We have one that reads all the permissions for a database, deletes them and then restores them, used when restoring production over dev/uat databases. It would probably be another cobble but somewhere to start from (Monday at the earliest) Never underestimate the power of human stupidity RAH
  • dynamic sql search condition in store procedure

    database
    5
    0 Votes
    5 Posts
    0 Views
    M
    Eeuww - how horrible, working with your database would drive me nuts, who decided to use descriptors as column names. However your where construction is fine. I have found that you hit a limit on the number of where filters like this you can use, after about 6 or 7 performance can be affected, I have no idea why is I have only seen it a couple of times. Never underestimate the power of human stupidity RAH
  • SQL express

    database help question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied