There is a view in my DB that someone defined with a * from one table. I just added a new column to that table and I want the view to reflect the new column. Besides re-executing the view creation script, is there another way to rebuild the view? I am looking for something similar to how sp_recompile will recompile a stored procedure ...
Hi folks,
Server: MS Sql Server 2008
When i create an indexed view .. and i then alter the view's schema, the index's all get dropped.
It's sooo annoying!
Can someone explain why this is? At first I thought that it could be because the fields the index requires are not in the schema any more (we did just alter it, right?) .... but fo...
I have a table in SQL Server 2008 with a column having the string stored in JavaScript Escape format. When queried from application, I am doing the JavaScript UnEscape of the returned string, so no issues.
How do i UnEscape the string when I directly query the database? Is there any equivalent function for JavaScript UnEscape in SQL?
...
I have imported an existing SQL Server 2008 database to a Visual Studio 2008 database project, to version control database objects and perform database code migration. This works fine and I can build and deploy to dev, test, staging, live etc.
Now I want to add a new stored procedure (with a grant statement) to the existing database pro...
Hello all,
I am trying to make use of the PHP driver for MS SQL Server version 1.0.
I have everything setup but I think I am having trouble loading up the extension php_sqlsrv_ts.dll. I have gone to the command line and try this:
C:\wamp\bin\php\php5.3.0>php.exe --re sqlsrv
Exception: Extension sqlsrv does not exist
C:\wamp\bin\php\p...
I'm trying to compute a checksum or a hash for an entire table in SQL Server 2008. The problem I'm running into is that the table contains an XML column datatype, which cannot be used by checksum and has to be converted to nvarchar first. So I need to break it down into two problems:
calculate a checksum for a row, schema is unknown be...
One of databases I develop for is being upgraded to SQL 2008 (from SQL 2000).
The upgrade advisor is flagging an issue that I don't think is an issue. I was hoping that there is documentation that this is a known issue so that my DB team will just let it pass.
The error is saying that in SQL 2008 you cannot use a table alias and a col...
In sql server, we can issue sql to get data like
select * from table where column like '%myword%'
select * from person where Soundex(LastName) = Soundex('Ann')
what's the linq query to match above sql?
...
Does sql server cache the execution plan of functions?
...
I need to branch my T-SQL stored procedure (MS SQL 2008) control flow to a number of directions:
CREATE PROCEDURE [fooBar]
@inputParam INT
AS
BEGIN
IF @inputParam = 1
BEGIN
...
END
ELSE IF @inputParam = 3
BEGIN
...
END
ELSE IF @inputParam = 3
BEGIN
...
END
END
Is there any other ways? For example, in C...
I have a database table in SQL Server 2008 with 5 nvarchar(max) columns. We're using the CONTAINS function to look for text in these columns.
We can look in all five columns using this kind of query:
SELECT *
FROM SomeTable ST
WHERE CONTAINS( (ST.ColumnA, ST.ColumnB, ST.ColumnC, ST.ColumnD, ST.ColumnE) , '"Strawberry"')
Now we want ...
Hi, we have a huge table of companies (17 million entries) for which we want to find duplicates according to search critera (based on phone number). The query runs very slow (5 minutes+)
Here is a simplified version of the query, but the problem is the same :
SELECT C1.*
FROM dbo.Company AS C1 WITH(NOLOCK)
INNER JOIN dbo.Company AS C2 ...
I am able to create a simple JPA Java application from NetBeans using Apache Derby database. But when I try to do the same with SQL Server 2008, I keep getting the following error:
SEVERE: Application class sample.DBTestApp failed to launch
javax.persistence.PersistenceException: No Persistence provider for EntityManager named RS6910SQL...
Either the autocomplete in SQL Server Management Studio 2008 is buggy, or I am. Either way, when I try to type this and hit the spacebar:
SELECT TOP
Autocomplete immediately changes it to this (Topics is a table in one of our databases, btw):
SELECT Topics
Is there a way to fix, or at least gracefully work around this?
...
I've inherited a database with a surprisingly high number of unused sprocs. I've extracted the names of the used sprocs from the DLL that access it (all access is via that DLL), and from EXEC statements in those sprocs, and there are a couple hundred that are not called. Further, almost all have suspiciously verbose, uniform names: I sus...
I have an application that allows my users to make temporary changes to an ongoing booking. I have recenlty read about the new XML datatype in SQL server, and the corresponding SqlXml type.
I am thinking of using the new type to store the previous values of the object so that I can later revert to them.
Something like:
Booking Table:...
I have a database project (.dbp) open in Visual Studio 2008 as part of a solution. I've added a new sql script to the project. When I try to save the database project so that I can check it in, VS shows me a dialog:
Some Unicode characters in this file could not be saved. To save all the information in this file, use 'Save As'; and ...
We're in the process of switching from Windows Server 2003 to Windows Server 2008, and we've encountered a frustrating problem:
In the old environment, some developers used sql server 2005 and others used sql server 2008. No problems. Our connection strings all pointed to: localhost/sqlserver. Now, on the new Server 2008 environment, Sq...
Hello everyone,
I am using VSTS 2008 + .Net 3.5 + C# + SQL Server 2008 Enterprise on Windows Server 2003. I am using the following connection string, and labtest1 is the local machine name and I connect from local machine using ADO.Net. Then it always fail with connection error. But when I change in the connection string from "labtest1"...
Hi,
I'm working on a project which generate report every quarter. So there is a table supporting this:
Report:
ID(int)
Quarter(byte)
...
But later, the requirement changed and need the system to support more then one report in the quarter like this: 2-1, 3-2, ...
How can I support this requirement change?
Thanks in advance!
...