I have a query:
SELECT Content.content_name, Language2.Name, Language2.language_id,
Content.id, Content.content_description,
FROM Language AS Language2
LEFT JOIN contents AS Content ON (Language2.language_id = Content.language_id)
How do I select only the distinct content_name?
...
I'm using following code to connect with Sql Server 2008:
Connection con = null;
CallableStatement stmt = null;
ResultSet rs = null;
try
{
SQLServerDataSource ds = new SQLServerDataSource();
ds.setIntegratedSecurity(false);
ds.setServerName("localhost");
ds.setInstanceName("MSSQLSERVER2008");
ds.setPortNumber(1433);...
I have a VB.NET application with a connection to an SQL Server 2003. On the server there are two databases, MyDatabase and MyDatabase_Test. What I would like to do is to show a dialog when the program starts that let's the user choose which database to use. My idea is to create a new form as the starup form that sets this property and th...
If I try to update a FileStream column I get following error:
com.microsoft.sqlserver.jdbc.SQLServerException: The result set is not updatable.
Code:
System.out.print("Now, let's update the filestream data.");
FileInputStream iStream = new FileInputStream("c:\\testFile.mp3");
rs.updateBinaryStream(2, iStream, -1);
rs.updateRow();
iStr...
We are having problems on one machine, with the error message:
"MSDTC on server XXX is unavailable."
The code is using a TransactionScope to wrap some LingToSql database code; there is also some raw Ado.net inside of the transaction.
As only a single sql database (2005) is being accessed, why is a distributed transaction being ...
I have several schemas in my database, and the largest one ("large" meaning disk space consumed) is my "web" schema which is a denormalized copy of data in the operational schemas.
This denormalized data is able to be reconstructed at anytime, and is merely there for extremely fast read purposes. Since the data is redundant, and VERY...
I have to create a C# application which displays unicode data in a textbox.
But the SQL server column storage has varchar data which contains unicode data. But since varchar is non-unicode based it displays character strings like "????????".
Well the problem i am facing is i cant change the column type as there are other dependent app...
Regarding to SQL performance.
I have a scalar valued function for checking some specific condition in base, it returns BIT value for True or False.
I now do not know how I should fill @BIT parameter
If I write.
set @bit = convert(bit,1)
or
set @bit = 1
or
set @bit='true'
function will work anyway but I do not know which met...
Here is the scenario:
I have a table that records the user_id, the module_id, and the date/time the module was viewed.
eg.
Table: Log
------------------------------
User_ID Module_ID Date
------------------------------
1 red 2001-01-01
1 green 2001-01-02
1 blue 2001-01-03
2 green 20...
Hi,
Is it possible to find all the varchar() columns in my database?
I am using SQL Server 2008 and would like to get the list in SQL server management console.
JD.
...
When looking at the actual execution plan for a query in SQL Server Management Studio (SSMS), how do I determine what an expression such as Expr1052 represents?
When I identify the costly parts of the query and look at the properties of that operation, there are often references only to these Expressions, or scalar operators. I want to...
Similiar to question:
http://stackoverflow.com/questions/2266132/how-can-i-get-a-list-of-element-names-from-an-xml-value-in-sql-server
How would I also get the values for the list of elements.
For example:
<Root>
<A>a1</A>
<B>b1</B>
<C>c1</C>
</Root>
Would return
Element | Value
A | a1
B | b1
C | c...
I've been using FULL-TEXT for awhile but I cannot seem to get the most relevant results sometimes.
If I have an field with something like "An Overview of Pain Medicine 5/12/2006" and a user types "An Overview 5/12/2006"
So we create a search like:
'"An" AND "Overview" AND "5/12/2006"' - 0 results (bad)
'"Overview" AND "5/12/2006"' - 1 ...
I'm wondering how SQL Server orders data that is returned from a query and the Id columns of the respective tables are all of type uniqueidentifier.
I'm using NHibernate GuidComb when creating all of the GUIDs and do things like:
Sheet sheet = sheetRepository.Get(_SheetGuid_); // has many lines items
IList<SheetLineItem> lineItems = sh...
a) If a query/subquery doesn’t find any matching rows, then it either
returns NULL or no value at all, thus not even a NULL value. Based on
what criteria does a query/subquery return a NULL and when
doesn’t it return any results, not even a NULL value?
b) I assume a scalar subquery will always return NULL, when no
matching rows are foun...
I'd like to have some degree of fault tolerance / redundancy with my SQL Server Express database. I know that if I upgrade to a pricier version of SQL Server, I can get "Replication" built in. But I'm wondering if anyone has experience in managing replication on the client side. As in, from my application:
Every time I need to creat...
I've been tasked with revisiting a database schema we designed and use internally for various ticketing and reporting systems. Currently there exists about 40 tables in one Oracle database schema supporting perhaps six webapps.
However, there's one unifying relationship amongst them all: a rooms table describing the room. Room name, pu...
declare @mydata nvarchar(4000)
set @mydata = '36|0, 77|5, 132|61'
I have this data that I need to get into a table. So for Row1 columnA would be 36 and columnB would be 0. For Row2 columnA would be 77 and columnB would be 5 etc.
What is the best way to do this?
Thanks
...
Snippet of original table:
CREATE TABLE [dbo].[Batch](
[CustomerDepositMade] [money] NOT NULL
CONSTRAINT [DF_Batch_CustomerDepositMade] DEFAULT (0)
Snippet of copied table:
CREATE TABLE [dbo].[Batch](
[CustomerDepositMade] [money] NOT NULL,
Code for copy database:
Server server = new Server(SourceSQLServ...
I have some data that isn't properly "partitioned" (for lack of a better word).
All inserts, processing and reporting happen on the same table. The bulk of the processing happens not long after the insert and not long after that it becomes immutable (we're talking days).
I could do all inserts and processing on a new table that I repl...