What's the best way to determine if a given SQL Server table is readonly, either because of account permissions or the database being marked as read-only?
Hi guys,
Basically I wanted to have an if-else statement in my linq to sql statement.
var query = from d in database
if(x == y) {
where d.Attr = x
}
else {
where d.Attr = y
}
select d;
Any ideas?
Hi,
I want to create a a full text search usng ms sql 2005.
here is the structure of my table
User-contains fields of Id, fname,lname,email,alternativeemail
Attachment-contains fields of id, name,category,filenameorurl
Certification-contains of fileds of id, title,school,sdate,edate
EducationalBackground-contain of fields of,…
Hi everybody,
Here it's my problem I've a list of the following measure :
src1 dst2 24th december 2009
src1 dst3 22th december 2009
src1 dst2 18th december 2009
I would like to have just the latest measures with a sql request - 2 first lines in my case because the pairs(src and dst) aren't the same.
I try to…
I'm trying to select records with a statement
SELECT *
FROM A
WHERE
LEFT(B, 5) IN
(SELECT * FROM
(SELECT LEFT(A.B,5), COUNT(DISTINCT A.C) c_count
FROM A
GROUP BY LEFT(B,5)
) p1
WHERE p1.c_count = 1
)
AND C IN
(SELECT * FROM
(SELECT A.C ,…
I allways used php 5.2.3 version ,but now I updated php to 5.3.2 version.
I have problem with mssql,I can`t connect to mssql server.
I have downloaded a sql server driver for php 1.1
There are a lot of files, i used 'php_sqlsrv_53_ts_vc9'
Put it on php/ext directory 'php_sqlsrv_53_ts_vc9'
I have added -…
Hi
I have tried uploading a transparent PNG image to a SQL server image field, and retrieving it using the DynamicData ImageHandler. The Transparent areas in the image appear white upon rendering. Please advise about any solutions
I'm trying to execute a SELECT statement that includes a column of a static string value. I've done this in Access, but never with raw SQL. Is this possible?
Example:
Name Status
John Unpaid
Terry Unpaid
Joe Unpaid
In the above example, the "Status" column doesn't exist in the database.
Cursor cursor = db.rawQuery("SELECT COUNT(rat)
FROM "+ TABLE_NAME_EXTRA +" apkid=\""+apkid, null);
cursor.moveToFirst();
int somatotal = cursor.getInt(0);
I'm trying to do a SQL function like count and sum, but this code returns a exception saying "emptyvalues".
anyone know…
I have re-written my code after great help from some friendly stack overflow members (big thanks to Martin B and Kev Chadders especially). I would now like to check if my code is still open to SQL Injections after this work. I believe the code is now working as it should, but any blinding errors that you see…
I am very new to SQL Server Stored Procedures,
I am trying to create a SP that will give return a list of records in a table by filter via StartDate and EndDate , but there will be 'View All' Option so sometime those @Param might not contain any values.
Currently my SP is Like
CREATE PROCEDURE…
Please, give me the most serious arguments against this.
Application directly opens a connection to ms sql server, directly executes queries.
So what I'd like to ask:
1) Why it is wrong?
2) What serious problems can that cause?
3) What should I do?:)
If I have an UDF that returns a table, with thousands of rows, but I just want a particular row from that rowset, will SQL Server be able to handle this effciently?
SELECT * FROM dbo.MyTableUDF()
WHERE ID = 1
To what extent is the query optimizer capable of reasoning about this type of query?
…
I am trying to set up a device remotely. I found this link:
http://www.microsoft.com/downloads/details.aspx?familyid=FCE9ABBF-F807-45D6-A457-AB5615001C8F&displaylang=en
That has SQL Server CE 3.5 SP1. I read the whole page, and can't seem to find out for sure if SP1 is a full install or…
Hi
I have the following SQL SELECT statement
SELECT bar_id, bar_name, town_name, advert_text
FROM bar, towns, baradverts
WHERE town_id = town_id_fk
AND bar_id = bar_id_fk
My problem is that since not every bar has an advert in table "baradverts", these bars are not coming up in the…
I have a SQL query in my ASP.net web app that looks like this:
SELECT * FROM [Records] WHERE ([title] LIKE '%' + @title + '%')
@title, of course, is the value of a text box on the page.
My question is, why, when the text box is empty, does this return nothing? And how can I make it…
For a new scalable high traffic global ecommerce website (asp.net) project which technology fits best (max. scalability & performance, min. price & maintenance)?
amazon simpledb, microsoft sql azure, mysql + memcached combo, or your solution...
Please help me with writing a sql query - I have a table with id, name and marks columns.
If I arrange the table in ascending order of marks, how can I fetch 5 names whose marks are close to a particular name.
I have a stored procedure that uses a table valued function which executes in 9 seconds. If I alter the table valued function and remove the where clause, the stored procedure executes in 3 seconds. If I add the where clause back, the query still executes in 3 seconds.
I took a look…
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…
I have the same query in a stored procedure that needs to be executed on different servers and databases according to parameters.
How can I arrange this without exec or sp_executesql?
I'm using SQL Server 2008.
Thank you.