Is there any more convenient way to compare a tuple of data in T-SQL than doing something like this:
SELECT TOP 100 A, B
FROM MyTable
WHERE (A > @A OR (A = @A AND B > @B))
ORDER BY A, B
Basically I'm looking for rows with (A, B) (@A, @B) (the same ordering as I have in the order by clause). I have cases where I have 3 fields, but it just gets even uglier then.
I have 2 tables with data thus:
Col1 Col2
------- --------
Admin001 A
Admin001 B
Admin002 C
Admin002 C
Admin003 A
Admin003 C
I need to find all instances of Col2 values with 'A' immediately followed by 'B'. 'A' followed by any other symbol does not count. Is there a way to use SQL to accomplish this?
Environment is DB2 LUW v9.5
Hi
I was trying to install MSSQL 2008 server on WIndows 208 server R2 Standard Machine, but I got This message: Program Compatibility Assistant, And that I should apply SQL server 2008 SP 1
I don't get it? Why Dosen't it not work with this version I have? How should I solve this problem?
I am developing a WPF application, and I need your advice.
I have to generate reports in my application. What should I use, Crystal Reports or SQL Server Reporting Services? Which one is better, and why?
Hello y'all,
A general question on what everyone's opinion is on storing SQL queries within a configuration file?
Is this just another bike shed?
Cheers,
Ben
I am generating a reports using SQL Reporting services 2005. I need to protect the protect the reports(pdf and excel) with the password while the user is exporting the report to to excel or pdf.
Is there any way to protect the report.
I am at the planning stage of a web application that will be hosted in Azure with ASP.NET for the web site and Silverlight within the site for a rich user experience. Should I use Azure Tables or SQL Azure for storing my application data?
I'd like some suggestions for online resources (blogs, guides, etc - not forums) to help me become good at designing high performance SQL Server databases that operate with large amounts of data and have heavy loads in terms of data turnover and queries per minute.
Suggestions?
I have a Linq to SQL data model that uses single table inheritance.
I created a new ASP.net Dynamic Data web site with all table scaffolding enabled, but I can't see any of the derived classes in my data model being scaffolded.
Is this by design?
I have a table with the fields CommonName and FirstName. Only either field has data, never both. Is there a way to order rows in an intersecting manner on SQL Server?
Example:
CommonName FirstName
Bern
Wade
Ashley
Boris
Ayana
I want records ordered like this:
CommonName FirstName
Ashley
Ayana
Bern
Boris
Wade
Is this possible, and if so, how?
I am trying to group points of geospatial data based on density and relative distance. Is there a way that this can be done in SQL Server 2008 using the spatial features or would it be better to translate the data into graph data and use a graph clustering algorithm?
How do I update two tables at the same time using Linq-to-SQL?
var z = from a in db.Products
join b in db.ProductSubcategories on
a.ProductSubcategoryID equals b.ProductSubcategoryID
join d in db.ProductCategories on
b.ProductCategoryID equals d.ProductCategoryID
select new { ProductName = a.Name, ProductCategory = d.Name,
ProductSubCategory = b.Name, Cost = a.StandardCost,
discontinuedDate = a.DiscontinuedDate,
ProductId=a.ProductID };
I get this error when using linq-to-sql with timestamp as part of a composite primary key:
"The primary key column of type 'Timestamp' cannot be generated by the server."
I'm guessing this may be due to the fact timestamp is just a row version thus perhaps it must be created after the insert? Or...
My SQL Server 2008 database file (.mdf) file is nearly 24 MB but the log file grown upto 15 GB. If I want to shrink database what are the important points to take into consideration?
Will shrink causes any index fragmentation and does it affect my database performance?
hi!
I've two tables to join with a column(say emp_id)..if emp_id in both the tables have null values, how'll MS SQL server and Oracle treat???
Coz, i read that informatica will neglect the NULL rows when joining..if i handle the null, by substituting -1, a cross-join will happen which i don't want..
what can i do here?
I cannot completely neglect the rows which has NULL.
Thanks
I'm trying to build a .NET Managed data provider and I need to be able to parse SQL commands.
What are good, free (as in beer) objects to do this? - I haven't seen any standard .NET assemblies for this yet.
Thanks,
Eli.
Hi All,
We want to install sql server 2005 on Windo
ws 2000 Server. We are able to install database service engine, analysis services engine and integration services.
But we are unable to install workstation components like SSMS.
Does anybody faced this problem?
What is the fix for this?
Thanks,
Raghu
Hi,
As per my project requirement i need to lock a user in SQL Server(Which is created using Windows Authentication). Is there any way to do this?
Thanks for the help
Santhosh
Hi,
While using new SQL Server 2008 Reporting Service 2008 the page margins that I specify in Report Properties Page Setup do not seem to flow through to Excel when exported?
They always seem to be set to Top & Bottom: 2.5cm, Left & Right: 1.9cm, no matter what I set them to in the report.
This was working perfect in 2005 version.
Any help would be much appreciated.
Thanks,
Bipin
Having a table with 60 columns, and 200 rows. Altering a BIT column from NULL to NOT NULL, now has a running execution time of over 3 hours. Why is this taking so long?
This is the query that I'm execution:
ALTER TABLE tbl
ALTER COLUMN col BIT NOT NULL
Is there a faster way to do it, besides creating a new column, updating it with values from the old column, then dropping the old column and renaming the new one?
This is on MS SQL Server 2005.
Hi everybody!
In a winforms application i 'm storing one Wingdings char in a SQL Server 2005 field of type NVARCHAR(1).
Storing, retrieving and showing up this char in a control works fine.
The problem i'm facing is this: how to search for records which have a specific wingding char value: for example
Select * from table where FieldWithWingding = valueOfLeftArrowChar
How to achieve this?
Thanks in advance
If I use many CLOB variables in the PL/SQL stored procedure to store many long length string , are there any performance issues? Is the length of the CLOB is also variable? Are there any known limitations/disadvantages for CLOB instead using varchar2 and long?
I have a ton of data in a sql database which I would like to be able to import and display in excel (I can already do this) and additionally modify or append to the dataset within excel and write the changes/additions back to the database.
What is the best way to go about doing something like this?
Please let me know, thanks!
i have a mvc web project and i'm using linq to sql
i'm using dataannotaion like this
public class ClientValidation
{
[Required]
public string name1st { get; set; }
}
then in the linq class i add that above client class
[global::System.Data.Linq.Mapping.TableAttribute(Name = "dbo.Client")]
[MetadataType(typeof(ClientValidation))]
public partial class Client : INotifyPropertyChanging, INotifyPropertyChanged
{
}
every thing is going ok
the question is when i re generate the linq when i add table or change any thing in database i need to rewrite [MetadataType(typeof(ClientValidation))]
is there any other method to enable me regenerate the model and keep the data annotation as it