sql

Remove Change data capture manually

I'm having a serious problem with one of my production databases. The database was enabled for change data capture which was performing quite well. Last month we had a server meltdown where several disks were affected and data was lost. We then recoverd the database backups from tapes and restored them on the freshly installed database ...

ms-access: listbox is not displaying data

the row source for a listbox looks like this: SELECT users.id, users.first, users.last, chavrusas.luser_type AS user_type, chavrusas.id, users.title, users.city, users.state, users.home_phone, users.email FROM Users INNER JOIN chavrusas ON Users.id=chavrusas.luser_id WHERE ((chavrusas.ruser_id)=id_txt and chavrusas.ended=false) AND (c...

Handle precision difference in Oracle

Hello, I have a piece of my query in Oracle that generates discrete percentile: ... PERCENTILE_DISC(0.9999) WITHIN GROUP(ORDER BY DURATION_COUNT) as PERCENTILE_9999_QTY, ... The data type of PERCENTILE_9999_QTY is Number(8) it works fine except in some cases I get: ORA-01438: value larger than specified precision allowed for th...

Concerns about SQL Server 2008 Full Text Search

I have built a T-SQL query like this: DECLARE @search nvarchar(1000) = 'FORMSOF(INFLECTIONAL,hills) AND FORMSOF(INFLECTIONAL,print) AND FORMSOF(INFLECTIONAL,emergency)' SELECT * FROM Tickets WHERE ID IN ( -- unioned subqueries using CONTAINSTABLE ... ) The GUI for this search wi...

ms-access: selecting from table that doesn't exist

access is connecting to a mysql database. the rowsource of one of a listbox is: SELECT...FROM something INNER JOIN... i cannot find this 'something' anywhere. does it have to be a table? ...

SQL query: Listing product descriptions

I'm trying to list all my products' description according to a specified language, and if no translation is found for that language then the default is taken instead. Please take a look at this paste, everything is explained with the expected results: http://pastebin.com/m306e670c I've been working on this for days, so your help is...

ms-access: select from another query

i am connecting access to a mysql db. i need to put together two statements and make them into one. for example: SELECT users.id, users.first, users.last, chavrusas.luser_type AS user_type, chavrusas.id, users.title, users.city, users.state, users.home_phone, users.email FROM users INNER JOIN chavrusas ON ...

ms-access listbox weirdness (memory issue?)

i have a huge sql query that is attached to the rowsource of a listbox. the SQL statement seen here: http://stackoverflow.com/questions/1358642/ms-access-select-from-another-query actually returns the correct information if that information is under 2 records. however if it returns more than 2 records it still populates the listbox...

Is there a way to return multiple results with a subquery?

I have need to return multiple results from a subquery and have been unable to figure it out. The end result will produce the persons name across the vertical axis, various actions based on an action category across the horizontal axis. So the end result looking like: ---------- **NAME CATEGORY 1 CATEGORY 2** Smi...

Grouping by a Top N in MySQL

There are a lot of SQL Top N questions on stackoverflow but I can't seem to find one that matches the situation I'm having. I would like to perform some grouping within a top n query. My data looks like this (obviously with fake values). MY_DATE IP_ADDRESS 1/1/09 999.999.999.999 1/1/09 999.999.999.999 1/1/09 999.999.999...

VERY huge SQL Database: How should the schema look like?

I have 2 files that I'd like to import into MS SQL. The first file is 2.2 GB and the second file is 24 GB worth of data. (if you are curious: this is a poker related look up table) Importing them into MS SQL is not a problem. Thanks to SqlBulkCopy I was able to import the first file in just 10 minutes. My problem is, I don't know how th...

Looking for .NET software to abstract SQL Server's Contains Syntax

I am using SQL Server 2008 Full Text capabilities for the first time. I like the features that CONTAINS and CONTAINSTABLE offer, but I don't expect my users to learn the syntax for looking for inflections, using phrases, proximity, etc. My GUI will have a single text box to search with. Is there anything (.net DLL or c# code) out there ...

Optional Database Entities

ORIGINAL (see UPDATED QUESTION below) I am designing a new laboratory database that tests a wide variety of tests on a wide variety of sample types. The following list is my current candidate for the list of main entities to best model the laboratory work. For each entity, a 1-to-many relationship exists from that entity to the entit...

How can I use multiple Datatables on my CrystalReport?

I have a dataset that connects with three databases. How can I attach my Crystalreport viewer so all three are included? protected void Page_Load(object sender, EventArgs e) { ReportDocument X = new ReportDocument(); DataTable DTable = new DataTable(); DataSet1TableAdapters.TableAdapterMana...

How to determine if a IQueryable expression needs additional processing besides the standard LINQ to SQL translation to Transact SQL (and possible work arounds)

I’ve two issues that I was hoping for some insight on and/or some appropriate links or Google terms to use to find more information on as I’m not finding anything. It boils down to the fact that I would like to find out when/how an IQueryable expression that is going to be executed determines that some of the expression result needs to ...

How do I coordinate an SSIS data migration with updating the code's connection strings?

I am planning to migrate a large database table from our main SQL database to a separate one. Because it's a high volume/one time process, I'm going to use SSIS. Does anyone know how best to time migrating all the data and changing the code's connection string? Quick background: Our system uses a table to log every notification that i...

tsql, picking out value-pairs

I have a column that has the following data: PersonId="315618" LetterId="43" MailingGroupId="1" EntityId="551723" trackedObjectId="9538" EmailAddress="[email protected]" Is there any good, clean tsql syntax to grab the 551723 (the value associated with EntityId). The combination of Substring and Patindex I'm using seems quite unwie...

Pagination not working Subsonic

I am having trouble with the pagination. It does not work, i.e. List staffs count is always zero for the code below. If I remove the Paged method, correct results appear. How else can I solve this? I am using Subsonic 2.2. Pls help - thanks SubSonic.SqlQuery query = DB.Select().Paged(startIndex, pageSize) .Fr...

Setting query timeout on a stored procedure in SQL Server 2005

Does anyone know how to set the timeout on a stored procedure? Found some examples on the NET, e.g sp_configure 'remote Query Timeout', 5, but this did not work. Also found some commands "DBPROP_COMMANDTIMEOUT" and "DBPROP_GENERALTIMEOUT" but i don't know if they are the right ones to use and if they are, how to use them in my transact-S...

Looks simple, but I'm stumped!

This should be so simple, but I'm drawing a blank. I have two tables. Table:article_tag_pvt colum: article_id column: tag_id Table: tag column: tag_id column: name The article_tag_pvt table is a many-to-many pivot table. The problem is, I need a query which given a list of tag names, will retrieves article Ids which ONLY match tho...