sql-server

Can I install 2008 SQLExpress alongside 2005 SQLExpress?

Can I have an instance of 2005 SQLExpress and a 2008 SQLExpress server running on my machine? Both to be accessed using the 2008 management console. I currently have the express tools installed, but my office recently purchased a full 2008 license. Does this come with an improved console? And if so, can I just install these tools or ...

Does anyone have links to a simple sample web site using SubSonic?

Hi, I'm developing a new admin website to update several tables. There is no complicated logic involved (at the moment). The website will be built using VS 2008 C# (3.5 framework) and will have a SQL Server 2008 db. We've decided to look into using SubSonic and I've already set up the the basic scaffolds to input test data. Does a...

convert mysql stored procedure to mssql

Hi, I need to used dynamic order query in mysql and i have successfully achieved that through string concatenation in mysql as follows: set @stmt_text := concat('select * from abc order by ',sorder); prepare stmt_handle from @stmt_text; execute stmt_handle; deallocate prepare stmt_handle; i need a similar way to convert this in mss...

Drop Foreign Key without knowing the name of the constraint?

Hi All, I have created one table using below command: create table Table1( Id int Not Null Foreign key references Table2(Id) on delete cascade on update cascade, UserName nvarchar(150), TimeInSeconds int Not Null primary key(Id,TimeInSeconds) ); But now I want to drop the foreign ...

Help with finding the difference (delta) from a value returned from the last two records

Hi, I'm using MS SQL 2005 and I have created a CTE query to return values from the last two records. I then use this to find the delta of two figures returned. I have a working query of sorts but I'm having problems getting anything other than the delta figure. here is my query: ;with data as( SELECT NetObjectID, RawSt...

How to search a varchar field, using LINQ, to build a list of recommendations

I am trying to construct a LINQ query, with expression trees, to do the following: I have a field in my ItemCode table called Labels, an example of the data contained in this field is "lamps lighting chandelier". I want to allow the user to type in some text, i.e. "Red Lamp", and be able to search the Labels field, of the ItemCode, tab...

How to get over "Cannot fetch into text, ntext, and image variables." on SQL Server?

I'm getting this error message: Msg 16927, Level 16, State 1, Procedure GetWfGenProcessParameters, Line 21 Cannot fetch into text, ntext, and image variables. I realy need to make this cursor work with text data. Is there any way to get over this error? ...

Change table cells in sql but how?

i need Sql query Convert Table1 to Table2 select Count(Page) as VisitingCount,CONVERT(VARCHAR(5),Date, 108) as [Time] from scr_SecuristLog where Date between '2009-04-30' and '2009-05-02' and [user] in(select USERNAME from scr_CustomerAuthorities where customerID=Convert(varchar,4) and ID=Convert(varchar,43)...

Load points from SQL Server Multipoint data type into table

I'm kicking around the idea of using the new geometry datatype to represent a vector in the database. The multipoint geometry data type would work well for this, but my question is, is there a way to populate a two column table with the x,y values in a multipoint, where each point is a row in the table, and the X and Y point values go i...

Webtrends can't read Microsoft reporting services 2008 web log

With the change from IIS to their own web server in SSRS, we are now experiencing problems with using web trends to track our report utilization. Web trends said it was not supported, has anyone found a way to make it work? ...

Overriding SQL Server Reporting Service Hourly Subscription

Users want to set up SSRS reports to be emailed to them. After a little googling i found this link that shows the subscription interface of Report Manager. This has almost every feature they need except, the hourly report subscription does not give them enough control. By default, they are able to set up hourly reports, and provide the d...

Visual Studio Data Generation Plan Schema Update

I'm new to Data Generation Plans in Visual Studio, but I googled a bit and can't find the answer to this question. I've made modifications to my schema on the database side (changed the size of an NVARCHAR field) based on data that was generated by a Data Generation Plan (a procedure broke because the field was too large), and now I want...

Changing database collation doesnt update collation of varchar/text fields in the DB (MS SQL)

Hi, I changed the collation of the database. All of the text/varchar columns before the change were set to database default. When the change was made to the DB collation, I would have expected the columns that were set to database default to remain database default and therefore remain linked to the new DB collation. However, I noticed ...

Help with SQL Server query

Sorry* this is what I should have put My query is creating duplicate entries for any record that has more than 1 instance (regardless of date) <asp:SqlDataSource ID="EastMonthlyHealthDS" runat="server" ConnectionString="<%$ ConnectionStrings:SNA_TRTTestConnectionString %>" SelectCommand="SELECT [SNA_Parent_Accounts].[Company]...

Problem with Basic SQL Stuff

Hello.Im a beginner in SQL.I am having a problem with it. First of all I shd let u know I installed SQL 2005 Server n then made a ConsoleApp and rest of code is under : using System; using System.Collections.Generic; using System.Text; using System.Data.SqlClient; namespace ConsoleApplication1 { class Program { static v...

uncommittable transaction is detected at the end of batch. the transaction is rolled back

We are having problem with the server migration. We have one application that are having so much transactions It working fine on the one database server. But when transfer same database to another server. We are facing the following error. Server: Msg 3998, Level 16, State 1, Line 1 Uncommittable transaction is detected at the en...

What is the LDF file in SQL Server?

What is the LDF file in SQL Server? what is its purpose? can I safely delete it? or reduce its size because sometimes it's 10x larger than the database file mdf. ...

Adding and Naming TABS to excel reports in Microsoft Reporting Services

In Microsoft Reporting Services, I want to be able to name the tabs for the resulting document when a excel report is generated. Does anyone know how I can do this? ...

Microsoft SQL Server Statistics via ODBC

I have an instance of SQL Server that I am trying to benchmark. From the SQL Studio application I can type SET STATISTICS TIME ON and see outputted statistics after that. From C++ code, I can do something like SQLExecDirect(hstmt, "SET STATISTICS TIME ON", SQL_NTS); and then retrieve these statistics via SQLError. Is there a way t...

Getting Last Id from a Cross Server Insert using SQL Server

I am running a cross server insert INSERT INTO server.database.dbo.table (Field) VALUES('test') Afterward, I need to get the id of the last insert. However, when I run the the scope_identity function, I don't get the latest id from the foreign server. SELECT @ID=SCOPE_IDENTITY() How would I retrieve the last id from a cross server ...