Skip to content Skip to sidebar Skip to footer
Showing posts from July, 2024

Dynamic Query For Pivot In Clause

This is in continuation of this thread I have the below query to have the value as heading using … Read more Dynamic Query For Pivot In Clause

Bcp Import Error "invalid Character Value For Cast Specification"

All I am using BCP for import export and getting 'Invalid character value for cast specificati… Read more Bcp Import Error "invalid Character Value For Cast Specification"

How To Avoid Adding Redundant Data In Sqlite Table Using Php?

I am working on a php code as shown below which lists all the mp4 files present in a $src_dir. $src… Read more How To Avoid Adding Redundant Data In Sqlite Table Using Php?

Can I Escape Double Quotes In Column Titles With Oracle?

Creating a table with a double quote to escape the real double quote doesn't seem to work in Or… Read more Can I Escape Double Quotes In Column Titles With Oracle?

Entity Framework Long Living Data Context Vs Short Living Data Context

I would like to know what is the best practice to work with C# and SQL Server (entity framework) be… Read more Entity Framework Long Living Data Context Vs Short Living Data Context

Is It Possible To Set Foreign Key Between Two Excel Sheets?

Is it possible to set foreign key between two excel sheets and query records from the two sheets? … Read more Is It Possible To Set Foreign Key Between Two Excel Sheets?

Hits Per Day In Google Big Query

I am using Google Big Query to find hits per day. Here is my query, SELECT COUNT(*) AS Key, … Read more Hits Per Day In Google Big Query

Disable Parentheses In Access Sql Queries

is there a way to tell ms access (2003) to not put joins into parentheses. or at least to understan… Read more Disable Parentheses In Access Sql Queries

How Can I Avoid This Access Sql Kludge?

The goal is to return the info from the latest assignment for each 'eligibility'. If there … Read more How Can I Avoid This Access Sql Kludge?

Sqlite Rawquery Selectionargs And Integers Fields

As the Android documents says, the selectionArgs parameters of the rawQuery method is parsed as str… Read more Sqlite Rawquery Selectionargs And Integers Fields

Mssql (tsql) Procedure Replace Order

... xx ... i want to change to ... xxx ... So id='' must be first and th Solution 1: I… Read more Mssql (tsql) Procedure Replace Order

Django Model Inheritance Query A Central Table

I have a solution that I thought I could take care of model inheritance, but now looking at it agai… Read more Django Model Inheritance Query A Central Table

How To Return Values To Web Api Controller From A Stored Procedure In Dbcontext

I am trying validate values to be inserted into SQL from Web API 2 and Repository Pattern. The dat… Read more How To Return Values To Web Api Controller From A Stored Procedure In Dbcontext

Penultimate Date For Each Record

I'm struggling with creation of select which shows me penultimate date for each record in my DB… Read more Penultimate Date For Each Record

Php: Sql Value As Filename

I have this code: Solution 1: You can make your life easier by naming the value like this: $sq… Read more Php: Sql Value As Filename

Sql Keeping Count Of Occurrences

I've the following problem I need to solve in SQL. Let's say that I have a table with 2 col… Read more Sql Keeping Count Of Occurrences

Arithmetic Overflow Error When Converting Expression To Data Type Datetime

In the following query: SELECT DU.MESSAGEINSERTDATE from [MYSMSREPORT].[DBO].[SIXDAYSHISTORY] … Read more Arithmetic Overflow Error When Converting Expression To Data Type Datetime

Sql Server Query To Find Chi-square Values (not Working)

I am trying to find the Chi-Square test from my following SQL Server Query on the sample data: SEL… Read more Sql Server Query To Find Chi-square Values (not Working)

How To Store A Tree In Sql Database

I have to store a tree in a database, so what is the best way to do this? Show the method you use a… Read more How To Store A Tree In Sql Database

Why My String Containing Query Does Not Work In Stored Procedure

My situation is that I send a query to the stored procedure to run it though c# code. This query i… Read more Why My String Containing Query Does Not Work In Stored Procedure

Sqlalchemy Association Table With Soft Delete

I'm trying to configure my SQLAlchemy models to use an association table for a relationship. Th… Read more Sqlalchemy Association Table With Soft Delete

Why Can't You Use Or Or In With A Outer Join Operation?

If I use the following query in an Oracle SQL database (inspired by this question here): SELECT p.N… Read more Why Can't You Use Or Or In With A Outer Join Operation?

Ssis Send Mail Task: Error: An Error Occurred With The Following Error Message: "the Operation Has Timed Out."

SSIS package in question runs a series of stored procedures and fills 13 different excel files with… Read more Ssis Send Mail Task: Error: An Error Occurred With The Following Error Message: "the Operation Has Timed Out."

Order Users Based On When The Relationship Was Created_at

I used the Railstutorials to create followers and followed_users http://ruby.railstutorial.org/chap… Read more Order Users Based On When The Relationship Was Created_at

Linq Group Join And Where Statement On Property Of The Joined Table

So I believe I have found out that group join is a left outer join and that is what I need. But I n… Read more Linq Group Join And Where Statement On Property Of The Joined Table

Using A Cursor In A Stored Procedure To Loop Rows Mysql

Scenario: I have a stored procedure that gets data from a table based on 2 inputs: a date and a str… Read more Using A Cursor In A Stored Procedure To Loop Rows Mysql

Sqlite 3 Opening Issue

I'm getting my data ,with several similar methods, from sqlite3 file like in following code: -(… Read more Sqlite 3 Opening Issue

Split/extrapolate Single Records By Date Range Into Multiple Records

I have data like below with a start and end date. The record could start and finish on the same day… Read more Split/extrapolate Single Records By Date Range Into Multiple Records

Firebird Sql Challenge - Return One Row That Has The Data When Select Returned Two Rows

I have a quite unique need to make select always return one row My SQL: select * from table1 Where … Read more Firebird Sql Challenge - Return One Row That Has The Data When Select Returned Two Rows

Failure To Connect To Microsoft Sql Server At First Attempt

I have an Access accdb file in which all the tables are linked (not imported) to a Microsoft SQL Se… Read more Failure To Connect To Microsoft Sql Server At First Attempt

How To Return Temp Table From Postgres Function?

I have below query running fine independently, but showing many issues inside a postgres function C… Read more How To Return Temp Table From Postgres Function?

Problem Concatenate Str To Database For Recall The Two Id In Button Insert

I created these two functions, adding various + in curson.execute: def getIDCampionato(nome_campion… Read more Problem Concatenate Str To Database For Recall The Two Id In Button Insert

Update Xml Stored In A Xml Column In Sql Server

I have a sample table in SQL Server 2012. I am running some queries against but the .modify() XQuer… Read more Update Xml Stored In A Xml Column In Sql Server

Importing Files With Extension .sqlite Into R

I have a SQLite database exported (as a sqlite format 3 file?) from Scraperwiki with the .sqlite fi… Read more Importing Files With Extension .sqlite Into R

Pivot On Joined Tables Sql Server

I have two tables with data TAB1 --------------------------------------------- | ID1 | ID2 … Read more Pivot On Joined Tables Sql Server

Use Of Previous() Function In Reverse Date Sorted Data In Ssrs?

I'm trying to use the Previous() function in a report indicator to display an up or down arrow … Read more Use Of Previous() Function In Reverse Date Sorted Data In Ssrs?

Pypyodbc - Invalid Cursor State When Executing Stored Procedure In A Loop

I have a python program which uses pypyodbc to interact with MSSQL database. A stored procedure is… Read more Pypyodbc - Invalid Cursor State When Executing Stored Procedure In A Loop

Conditional Foreign Key In Sql

i have one table called as PartyChannel having following columns ID, ChannelID, ChannelType Chann… Read more Conditional Foreign Key In Sql

Mysql Query For Timezone Conversion

is there a way to convert from unix timestamp to GMT in mysql while running the query itself?? My q… Read more Mysql Query For Timezone Conversion

How To Pivot This Table In Sql

I came across this issue when trying to make use of this 'active users' table from Microsof… Read more How To Pivot This Table In Sql

Sqlalchemy Raw Sql Vs Expression Language Statements

When inserting multiple rows in a MySQL-DB via a SQLA-Expression-Language statement, f.e. Foo.__tab… Read more Sqlalchemy Raw Sql Vs Expression Language Statements

Unable To Perform Delete On View Sql Server 2005

I am unable to perform a delete on a View. Everything worked fine on the individual tables. EDIT1: … Read more Unable To Perform Delete On View Sql Server 2005

How To Upgrade Sqlite Version?

I'm developing my first app and using the following code I see what is my SQLite version: Curso… Read more How To Upgrade Sqlite Version?

Sql/regex Challenge/puzzle: How To Remove Comments From Sql Code (by Using Sql Query)?

Requirements Single-lines comments (e.g. -- my comment) should be removed. Multi-line comments (e.… Read more Sql/regex Challenge/puzzle: How To Remove Comments From Sql Code (by Using Sql Query)?

Sql Server, How To Remove Updates Elements From User-defined Table Type?

I have a User-Defined Table Type, lets say @TT dbo.IntType readonly, IntType is batch of int, as Pr… Read more Sql Server, How To Remove Updates Elements From User-defined Table Type?

How Do I Generate Crud Stored Procedures From A Table In Sql Server Management Studio

How do I take a table, and auto-gen CRUD stored procs for it in SSMS? Solution 1: SSMS doesn't… Read more How Do I Generate Crud Stored Procedures From A Table In Sql Server Management Studio

Unable To Access Database (sql Server Ce / Windows Mobile 6.5)

I'm creating an application for a Windows Mobile 6.5 device, part of which is supposed to repli… Read more Unable To Access Database (sql Server Ce / Windows Mobile 6.5)

Sql Or Linq: How Do I Select Records Where Only One Paramater Changes?

Say we have this list: Id IdRef myColumn anotherColumn 448 70 1 228 449 … Read more Sql Or Linq: How Do I Select Records Where Only One Paramater Changes?

Sql How To Get Comp-3 Packed Decimal?

I am creating an ASCII output file contain some information and two of my fields require the date a… Read more Sql How To Get Comp-3 Packed Decimal?

Nested Join In Excel Vba (adodb) Results In "join Expression Not Supported"

I have a series of three tables which I would like to join together using ADODB in an Excel VBA app… Read more Nested Join In Excel Vba (adodb) Results In "join Expression Not Supported"

Deleting Item From Listview And Database With Onitemclicklistener

I created a database and managed to display the added items into a ListView. Now I need a method to… Read more Deleting Item From Listview And Database With Onitemclicklistener

How Do I Bulk Insert Two Datatables That Have An Identity Relationship

I'm using SQLBulkCopy, in pseudocode I do this: make new Employee datatable make new Employee… Read more How Do I Bulk Insert Two Datatables That Have An Identity Relationship

Concatenate With Null Values In Sql

Column1 Column2 ------- ------- apple juice water melon banana red … Read more Concatenate With Null Values In Sql

Given Longitude And Latitude Of Two Areas, How To Find The Distance Between Them In Meters. How To Query In Sql..?

I basically have two table with ID, Area.Longitude and latitude column. I need to find the differe… Read more Given Longitude And Latitude Of Two Areas, How To Find The Distance Between Them In Meters. How To Query In Sql..?

Ssrs Show Value Only On Last Page In Body Of Report

I'm attempting to show a sum in a table footer on a report. It will be in the body of the repo… Read more Ssrs Show Value Only On Last Page In Body Of Report

Which Query Is The Correct Way?

Can somebody please tell me which is the better way, they both produce the same results but which i… Read more Which Query Is The Correct Way?

How To Copy Top 1000 Records From 7000 Records In Existing Table To Other New Table

I have a table A which consists more than 7k records,Now i am creating a new table B .In my new tab… Read more How To Copy Top 1000 Records From 7000 Records In Existing Table To Other New Table

Exec Sp On Linked Server And Put That In Temp Table

Need some help on the below issue: Case 1 : stored procedure is on server 1 - call is from server1 … Read more Exec Sp On Linked Server And Put That In Temp Table

Sql Server Insert From Flat File

I have some data that needs to be imported into SQL Server. I have the following fields: ID Para… Read more Sql Server Insert From Flat File

List Table Names, Owner, Schema And Columns In Sql Server Database

In SQL SERVER how can I get a list of all table names, column names and owners? I have done this bu… Read more List Table Names, Owner, Schema And Columns In Sql Server Database

Display Only Those Rows, Whose Sum(price) Is More Than A Certain Number

I have 3 tables: customers(name, id), items(name, price, id), purchases(id, items_id, custom… Read more Display Only Those Rows, Whose Sum(price) Is More Than A Certain Number

Rails Activerecord And Db Normalization

What are the pros and cons of breaking out optional 1:1 attributes into their own separate model. F… Read more Rails Activerecord And Db Normalization

Android - Sqlite Cursor Getcolumnindex() Is Case Sensitive?

While working with SQLiteCursor in Android I came to know that the getColumnIndex() is behaving cas… Read more Android - Sqlite Cursor Getcolumnindex() Is Case Sensitive?

Microsoft Sql Server Does Not Return Everything When Using Like Clause

I have a Products table in SQL Server 2014 Express with records in it. A few product names (records… Read more Microsoft Sql Server Does Not Return Everything When Using Like Clause