sql-server-2008

Adding an index / Full Text Search on some partial data for a Sql 2008 table field?

Hi folks, i have a field that contains guid's. They represent a user's PunkBuster GUID. Is it possible to create an index, on this field, which only index's the last 8 characters of the guid? The reason i'm asking is that you cannot to a full text search like => '*abcdef'. (at least I believe I read that somewhere ... was it Pro Full-...

Does VS2008 require SQL Sever 2005? Can I use SQL Server 2008 instead?

I've noticed that Visual Studio installs SQL Server 2005 Express. However, I've installed SQL Server 2008 and plan on it being the primary db I work with. Is it possible to work with VS2008 without having SQl Server 2005? ...

database partiton Function (sql server 2008)

HI, I want to write partiton in sql server 2008 for my fleet management system. I want to write a partition function such that --values (vehicle number) like for example mh-30-q-126,mh-30-a-126,mh-12-fc-126 should be moved to respective partiton, depending upon middle values like ,q,a,fc respectively My trial function:- CREATE PA...

Does XML AUTO support what I am trying to do?

Hi At present we have a denormalised database. ie Name|NameID|EmployeeID|EmployeeType I'm normalising the database to resolve the EmployeeID from the Employee table rather than the Name Table. So we have a select at the moment SELECT Name, NameID, EmployeeID, EmployeeType FROM Name FOR XML AUTO Which will output: <Name Name...

What is wrong in sql2k8 cluster ?? SMO is failing to get Network instances in cluster Machine...??

Hi I have created SQL Server 2008 cluster(TestMachine1-->Name of Computer).and i have written a c# program to retrieve all the n/w instances in the lan. When i run the exe from TestMachine1(where SQLCluster is installed ) i am not getting the instances.when i Debug i am getting Null to the data table rows. the same exe when i run from...

How to get the attribute value with XQuery in MS SQL Server 2008

I have an XML like this: <EXP> <TITLES> <SUBTITLE CL="AXT4" FL="1" NB="Text 1"/> </TITLES> <TITLES> <SUBTITLE CL="BVT6" FL="2" NB="Text 2"/> </TITLES> <TITLES> <SUBTITLE CL="PLO7" FL="3" NB="Text 3"/> </TITLES> </EXP> Using XQuery in SQL Server 2008, How can I select Just the value of the attribute NB in a list...

Best SQL Server isolation level for web application?

We have a website using ASP.NET MVC and SQL Server 2008 and we are using the default transactionscope isolation level which is Serializable. But it makes the application unusable if any transaction is opened as we have a table that being used by almost everything and it runs like select * from table1 where id = 1 So I think it locks ...

SQL Server XML (multi-namespace) Parsing question

I'm trying to use SQL Server Integration Services (SSIS) to parse an XML file and map the elements to database columns across several tables in a single database. However, when I use the Data Flow Task->XML Source to try and parse an example XML file (that file is located here, XSD is located here), it says "http://www.exchangenetwork...

Denormalizing Data (Maybe A Pivot?)

I have a simple table containing Student Numbers and corresponding Teacher Numbers, and I need to denormalize it for input to a legacy system. For example, here's what the data looks like now: StudNumber TeacherNumber 445 57315 445 88584 445 95842 858 88115 858 65443 858 57315 858 211...

Replace Default Null Values Returned From Left Outer Join

I have a Microsoft SQL Server 2008 query that returns data from three tables using a left outer join. Many times, there is no data in the second and third tables and so I get a null which I think is the default for left outer join. Is there a way to replace the default values in the select statement? I have a workaround in that I can ...

TSQL - How to return 2 values with one case statement?

Is there a way to use one CASE statement and return 2 different values? Following query has 2 CASE statements with same conditions. select case when DA.value = 1 then da.Good else da.Bad end as Foo, case when DA.value = 1 then ot.Good else ot.Bad end as Bar, from someTable DA (nolock) join otherTable OT (nolock) on OT... wh...

How do I know if record from an SQL database is being used elsewhere?

Is there a way to know that a record is being used by another record in the database? Using deleting as an example: When I create an SQL statement trying to delete a group in dbo.group I get this error: The DELETE statement conflicted with the REFERENCE constraint "FK_MyTable". The conflict occurred in database "MyDB", table "dbo.U...

SQL 2008 Management Studio-- where to find table relationships?

I'm brand new to SQL Server 2008, and have some newbie questions about the diagram pane. I just dragged two tables onto it to do an inner join, and the console "knew" to create a one-to-many relationship between them. Where is this information kept in the Management Studio for me to look at closer? Thanks! ...

SQL Table Design - Identity Columns

SQL Server 2008 Database Question. I have 2 tables, for arguments sake called Customers and Users where a single Customer can have 1 to n Users. The Customers table generates a CustomerId which is a seeded identity with a +1 increment on it. What I'm after in the Users table is a compound key comprising the CustomerId and a sequence nu...

SQL Server: How to extract comments from stored procedures for deployment

We have lots of stored procedures which all contain a lot of comments. Is there a way to extract the comments from the stored procedures for deployment so the users can't see them when they modify a stored procedure with SQL Server Management Studio? Note: We're using SQL Server 2008. ...

Can 2 update or insert triggers be created on the same table in SQL Server 2008?

Can 2 update or insert triggers be created on the same table in SQL Server 2008? ...

SQL Server 2008 Stored Proc suddenly returns -1

I use the following stored procedure from my SQL Server 2008 database to return a value to my C#-Program ALTER PROCEDURE [dbo].[getArticleBelongsToCatsCount] @id int AS BEGIN SET NOCOUNT ON; DECLARE @result int; set @result = (SELECT COUNT(*) FROM art_in_cat WHERE child_id = @id); return @result; END I use a SQLCommand-...

Replication - Issues with turning on SQL Agent on Local Machine

Hello, I want to learn more about replication and want to turn it on for my local copy of SQL2008. I watched one video that said I can create a publication on my local machine and then replicate to a different database on the same machine. Their example works and I want to try it. Is there anything I should be concerned about regardi...

Performance in tables with binary data/images

I made a people maintenance screen. The client want me to store the photo of every person in the database, and I made it without problems. I have a separate table for the images with two fields, Id_person,and Image. I'm a little worried because it's the first time that i work with images in database. will I have problems of performance ...

Single or multiple databases

SQL Server 2008 database design problem. I'm defining the architecture for a service where site users would manage a large volume of data on multiple websites that they own (100MB average, 1GB maximum per site). I am considering whether to split the databases up such that the core site management tables (users, payments, contact detail...