Hi,
anybody use Subsonic with SQL Server CE 3.5 ?
I try but get an error with Substage 2.2, error talking about PK_TABLE.
My tables have primary keys and relations.
Can someone help me ?
By, Giuseppe.
I need to select static colums + a dynamic number of rows as columns in SQL
TABLE 1
-------
HotelID
BlockID
BlockName
TABLE 2
-------
BlockDate (unknown number of these)
NumberOfRooms
Desired Result Row
------------------
HotelID | BlockID | BlockName | 02/10/10 | 02/11/10 | 02/12/10 | ...N
Where the date columns are the unknown number of BlockDate rows.
Hi!
There's the (almost religious) discussion, if you should use LIKE or '=' to compare strings in SQL statements.
Are there reasons to use LIKE?
Are there reasons to use '='?
Performance? Readability?
Thanks in advance!
I am developing a web Application in ASP.NET 3.5 with SQL Server 2008. I need Multiple Language such as English, Dutch, Finnish etc. I can do it by using System.Resources and System.Globalization. but I can't convert the Language which data come from database.
How can I solve it ???
I get my data from SQL to Dataset with Fill. It's just one table with two columns (CategoryId (int) and CategoryName (varchar)).
When I look at my dataset after fill method, CategoryId Columns seems to be correct. But in the CategoryName I have a *System.Data.StrongTypingExceptio*n.
What could that mean?
Any Ideas?
We have a server with a database that has a symmetric key (Database - Security - Symmetric Key). We have a backup duplicate databases that we are using as a test databases, but we don't have this key in there.
How can I duplicate this symmetric key (or make a new one exactly like the old) and put it in the existing databases? It has to have the same value and key-name as the other one.
This is on MS SQL Server (edit) 2008 .
Just looking at:
What does this SQL do:
Robert'); DROP
TABLE STUDENTS; --
I know both ' and -- are for comments, but doesn't the word DROP get commented as well since it is part of the same line?
Hi, I'm trying to create a table type in sql server 2005.
Here is what my code looks like:
CREATE TYPE NameResourceType AS TABLE
(
ID int,
[Value] Varchar(256)
)
GO
I receive the following error:
Incorrect syntax near the keyword 'AS'.
I have a table in sqlserver 2005.
I want to show all domain name in a dropdownlist maintaing the same hierarchy. i.e
Law
Engineering
--civil
--Mechanical
Medical
--Dental
----Cavity
--MBBS
I need to append '--' according to the domain level. Is it possible using a sql query.
or alternatively can I have any other control to show this data.
I need to create database for SQL Server, what kind of naming convention I sohuld use?
1) Table names could be : customer, Customer, CUSTOMER
2) Field names could be : customer_id, CustomerId, CustomerID, CUSTOMER_ID, customerid, CUSTOMERID and so on...
Is there any official suggestion for naming conventions or what is msot common way to name tables and fields?
I have a desktop application (C# .NET 3.5) that uses a SQL server for it's database. I have had a request from the client, however, to make it possible to export the database as it stands, and be able to use it on a laptop without connectivity. They understand that updates to the parent server will not be reflected in these offline clients.
Is there a way I can just save the DataSet's to a binary form and write them to a disk and send those files to the offline clients.
I have the following SQL:
SELECT *
FROM [Database].dbo.[TagsPerItem]
INNER JOIN [Database].dbo.[Tag] ON [Tag].Id = [TagsPerItem].TagId
WHERE [Tag].Name IN ('home', 'car')
and it returns:
Id TagId ItemId ItemTable Id Name SiteId
1 1 1 Content 1 home 1
2 1 2 Content 1 home 1
3 1 3 Content 1 home 1
4 2 4 Content 2 car 1
5 2 5 Content 2 car 1
6 2 12 Content 2 car 1
instead of just two records, which these names are "home" and "car". How can I fix it?
Thanks.
I'm considering using PostgreSQL with a .Net web app. Basically 3 reasons:
Mature Geo Queries
Small footprint + Linux
Price
I'm wondering a bit about tools though, SQL Server Profiler and query plans and performance monitors have been helpful. How is this world with Postgres? Some other things I should consider?
Edit: Will most likely use NHibernate as ORM
Hi,
One of my friends got the access database with Forms (VBA) and wish to migrate all the database table to the newly installed MOSS 2007 site.
He is using SSMI for this purpose. He cannot do it because there are plenty of errors and warnings. I think it is due to the old Access queries.
Is there any other way to import the database to sql 2005 from access ?
Thanks
I have a table records(ID, ParentID) containg this data
ID ParentID
1 null
2 1
3 2
3 4
4 5
6 null
7 6
If you draw this table in hierarchy as a family 1,2,3,4,5 will be related to each other.
I want to find a way, where I can pass an ID like 3 it give me the others family members using SQL or using C#
3 - result 1,2,4,5
2 - result 1,3,4,5
6 - result 7
and so on
I want to find my parent and his parents and childs and my child and his childs
LIKE THE EXAMPLES
I am using the performance dashboard with our SQL Server 2005 databases and it lists what it considers to be missing indexes. But some of those indexes DO exist! They are not disabled, and they are defined exactly as the dashboard says they should be. Why are they reported as missing?
I often need to verify some simple code before posting, and it's great if I have installed IDE, but what if not? It would be nice to have online free tools for SQL, VB.NET, C# code validation, or maybe even testing.
EDIT
What I actually mean are online live web tools, like JSLint for javascript.
Have you seen any?
Thanks!
Hi,
I've just installed a fresh copy of SQL 2008 Express. before I did anything I opened Management Studio and successfully connected using Window Authentication.
However I tried to run the following on the command line
"telnet localhost 1433" and got the error "Could not open connection to the host, on port 1433: Connect failed"
I checked netstat and there is nothing listening on port 1433.
Before I go any further, is there a problem with the install?
thanks,
Shane
Hi all,
currently I'm assigning a TextWriter to the Log property of my Linq to Sql data context (per request instancing) and write this to my logging when an exception is thrown while executing a stored procedure (is strongly typed mapped in the context, so not executing a custom command)
however when using ADO.NET we normally inspect the SqlCommand upon unhandled exception to read out the parameters and log them
is it possible to access the SqlCommand that was used for executing a Stored Procedure in L2S so we can reuse that existing logging component? This would be far nicer than the current Log TextWriter solution....
greetings,
Tim
How to loop through a select statement results to have a formatted text?
for example the select is like:
select name from table
and we want a variable @names like this:
"name1,name2,name3"
Database is SQL Server 2005
I have a MS SQL Fulltext Function like this:
(...)
RETURNS TABLE AS RETURN
SELECT * FROM fishes
INNER JOIN CONTAINSTABLE(fishes, *, @keywords, @limit)
AS KEY_TBL ON fishes.id = KEY_TBL.[KEY]
When I use this function in LINQ, it generates a special return type which includes all fields of my "fishes" table, plus Key and Rank.
How could I rewrite above query, or change something in LINQ, to omit Key and Rank and just return my "fishes" results (and to have the fulltext search result objects be of type Fish, which is what I really care about, so I don't have to cast)?
I am looking for resources and references for a MySql equivalent to MSSql SMO. Also, is SMO the newest technology for programmatic management of Sql server?
Why does this quite simple xquery takes 10min to execute in sql server (the 2mb xml document stored in one column) compared to 14 seconds when using oxygen/file based querying?
SELECT model.query('declare default element namespace "http://www.sbml.org/sbml/level2";
for $all_species in //species, $all_reactions in //reaction
where data($all_species/@compartment)="plasma_membrane" and $all_reactions/listOfReactants/speciesReference/@species=$all_species/@id
return <result>{data($all_species/@id)}</result>') from sbml;
I have an SQL function which returns a list of Teams.
I want to join an additional list to that list with a union, but only if it returns more than one rows.
Something like:
CREATE FUNCTION Teams()
RETURNS TABLE
AS
RETURN
(
SELECT * FROM TABLE1
UNION
if @@rowcount>1
SELECT * FROM TABLE2
end if
)
Why is the ( ) mandatory in the SQL statement
select * from gifts INNER JOIN sentgifts using (giftID);
? The ( ) usually is for specifying grouping of something. But in this case, are we supposed to be able to use 2 or more field names... in the example above, it can be all clear that it is 1 field, is it just that the parser is not made to bypass the ( ) when it is all clear? (such as in the language Ruby).