(this question is very similar to my previous question Does it matter where I check part of a composite key when joining two tables in SQL Server?)
I'm joining three tables on a composite key, with the value of one of the columns being determined by user input. I'm wondering if it matters where I compare the corresponding columns when ...
hi!
I have a table for players, a table for teams, and a table for team_players (using SQLServer 2005). Not all players are on a team. I would like to craft a query that will return one row for each non-team player, and one row for each team (i.e. there is one result row representing all 20 players on the Knicks, and that result row c...
I have a table which have an integer coloumn. Let table name is Table1 and ColName is Col1.
I want to add number 15 to every value in col1. what will be the sql query for this.
...
Is there any way to select from a function and have it return incrementing numbers?
For example, do this:
SELECT SomeColumn, IncrementingNumbersFunction() FROM SomeTable
And have it return:
SomeColumn | IncrementingNumbers
--------------------------------
some text | 0
something | 1
foo | 2
...
Hi
This fairly unusual, but because of office politics etc. we have (read-only) access to the data warehouse, but not to the live data. However we need up-to-date data to populate our relational (OLTP) database (MS SQL server. The data in the warehouse (also MS) is in star schema format (i.e. Dimensions and Facts). I am not very familia...
I can easily get a random record with this:
SELECT * FROM MyTable ORDER BY NewId()
I can easily get a record with "today's date" with this:
SELECT * FROM MyTable WHERE MyDate = "2010-24-08" -- db doesn't store times
But how would I combind the two?
Get 1 random record... anything with today's date.
If none are found...
I tried to store Arabic string in SQL 2008 database but it converted to " question mark " why ? and what should I do ?
...
i have 500 records in a table. one column holds all html data. so e.g -
html> body> ... /body> /html>.
What i want to do is a find and replace. i have this tag in every single record -
<table id="something something" />
i want to replace that in all the rows with <table id="" />
now the difficult part is all the "something something" is...
Hi
I am looking to apply SQL column level encryption using symmetric keys. The initial steps needed to create the Database Master Key, Certificates and Symmetric Keys seems straight forward and I have tested encrypting/decrypting data using Symmetric Keys successfully.
However, once the data is encrypted I don't know how best to query...
I have a table CSFT_SuggestionItem with cols like:
SuggestionItemID Title Description, etc.
------------------------------------------------------------
1 Item 1 Do more work
2 Item 2 I think more is good
For each SuggestionItem, there can by multiple "Applic...
(MSSQL newbie alert) I have a number of databases on my machine, some were created using aspnet_regsql, others downloaded from the microsoft ASP.NET MVC 2 tutorials (e.g. http://www.asp.net/mvc/tutorials/mvc-music-store-part-3). The db's created with aspnet_regsql are listed in the wizard dropdown, but the ones I downloaded are not. I ...
Hello,
We just upgraded our SQL Server 2005 to SQL server 2008 R2 and noticed some performance problems.
The query below was already slow but now in 2008 it just times out. We rebuild the catalog to make sure its freshly made on 2008
DECLARE @FREETEXT varchar(255) = 'TEN-T'
select Distinct ...
from
DOSSIER_VERSION
inner join...
Using SQL Server I want to store a list of URLs in a table. In addition I have the requirement that I do not want any URL to appear in the table more that once.
This would suggest that I would like to make the URL the primary key for the table but this is not possible in SQL Server because of the length of URLs. SQL Server has a constra...
I feel like a bit of a newbie posting this, but anyway:
I have a large number of stock items, 3000-5000 which have complex names, based on whoever has entered the items over a period of 16 years, and example of a name is:
"Food, Dog, Pal Meaty Bites chunks 8kg bag"
Another, related item is named:
"DOG FOOD: Meaty Bites (Pal) 22kg ba...
I was pondering GUIDs as primary keys recently, and was reminded of the most egregious misuse of them I've ever encountered:
This database contained a lot of Entity-Detail parent-child relationships, like Receipt, which had LineItems. Most of the Detail tables (LineItem in this case) used GUID primary keys. But instead of being stored u...
shall I use binary(16)? or varbinary(16)?
I know I can use getAddress() in java.net.InetAddress (Java) or System.Net.IPAddress (C#) to get a byte[] representation of both IPv4 and IPv6, but if I need to insert IPv4 i.e. binary(4) into a binary(16) field in SQL Server, do I need to worry about padding or anything?
Thanks
...
I am using LINQ for paging data in my website. I am currently using Skip() and Take() to perform the paging. Now I want to cache the data using cache dependencies so that the the cache will invalidate if the data changes. However SQL Server's query notifications don't support the TOP expression. Are there any alternative ways to query a ...
hi .. i am trying to generate a script from sql 2005 database to sql 2000 database . After determining all the objects of database it is stopped and shows a message in error report that "Script failed for Server 'HOME\SQLEXPRESS'. (Microsoft.SqlServer.Express.Smo)"
anyone can suggest me what should i do to convert sql 2005 to sql 2000 ...
I have the following store proc
SET @sql = 'RESTORE DATABASE ' + quotename(@dbname) + '
FROM DISK = N''E:\sql\template_' + @dbnamebak + '.bak''
WITH FILE = 1,
MOVE N''FromTemplate' + @dbname + '.Data'' TO N''E:\sql\' + @dbname + '.mdf'',
MOVE N''FromTemplate' + @dbname + '.Log'' TO N''E:...
Our client is trying to export their data from their FileMaker 10 database into a MS SQL system via ODBC.
We have the DSNs set up, and can import date and number fields, but text fields fail with:
“requested conversion is not supported”
Cannot get the current row value of column “[TQG6]...[Referral].ReferralAccountName” from OLE DB pro...