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
  • Assist to solve this problem? [modified]

    css database help question
    15
    0 Votes
    15 Posts
    0 Views
    C
    Hi Niladri, Your answer and that of Blue_boy have really expanded my thoughts.First I am very grateful. Meanwhile, the results from the two queries are different. The problem lies in the filtering. Sincerely, I am really grateful.I will work further on your posted queries. Regards, Current
  • 0 Votes
    18 Posts
    0 Views
    S
    Fair enough. I took your original use of the term as condescending. Perhaps it wasn't meant that way, but, oh well. _____________________________ Give a man a mug, he drinks for a day. Teach a man to mug...
  • 0 Votes
    11 Posts
    0 Views
    K
    This seems to answer the question. The vendor owns the database...structure and objects. The client own's the data in the database. Clients also own the SQL Server license and contol access to databases. In most cases, whether or not they know it, clients have accepted a EULA that prohibits them from sharing software components (including databases) with third parties without written consent. I believe that a contract is a good idea to protect all three parties involved. "Go forth into the source" - Neal Morse
  • sqlpubwiz Command Line Issue.

    database tools help question sql-server
    2
    0 Votes
    2 Posts
    0 Views
    J
    I'm able to use the publishing wizard command line to script a database with foreign keys. I was getting the same error but then I found this post: http://social.msdn.microsoft.com/Forums/en/sqlexpress/thread/ecfd4379-ee88-4a60-81a4-d6cc9542b1ff[^] which said to make sure that the case of the database name has the correct case. When I fixed that the error went away.
  • 0 Votes
    7 Posts
    0 Views
    N
    use BLOB (binary large object) datatype in sql and if using .NET then send the image or video as parameter to query. try it .
  • 0 Votes
    2 Posts
    0 Views
    C
    You need to have the secondary server in "standby mode" rather than "no recovery" to access the data on the second server.
  • deploying an SSIS package to server

    sql-server sysadmin tutorial question
    4
    0 Votes
    4 Posts
    0 Views
    A
    Thank you very much for the documentation, but I had already referenced the materials at those links. My specific question was surrounding the command-line reference that I was making to my package after it had been deployed. ...at any rate, I found out what my problem was. I was attempting to reference the package with the FILE switch, but I had not deployed the package to the file system of the database server which I was attempting to reference (I had deployed it directly to the SQL Server instance) ...I still am unsure of how I would go about referencing the package from SQL Server directly, but I repeated my deployment, this time to the file system, and adjusted my reference to the location on the file system, and the package was able to be loaded at run-time. just fyi...anyone referencing a package with the "FILE" switch, make sure your package is deployed to the file system lol ...it'll save you a night's sleep. "I need build Skynet. Plz send code"
  • Deadlock problem

    database help question
    3
    0 Votes
    3 Posts
    0 Views
    M
    For deadlock detection I am using SQL Server Profiler to detect locks. Also I run a script to detect the longest query time execution and see what is actually happening in my procedure. Also check this article. I think it will be more useful than to run SQL Profiler. We live in a Newtonian world of Einsteinian physics ruled by Frankenstein logic modified on Monday, July 11, 2011 4:50 AM
  • 0 Votes
    3 Posts
    0 Views
    D
    Many thanks I understand the word "Heap" as I am a programmer - but how is it possible for SQL server to put in heap/memory RID's of all these million rows tables! dev
  • MySQL in-memory table vs. SQLite in-memory DB

    database php mysql sqlite visual-studio
    2
    0 Votes
    2 Posts
    0 Views
    L
    GregStevens wrote: Any thoughts would be very much appreciated I think you should take measurements, and note down the version of the database that you tested. GregStevens wrote: Which one of these will be faster to perform queries on? I'm hoping Sqlite, since it could be a fast implementation in native code without much overhead. GregStevens wrote: My intuition is that the second will be slower because it is a transaction on a non-local database, but I don't know this for sure. How about putting it one the same machine? You also could consider Times Ten[^] from Oracle. GregStevens wrote: When the table is in-memory, which computer's memory is it actually in? That depends on the specific implementation; most of the time it will be in memory that's managed by Windows, putting it into the virtual memory area. Others might have optimizations. GregStevens wrote: How much volume would have to be going on for a difference to actually be noticable? You can review the amount of free memory using the Task Manager; Your computers fysical memory - used memory = free memory Once the system starts to page out memory, you'll notice delays. That can range from minimal delays (say, served from the 64Mb buffer of memory in your harddisk) to large delays (Windows reshuffling a lot on disk, paging in and out other applications that are also running, your computer nearly grinding to a halt) Bastard Programmer from Hell :suss:
  • 0 Votes
    2 Posts
    0 Views
    A
    I found an answer to my question. I created a stored procedure that accepts the GUID as a parameter and within the proc, I (create, add, and kick off) a job that executes the SSIS package as its only step, passing the GUID into the command line args of the command property of sp_add_jobstep. Right now, the only thing in my way is that the server was restarted last night and the Job Agent wasn't part of the restart....so I'm waiting for server support to get back from lunch so that I can test out my implementation. If anyone has any questions about my approach, I'd be more than happy to share. "I need build Skynet. Plz send code"
  • 0 Votes
    7 Posts
    0 Views
    L
    I would create a View with a WHERE IsDeleted = false condition and use the view in my select methods. And I would also make sure that the IsDeleted column is indexed.
  • 0 Votes
    3 Posts
    0 Views
    L
    It doesn't work even if you set your database compatibility to SQL Server 2005 before taking the backup. So the only way is as suggested by scottgp.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • UnQuote a nvarchar() string and use it as a table name

    5
    0 Votes
    5 Posts
    0 Views
    R
    hi thanx to ur answer it took a time fore me to understand what just going on i will try it and answer back :) :-D ;)
  • GetDate

    question
    6
    0 Votes
    6 Posts
    0 Views
    L
    SELECT DATEADD(dd,0,DATEDIFF(dd,0,GETDATE())) does the trick.
  • i want a to get a SQL

    database com
    11
    0 Votes
    11 Posts
    0 Views
    C
    You are a grade one idiot.
  • 0 Votes
    21 Posts
    0 Views
    N
    Hello SayamiSuchi, This problem can be solved in many ways. Method 1: As has already been answered by UNCRushFan IF NOT EXISTS (SELECT DISTINCT keyname FROM <table_name>) BEGIN INSERT INTO..... END Method 2: Another traditional way [ Count(ColumnName) approach ] Declare @tblSource table([ID] int identity,[Name] varchar(20),[Key] varchar(10)) insert into @tblSource Select 'Sam', 'Sam1' Union all Select 'Joy','Joy2' --Select * from @tblSource Declare @key as varchar(10) set @key = 'Joy2' if(( Select count([KEY]) from @tblSource where [key] = @key) = 1) begin insert into @tblSource Select 'NewName', 'NewKey' end Select * from @tblSource Method 3: Merge statement of Sql Server 2008 Consider the below statement first Declare @tblSource table([ID] int identity,[Name] varchar(20),[Key] varchar(10)) insert into @tblSource Select 'Sam', 'Sam1' Union all Select 'Joy','Joy2' Declare @tblDestination table([ID] int identity,[Name] varchar(20),[Key] varchar(10)) MERGE INTO @tblDestination AS Target USING (SELECT [Name],[Key] FROM @tblSource) AS Source ON Target.[Key] = Source.[Key] WHEN NOT MATCHED BY TARGET THEN INSERT (Name, [Key]) VALUES (Source.Name, Source.[Key]); Select * from @tblDestination I have a source table and a destination table. I am inserting the record in the destination table by checking whether the Key of the source table exists in the destination or not. In this case no key will be found in the destination and hence the output will be ID Name Key 1 Sam Sam1 2 Joy Joy2 Now let us insert a record (with an already existing key) in the source table as insert into @tblSource Select 'Joy','Joy2' At this time the records in the source table will be ID Name Key 1 Sam Sam1 2 Joy Joy2 3 Joy Joy2 Now if we run the above Merge statement query MERGE INTO @tblDestination AS Target USING (SELECT [Name],[Key] FROM @tblSource) AS Source ON Target.[Key] = Source.[Key] WHEN NOT MATCHED BY TARGET THEN INSERT (Name, [Key]) VALUES (Source.Name, Source.[Key]); Select * from @tblDestination The output in the destination table will be ID Name Key 1 Sam Sam1 2 Joy Joy2 because the key is already present in the destination table and hence it has been ignored. But if we have the source table as insert into @tblSource Select 'NewName',
  • 0 Votes
    18 Posts
    0 Views
    M
    Eddy Vluggen wrote: Your users need access to an additional secret Of course not the Application has the credentials, either an encrypted string in the config file or hard coded inside the app. Users have already been authenticated when they log into the app using AD. Never underestimate the power of human stupidity RAH
  • 0 Votes
    7 Posts
    0 Views
    J
    Congratulations! :-D Jack of all trades ~ Master of none.