Basically I have a table like this:
CREATE TABLE Person(
PersonID int IDENTITY(1,1) NOT NULL,
FirstName nvarchar(512) NOT NULL,
LastName nvarchar(512) NULL
)
And I need to find the top n results based on a user-query like this:
"Joh Smi"
The following query returns the results I need (I think). Just not in the relevant ...
I have a table as below
Name Priority Date
-------------------------
A 2 d1
B 3 d2
How to write a query to achieve the below output
ColumnNames d1 d2
--------------------------
Name A B
Priority 2 3
Thanks
...
I could be not more sorry guys - the question was a very wrong one. As spotted by you the error is due to the fact that a colum with that name does not exists. The error and the post is due to a misalignement between a staging server and a production server. But the error has been detected by your answers, so many, many thanks
The fol...
I get the following error when I try to connect with TCP/IP from SQL Server Management Studio. I want a step by step description to solve my problem I don`t know what´s wrong?
Cannot connect to
===================================
A network related or instance specific error when a connection to SQL Server...
(provider: Named pipe-prov...
[Also on SuperUser - http://superuser.com/questions/116600/can-i-spead-out-a-long-running-stored-proc-accross-multiple-cpus]
I have a stored procedure in SQL server the gets, and decrypts a block of data. ( Credit cards in this case. )
Most of the time, the performance is tolerable, but there are a couple customers where the process is...
In SQL server I can say:
Select top 50 percent
How can I say bottom 50 percent?
EDIT - for the sake of an interesting question, if we assume he has a table with a primary key but wants the bottom 50% ordered in ascending primary key order. What would be the most efficient way of achieving that?
...
It seems that SQL Server has a fair amount of XML support. Mostly I've seen info regarding storing XML in SQL Server, querying XML data stored in SQL Server, and exposing data as XML.
Is the following scenario an option:
I'd like to expose xml data (it's an RSS view of workitems) from a web site via a SQL Server view. The motivation is...
I'm using SQL Server 2008 (non-R2) and trying to use Report Builder 3.0. When I try to connect to the report server, I get an error:
Connection Failed. Unable to connect
to the server that is specified in the
URL......
However, I am using the same connection as my Report Builder 2.0 and that works fine.
Can RB 3 not work with ...
hey all,
iv created a database with some tables and populated them using SQL server 2008, i want to move the database to another machine, what would be the best way copy the database and recreate it in another location ??
by the way im connecting to localhost\SQLEXPRESS if thats important !!
thanks
...
SQL Server database recovery consists of three phases: the analysis phase, the redo phase, and finally the undo phase.
Can anybody please explain clearly or give a good link on these three phases of recovery??
...
Over the next few months, we need to consider the best technology/technique for periodically uploading SQL Server 2008 Express data that is held on a local network up to a Web based SQL Server 2008 server.
The idea is to allow us to consolidate the data in 20 distributed (local) SQL Server Express 2008 apps in use throughout the country...
I have SQL server 2000 dev edition. But it isn't compatible with my new win7 pro 64 bit computer. Is there a free version of 2000 that I can install on my 64 bit pc for development?
As I understand it, I can restore a 2000 database to sql server 2008. But I wont be able to restore the database back to the 2000 server after making any ch...
I am creating a statistics module in SQL Server 2008 that allows users to save data in any number of formats (date, int, decimal, percent, etc...). Currently I am using a single table to store these values as type varchar, with an extra field to denote the datatype that it should be.
When I display the value, I use that datatype field ...
I have table that I insert data with following query (from c# code):
INSERT INTO [BazaZarzadzanie].[dbo].[Wycena]
([KlienciPortfeleKontaID]
,[WycenaData]
,[WycenaTyp]
,[WycenaWartosc]
,[WycenaWaluta]
,[WycenaUzytkownik]
,[WycenaUzytkownikData])
VALUES
(@varKlienciPortfeleKontaID
,@varWycenaData
,@varWycenaT...
I'm trying to define a new type and have not had much luck finding any information about using lists within them. Basically my new type will contain two lists, lets say x and y of type SqlSingle (the user defined type is written in C#) is this even possible?
If not how are you supposed to go about simulating a two lists of an arbitary l...
And worry about it later like when I have few hundred records at least?
...
I already have Visual Studio 2008 installed. When installing developer Sql Server 2008, do I need to check the Business Intelligence Development Studio option? I'm guessing not.
I assume if I already have VS 2008, the install will just add the relevant Sql Server related project types into VS 2008.
EDIT:
I marked the question answer...
I have an SQL Server integration Services (SSIS) package using the standard Event Log provider (yes, the event log! I know we can use SQL etc...)
The default "Source" of the log events is "SQLISPackage100" but I want it to be something like "AppName" so that the errors are more visible between the different packages when viewing the ev...
I am trying to create an index on a VarBinary(max) field in my SQL Server 2008 database.
The steps I am taking are as follows:
Table: dbo.Records
Right click on table and select "Full Text Index"
Then select "Define Index..."
I choose the primary key which is the PK of my table (field name Id, type UniqueIndentifier).
I then get the ...
I have inherited a database that has a lot of cursors in it, and from what I have read, cursors and very slow and resource hungry. I'd like to remove these if possbile and replace with something else. I'm familiar with CTEs, but was wondering if a CTE inside of a WHILE 1 = 1 loop is a best practice or not?
Any ideas?
...