sql-server-2008

Efficient Way To Query Nested Data

I have need to select a number of 'master' rows from a table, also returning for each result a number of detail rows from another table. What is a good way of achieving this without multiple queries (one for the master rows and one per result to get the detail rows). For example, with a database structure like below: MasterTable: -...

Sql 2008 exceptionally slow in Vista 64

Our database server is a SQL 2008 server. My colleagues all have XP service 2 installed with Sql 2008 Management studio and they have absolutely no performance issues. I however am running Vista x64 (Ultimate) and when I open the 2008 Management studio it's impossibly slow. It takes almost 25 seconds to just connect to the database, so...

Using Variables in SQL 2008 to return more than one record

I'm pretty sure this is not the right way to do this so I'm looking for some suggestions. I don't think my problem so much is that I'm trying to solve a spatial problem. I'm just not sure of a good way to take the latitude and longitude and return a geography data type in a select statement. I have successfully created a geography col...

Why has my App_Data/ASPNETDB.MDF file grown to 10MB?

I created a protected folder on my ASP.NET site with the "ASP.NET Configuration" tool. It made a database called App_Data/ASPNETDB.MDF where it stores one (1) user. While uploading I noticed now that the database has grown to 10 MB and the .ldf file is 5 MB. (!) I tried to look at it with SQL Server 2008 Management Studio but when attac...

Mapping SQL 2008 datetimeoffset using nhibernate

Is there any supported way of mapping datetimeoffset the new datatype in SQL 2008 to the System.DateTimeOffset using nhibernate? ...

What is the limitation in the length of an SqlCommand query

Is there a limitation in the length of a query that SQL Server can handle? I have a normal SqlCommand object and pass a very long select statement as a string. The query seems to be fine when running against an SQL Server 2005/2008 engine but doesn't execute against an SQL Server 2000 engine. I don't have any error details as I only...

How do I customise the CREATE DATABASE statement in VSTS DB Edition Deploy?

Hi, I'm using VSTS Database Edition GDR Version 9.1.31024.02 I've got a project where we will be creating multiple databases with identical schema, on the fly, as customers are added to the system. It's one DB per customer. I thought I should be able to use the deploy script to do this. Unfortunately I always get the full filenames spec...

sql server 2008 table valued parameters linq2sql

Has anybody experimented with these. Is this supported? ...

SQL Server 2008 - Editing Tables: Bit columns require 'True' or 'False'

Not so much a question as an observation... I'm just upgrading to SQL Server 2008 on my development machine in anticipation of upgrading my live applications. I didn't anticipate any problems since [I think] I generally use standard T-SQL, and probably not too far from ANSI standard SQL. So far so good, but I was really thrown by a very...

How do I map (local) to a non-standard named SQL Server?

I installed SQL Server 2008 (SQL Server 2005 was already installed) on my XP box and name the local instance of the database so that it wouldn't clash with SQL Server 2005. Now I want to change the mapping of (local) from SQL Server 2005 to my non-standard named SQL Server 2008 instance. Anybody know how to do this? ...

Schema changes not updating in Intellisense in SQL 2008 (SSMS)

I've notice an issue - it feels like a bug but I suspect a 'feature' - in SSMS in SQL Server 2008. I have various tabs open, for example an alter table script in one table and a SProc that queries that table in another tab, and when I execute my Alter Table script the changes are not reflected in Intellisense in the other tab. I can cr...

Is it possible to export spatial data from Sql Server 2008 in gml2 format?

Sql Server 2008 supports spatial data with new geometry and geography UDT's. They both support AsGml() method to serialize data in gml format. However they serialize data into GML3 format. Is there any way to tell it to serialize data into GML2 format? ...

How do I use sqlmetal to generate an internal (not public) data context

I'd like to use sqlmetal to generate dbml data contexts for my project, but the data context and all classes created are marked as public. As this is supposed to be an API layer I'd like to instead mark many of these classes or at least the context itself as internal. Is there a way to do this in sqlmetal or some other tool without havin...

Where did Open Table go in SQL Server 2008?

As of SQL Server 2005, you used to be able to open a flat file in SQL Management Studio off the right click menu for any database table. Once opened, you could add or update records right there in the grid. Now that SQL Server 2008 is out, Microsoft has hidden that feature, at least from the right-click menu. Where did it go? ...

How to connect to local instance of SQL Server 2008 Express

I just installed SQL Server 2008 Express on my Vista SP1 machine. I previously had 2005 on here and used it just fine with the old SQL Server Management Studio Express. I was able to connect with no problems to my PC-NAME\SQLEXPRESS instance (no, PC-NAME is not my computer name ;-). I uninstalled 2005 and SQL Server Management Studio Ex...

Tips Required Where to store SSIS Data

I have a slow custom data source in a SSIS Dataa Flow Task.I have to run the package with multiple parameters If I want to upload data to a DB using SQL Data Destination(Bulk Insert) the connection times out If I write the data to a flat file I cannot run multiple instances of the package, since they will write to the same file. Can I ...

Please critique the design

I want to gather data from different data servers located in Europe and Asia. Rather than running a plain data query task that will clog up the undersea network I am thinking of a couple of machines that will be available for me at the local sites. I am thinking to design the master package so that I can: run remote setup tasks launch...

Do i need a special database constraint on this table?

Hi folks, i've got a commenting system in our database. Just like stackoverflow -> each post has a list of comments. kewl. Anonymous people can add a comment or registered users also. In my table, i'm thinking of having the following: Userid int NULLABLE AnonymousNickname varchar(100) NULLABLE AnonymousEmail varchar(200) NULLABLE ...

How to open Sql2008 Table

I want To open Table By Sql 2008 Enterprise Manger Interface as in Sql2005 Enterprise Manger Interface by Right Click Then Click open Table ...

Geometry column: STGeomFromText and SRID (what is an SRID?)

I'm playing with the new geography column in SQL Server 2008 and the STGeomFromText function. Here is my code (works with AdventureWorks2008) DECLARE @region geography; set @region = geography::STGeomFromText('POLYGON(( -80.0 50.0, -90.0 50.0, -90.0 25.0, -80.0 25.0, -80.0 50.0))', 4326); SELECT @region; My question is...