sql

How do you find a missing number in a table field starting from a parameter and incrementing sequentially?

Let's say I have an sql server table: NumberTaken CompanyName 2                      Fred 3                      Fred 4                      Fred 6                      Fred 7                      Fred 8                      Fred 11                    Fred I need an efficient way to pass in a parameter [StartingNumber] an...

could some plz tel me tip's to understand sphinx from scratch

I need to understand sphinx from scratch. m new to using sphinx and I work on asp.net. If any of u have any document's or ebook's about sphinx plz mail me at ...

Dynamic tables from a stored procedure using Linq to Entities

Hi, I have a question about Entity Framework and Linq to Entities. My .NET version is 4.0. I'm refactoring the database access layer of an existing application, and I plan to use Linq to Entities (instead of today's DataReaders and SQL strings). The structure of the database cannot be altered. My problem comes from a stored procedure, ...

SQL & Excel 2010

Good morning, Does anyone know if there is an easy way I can use a SQL query in Excel to select specific data from an Excel spreadsheet without having to use VBA, Access, an SQL database or complicated Excel formula? Thank you very much. ...

Database design question

I have a table DEFINITIONS where I store my xml definitions form my components (form,layout,grid...) Then I have detail table PROFILES (1:M relationship) where I store my user profiles if there are any. This user profiles are only allowed if a component is of type grid. So far I've created just table DEFINITIONS and a table PROFILES in...

How to retrieve a set of table data in SQL?

Hi, everyone, I want to ask a question about the SQL. I have the following table. Name Phone a 1 b 2 c 3 d 4 e 5 I have an ArrayList(java) which contains the [a,b,c,d,e]. Is it possible to put the ArrayList into the mySQL statement to retrieve the all the phone numbers? Thank you. ...

Natural Lang to SQL

Is there any JAVA tool that allows Natural Lang to SQL. I know about SQL Server's ability, and it's no good. Right now, I've seen EasyAsk and SQ-HALm ...

DISTINCTCOUNT with FILTERing -1 IDs

Hi, Please bear with me as I am newbie in SSAS/MDX. I want DISTINCTCOUNT measure on ID column of my fact table but after filtering -1 i.e. unknown IDs. I like to slice/dice on it as well. Here are my tables DimStudent ---------------------------- ID Name -1 Unknown 1 Joe 2 Tim 3 P...

Creating a general SQL Query builder

what would be the best way to create a Query builder in delphi? I have devexpress quantum grid, so I can display data easily. ...

update tab1 set col1=col2,col2=col1

How this query swap data of col1 and col2 of tab1 ? Basically for swapping we need temporary variable but here we are not. so how sql server does this ? ...

Mysql function to generate millisecond precision timestamp as a BIGINT(13)

I am aware that mysql does not support storing timestamp columns with millisecond precision. My question: is there a mysql function I could write that will output the current time as a BIGINT(13) to millisecond precision. For example, as now() outputs a timestamp: mysql> select now(); +---------------------+ | now() | +-...

unique column constraint in Apache ddlutils

Is there any possibility to create unique column constraint using DDLUtils ? I have not found it in API. Is there other solution then altering table (add unique) just a second after its creation on my own ? ...

Select All Right Hand Rows for Each Left Hand Row SQL.. HELP!

Hello, I am currently looking for a Select statement which will do this.. |------Apples------| |--id--| - 1 - 16 - 23 - 42 |------Oranges------| |--id--| - a - b - c *SELECT STATEMENT* |------Fruit Cocktail------| |--AppleID--|--OrangeID--| 1 a 1 b 1 c 16 ...

Like query on Date Time

Hi friends,is this possible to fire like query on DateTime in SQL Server 2005. select cur.EvrIdent, cur.VrdTarih, cur.VrdModTim, cur.VrdNo, (select PmpKod from Bnz_Pompalar where PmpIdent=(select GunPmpId from Bnz_Tabancalar where GunIdent=TbdGunId)) as [Pump No], (select GunKod from Bnz_Tabancalar where GunIdent=TbdGunId) as [Nozzle No...

Ordering MySQL Query By Random and a Field?

I am trying to find a way to pull 10 random records and then order those 10 records by a field. I have tried the following: SELECT name FROM users ORDER BY RAND(), name LIMIT 10 but it does not order by name with 10 rows returned, just return 10 random record in any order. Is there a way to order by rand() and a field within a query ...

how use replace in exec statement in sql server 2008

Hi, I have a stored proc, say, "call_Me" with few parameters: Declare @Greet varchar(100) = 'Hi ||User||' Exec Call_Me 1,'something', @Greet --parameters: bit, string, string during the call, I want to be able to replace the ||User|| bit with something else. normally, in a select statement, I would do this: select 1, 'somethin...

SQL Query for pairing terms from one table.

Hi, given the first table ,i need to join this table with the same table and get the output table.Here we need to pair terms based on same seqid and the terms should be paired only from first table to second table. Example:S1 T1 T2 S1 T1 T3 S1 T2 T3 this is the correct form of output but we should not get S1 T2 T...

How can I pass a list of object in a SQL Procedure with SQL Server 2008 ?

How can I pass a list of object in a SQL Procedure with SQL Server 2008 ? I want to avoid this : foreach (var item in itemList) { myContext.ExecuteStoreCommand("EXEC MyAtomicProc ... item ...); } I want to do the foreach in a store procedure. How can I pass a c# list of object and execute this procedure in EF : myContext.Execut...

Invalid character value for cast specification

I am inserting data into SQL 2005 using SQLXMLBulkLoad.SQLXMLBulkload.3.0 My data table has following column: objDataTable.Columns.Add("TaskDateTime", System.Type.GetType("System.DateTime")) My bulk insert schema has following definition: <xsd:element name="DepartureTime" type="xsd:date" /> (Using xmlns:xsd="http://www.w3.org/2001/XMLS...

Storing array of integer values in SQL Server

Hi, i want to store an array of integer values in a SQL database table (SQLServer 2005), if possible by using a single column. The integer array will have a length of 7560 values. I am using a objectdatasource, the datatype should be compatible with the generated parameters of a tableadapter. thanks for helping :) ...