Hi i have a error like " dbFileName cannot be opened because it is version 655. This server supports version 612 and earlier. "
what should i do ? some friend of mine done a project but i guess he done it with sql 2008 and i have sql 2005 is that the reason why i got this error? can i fix it ? if i setup a newer version of sql does it ...
Possible Duplicate:
Inline SQL vs Stored Procedures
I have 100% ad hoc sql through out my application. A buddy of mine recommended that I convert to stored procedures for the extra performance and security. This brought up a question in my mind, besides speed and security is there any other reason to stick with ad hoc sql quer...
Hi, I'm new to SQL Server, and used mysql for a while now...
SELECT A.acol, IF(A.acol<0,"Neg","Pos") as Column2 From Table
I want to do something like that on SQL Server, but there doesn't exist the IF instruction.
How do I replace that if, in a SQL Server 2008 Query?
...
Hi,
How can we check that table have index or not ? if have how to find that index for a particular column for a table?
Regards,
kumar
...
Hi,
I'm thinking about to write a restful service which is able to upload and stream large video files (GB) (in future it might not only be videos and could also be large documents.
I researched so far and what really makes sense to me could be to use off:
WCF Data Services and Implement IDataServiceStreamProvider and on the back-end ...
I have a large table consisting of over 60 millions records and I would like to add 2 new columns for data migration purposes. There are indexes on the table and some of them are large. So, by me adding the 2 new columns to the table, will I run the risk of slowing down the database whilst it attempts to add them and maybe time-out? O...
For example, i have a column named EmployeeName.
Every time a user changes/fix his name, i need to keep a count. If he changes his name twice, then count is 2. Also, i need to store the time of every change employee makes on EmployeeName e.g. if the name essentially is James and time created is 9:00 AM and then employee changes to John ...
I want to fetch data from remote SQL Server 2008 from Oracle 10g without installing anything on remote machine .. How can I achieve that ?
...
I have a stored procedure that takes an XML parameter and inserts the "Entity" nodes as records into a table. This works fine unless one of the numeric fields has a value of empty string in the XML. Then it throws an "error converting data type nvarchar to numeric" error.
Is there a way for me to tell SQL to convert empty string to nu...
declare @t1 Table
(
a1 int
)
insert into @t1
select top 10 AnimalID from Animal
--select * from @t1
declare @t2 table
(
dogs int null
)
update @t2
set dogs = (Select COUNT(*) from @t1)
---------> The out put it gives me is just 0
...
I have a few tables where Foreign Key constraints are added. These are used with code generation to set up specific joins in generated stored procedures.
Is it possible to override these constraints by calling multiple deletes within a transaction, specifically "TransactionScope" in C# or is cascaded deleting absolutely required?
...
Imagine that we have two tables as follows:
Trades
(
TradeRef INT NOT NULL,
TradeStatus INT NOT NULL,
Broker INT NOT NULL,
Country VARCHAR(3) NOT NULL
)
CTMBroker
(
Broker INT NOT NULL,
Country VARCHAR(3) NULL
)
(These have been simplified for the purpose of this example). Now, if we wish to join these two tables on the...
Thought I would ask the knowledgeable StackOverflow community a question that was on my mind today and I can't seem to find an answer.
Is there any performance difference or advantage between an "IN" or using "OR"?
Ie. Is
SELECT type FROM types WHERE typecat IN ('abc', 'def')
better than
SELECT type FROM types WHERE typecat = 'abc' ...
Hi,
I have the following query which uses a date variable, which is generated inside the stored procedure:
DECLARE @sp_Date DATETIME
SET @sp_Date = DateAdd(m, -6, GETDATE())
SELECT DISTINCT pat.PublicationID
FROM PubAdvTransData AS pat
INNER JOIN PubAdvertiser AS pa ON pat.AdvTransID = pa.AdvTransID
WHERE (pat.LastAdDa...
I am trying to rectify a previous database creation with tables that contains data that needs to be saved. Instead of recreating a completely new database since some of the tables are still reusable, I need to split a table that exists into 2 new tables which I have done. Now I am trying to insert the data into the 2 new tables and becau...
I have a column like this in 1 of my database tables
DateCreated, datetime, default(GetDate()), not null
I am trying to use the Entity Framework to do an insert on this table like this...
PlaygroundEntities context = new PlaygroundEntities();
Person p = new Person
{
Status = PersonStatus.Alive,
...
I right clicked on a Database in the object explorer of SQL Server 2008 Management Studio. I went to Tasks > Import Data, and imported some data from a flat text file, opting to save the package on the server.
Now how the heck do I get to the package to edit or run it again? Where in SQL Server Management Studio do I go? I've expanded e...
I'm experiencing a weird problem with a SQL login. When I connect to the server in Microsoft SQL Server Management Studio (2008) using this account, I cannot see any of the tables, stored procedures etc. that this account should have access to on a particular database.
When I connect to the same server within Visual Studio (2008) with t...
How do I convert all varchar(max) columns to text type? I know varchar(max) is recommended but I still want to use type text because CakePHP doesn't automagically convert varchar(max) to textarea (HTML form). How do I do it? Thanks in advance
...
I have many .sql files with lots of empty lines e.g.
WITH
cteTotalSales (SalesPersonID, NetSales)
AS
(
SELECT SalesPersonID, ROUND(SUM(SubTotal), 2)
FROM Sales.SalesOrderHeader
WHERE SalesPersonID IS NOT NULL
GROUP BY SalesPersonID
)
SELECT
sp.FirstName + ' ' + sp.LastName AS FullName,
sp.City + ',...