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
    1 Posts
    0 Views
    No one has replied
  • SEO Services Provider Company in Delhi

    css com workspace
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • 0 Votes
    2 Posts
    4 Views
    P
    You could try string xml = System.Text.UnicodeEncoding.GetString(theByteArray); If this does not produce proper result, you could also try one of other encodings provided by the framework: Encoding Class (System.Text) | Microsoft Docs[^]. "Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."
  • 0 Votes
    24 Posts
    75 Views
    A
    I found a really great tool where I can browse for an .mdf-file and select it and then see the tables with all the data. It's called "SysInfoTools SQL File Viewer v18.0" and it's only a few megabytes large. After I have installed it, I can see a file called "Script Instruction.txt" in the installation folder with the following contents: "********************************************************************** Information about script ********************************************************************** Mainsqlscript.bat is our main script File, which contains path information of all the tables, views, stored procedure, triggers, functions,etc. Script file with database name “Databasename”.sql File contains script for creation of Database. Tables Folder Contain Script of all the tables. StoreProcedure Folder Contain script file for every Procedure. Triggers Folder Contain script file for every Trigger. Views Folder Contain script file for every view. Functions Folder Contain script file for every function. altertablecommandPrimarykeys contain script file for every primarykey. Altertablecommandforeignkeys contain script file for every foreign key. ********************************************************************** How to run Script ********************************************************************** 1. Open Command prompt. Cmd.exe with run as Administrator. 2. Move to Batch file path using command cd "Path of batch file" 3. Type Command mainsqlscript.bat NOTE: If the given Database name already exist in sql server instance then old database will be deleted and new database with the given name is created. Server Name and Database Name are compulsary parameters for running script." Does anybody understand what they mean by the above, does it mean that I can run it from a standard .bat-file (the ones that were invented by Microsoft in the 80's) and not have to see the GUI show up?
  • INSERT QUERY NOT WORKING

    help database
    18
    0 Votes
    18 Posts
    28 Views
    M
    Maybe because of semicolon you have missed. For your info : Oracle TO_DATE
  • 0 Votes
    13 Posts
    22 Views
    Richard DeemingR
    Parameters don't "sanitize" or "escape" special characters. They pass parameters across completely separately from the command text, so that there is no way for the database engine to get confused and treat part of the parameter as part of the command. Everything you wanted to know about SQL injection (but were afraid to ask) | Troy Hunt[^] How can I explain SQL injection without technical jargon? | Information Security Stack Exchange[^] "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • complicated SQL Join request from two server

    database sysadmin xml tutorial question
    6
    0 Votes
    6 Posts
    9 Views
    J
    Hi, You can try to add a linked server for the secondary server to the primary server. After that your query might work. You could also try the OPENROWSET function. Regards, Johan My advice is free, and you may get what you paid for.
  • 0 Votes
    7 Posts
    23 Views
    L
    Whatever you think you entered perhaps did not happen. Or your query is somehow incorrect. You can easily get all the information from SQLite database files using the sqlite3 command line interface.
  • Need help/advice to newbie... Really tired

    question com help
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • SQL Login Failed Message

    database csharp help linq com
    4
    0 Votes
    4 Posts
    6 Views
    K
    Well, I just noticed that my database was in Singlr User Mode. I set it back to Multi User and the problem no longer seems to appear. If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
  • Splitting large amounts of data in a table

    question database sql-server sysadmin
    4
    0 Votes
    4 Posts
    15 Views
    V
    Why not implement it in a procedure?
  • Trigger keeps inserting duplicates

    database tools announcement
    6
    0 Votes
    6 Posts
    8 Views
    M
    IMHO you are creating a nightmare for your successor by implementing business rules in a trigger. He/she is going to ask where the hell are all these emails coming from? And will spend the next #n hours/days searching for the code that generates the emails. When he/she does eventually think to look into triggers they will heap curses on your name. Triggers should only be used for audit purposes not business rules. Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP
  • Question Regarding SQL Parameter Query

    database help csharp question
    4
    0 Votes
    4 Posts
    8 Views
    Richard DeemingR
    Once you've declared the @Quarter variable or parameter, you'll run into another error: Invalid column name 'Quarter'. You can't reference an alias introduced in the SELECT clause within the WHERE clause of the same statement. You either have to use a sub-query, a common table expression, or duplicate the logic of the alias in the WHERE clause. SELECT Quarter FROM ( SELECT CASE WHEN InvoiceMonth IN (1,2,3) THEN 1 WHEN InvoiceMonth IN (4,5,6) THEN 2 WHEN InvoiceMonth IN (7,8,9) THEN 3 WHEN InvoiceMonth IN (10,11,12) THEN 4 END As Quarter FROM viewSalesTracker_Model1 ) WHERE Quarter = @Quarter; Or: WITH cteQuarters As ( SELECT CASE WHEN InvoiceMonth IN (1,2,3) THEN 1 WHEN InvoiceMonth IN (4,5,6) THEN 2 WHEN InvoiceMonth IN (7,8,9) THEN 3 WHEN InvoiceMonth IN (10,11,12) THEN 4 END As Quarter FROM viewSalesTracker_Model1 ) SELECT Quarter FROM cteQuarters WHERE Quarter = @Quarter; Or: SELECT CASE WHEN InvoiceMonth IN (1,2,3) THEN 1 WHEN InvoiceMonth IN (4,5,6) THEN 2 WHEN InvoiceMonth IN (7,8,9) THEN 3 WHEN InvoiceMonth IN (10,11,12) THEN 4 END As Quarter FROM viewSalesTracker_Model1 WHERE CASE WHEN InvoiceMonth IN (1,2,3) THEN 1 WHEN InvoiceMonth IN (4,5,6) THEN 2 WHEN InvoiceMonth IN (7,8,9) THEN 3 WHEN InvoiceMonth IN (10,11,12) THEN 4 END = @Quarter; "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • 0 Votes
    4 Posts
    13 Views
    M
    You have just identified the groupings for your query. a) select the fields, group by date, appID, deviceID and do a count. b) identify the facebook appid, repeat A with a where clause filtering the appid. Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP
  • Keep updated

    com adobe question discussion
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Create a new Primary Key on survey table

    database question
    5
    0 Votes
    5 Posts
    9 Views
    L
    Thanks David. I was able to figure out.
  • 0 Votes
    1 Posts
    1 Views
    No one has replied
  • Indexing question

    database question csharp sql-server com
    6
    0 Votes
    6 Posts
    14 Views
    L
    Super Lloyd wrote: Mm.. you seem to recommend Index2 so I am confused by your "Index3" on the first line... Same as Index2, but with another order of the fields. Super Lloyd wrote: basically this is a table that aggregate a summary from multiple data sources. id0 and id1 identify the datasource and are small number (between 1 to 9 each) and id2 is the original record id in the foreign datasource. That makes those three fields a compound primary key. Super Lloyd wrote: Thanks for your feedback and MSDN quotes though! :) My pleasure, and seems they know most about Sql Server :thumbsup: Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
  • 0 Votes
    3 Posts
    7 Views
    L
    Easiest way to copy the structure is to do a backup, initiated from the sproc. You can restore that on whatever server you want. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
  • transaction recovery

    database performance question
    2
    0 Votes
    2 Posts
    6 Views
    L
    In theory, yes. I would expect modern databases to wait for verification of the write before returning from the commit, which implies reading to verify after the data has been written. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.