sql-server-2008

SQL Server FTS: possible to get information how/why rows were matched?

Is it possible to get the information why/how given row returned by FTS query was matched (or which substring caused row to match)? For example, consider simpliest table with id and text columns, with FTS index on the later one. SELECT * FROM Example WHERE CONTAINS(text, 'FORMSOF(INFLECTIONAL, jump)'); This examplary query could retu...

How do i use SQL Server 2008? With Visual Studios?

Its a two part question. How do i use SQL Server 2008? With Visual Studios? I started up a dummy project and with server explorer i tried with create new sql server database and add connection using my computer name (it came from a dropdown) as the server location. When i tried to create the database 'TestDB1' i got an error. I dont und...

Sql server string comparison problem with chinese white-space

I have a record in my sql server database with the following value for a nvarchar column: '穂 坂' The second character is the Unicode value 0x20 which is a simple space character. There is a unique key constraint on that column. I get a unique key violation when I try to insert the following value: '穂 坂' In this string, the second charac...

Database design - How can I have a foreign key of the primary key in the same table?

My database has to store all the available departments in my company. Some departments are sub-departments on another existing department. I've decided to solve this like this: Departments ID Description HeadOfDepartment ParentDepartment ParentDepartment can be null, indicating it is a root department. If it has a parent I'll act acc...

install SSMSE 2008 after VS 2010

hi guys i have installed VS 2010 ultimate on windows 7 machine which by default install sql server 2008. now i want to install SSMSE 2008 i download the following file SQLEXPRWT_x86_ENU and tried to install it but it give me error. [Window Title] Program Compatibility Assistant [Main Instruction] This program has known compatibility...

Guidelines for using Merge task in SSIS

I have a table with three fields, one an identity field, and I need to add some new records from a source that has the other two fields. I'm using SSIS, and I think I should use the merge tool, because one of the sources is not in the local database. But, I'm confused by the merge tool and the proper process. I have my one source (an ...

SQLInForm.com like plug-in for SQL Server 2008

Is there a plug-in like the java applet @ SQLinForm.com for MS SQL Server Management Studio 2008? I tried SSMS tools based on someone's answer to my previous question but I don't find any functionality to format (beautify/tabify) SQL. If somebody could please point out that in SSMS tools or suggest some other tool (preferably free) T...

How can i test my TSQL syntax?

Quick question: How do I get some kind of database to use to test my SQL syntax and create basic data. I have Sqlite Code which I'll soon put on a server. I have SQL Server 2008 installed with visual studio 2010. I tried connecting to the database and had no luck. I also tried using an .mdf file instead thinking it's a file and I won...

Why cant i use the field user in SQL Server 8?

Maybe not literally but the query below gets an error near user. If i change it to userZ it works. WHY can i not use that name? Is there a way to specific its a field instead of a keyword? (or whatever it is) create table Post2 ( id INTEGER PRIMARY KEY NOT NULL, title nvarchar(max) NOT NULL, body nvarchar(max) NOT NULL, user integer R...

Storing HTML formatted text in database

I am building a web site similar to Craigslist. I would like to know how to store the html formatted text (bold / italics / font size etc) in a sql 2008 database? In order words, the user would enter their text, format it with font size, bold etc and save the information. Whats the most efficient way to store that in a database? ...

Every 3rd Insert Is Slow On Ms Sql 2008

I have a function that writes 3 lines into a empty table like so: INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (1, 8, 1) INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (2, 8, 4) INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (3, 8, 3) For ...

SQL Server 2008 vs 2005 udf xml perfomance problem.

Ok we have a simple udf that takes a XML integer list and returns a table: CREATE FUNCTION [dbo].[udfParseXmlListOfInt] ( @ItemListXml XML (dbo.xsdListOfInteger) ) RETURNS TABLE AS RETURN ( --- parses the XML and returns it as an int table --- SELECT ListItems.ID.value('.','INT') AS KeyValue FROM @ItemListXml.nodes('//...

SSIS - How do I use a resultset as input in a SQL task and get data types right?

I am trying to merge records from an Oracle database table to my local SQL table. I have a variable for the package that is an Object, called OWell. I have a data flow task that gets the Oracle data as a SQL statment (select well_id, well_name from OWell order by Well_ID), and then a conversion task to convert well_id from a DT_STR o...

Multi Pivoting on single Source data

I am trying to mutlipivot source data (as below ) want results as single row (as below) My query so far is SELECT * FROM ( SELECT * FROM ( SELECT NK, DC, VERSION, GEV FROM MULTIPIVOT ) S...

is of a type that is invalid for use as a key column in an index.

I have an error at Column 'key' in table 'misc_info' is of a type that is invalid for use as a key column in an index. where key is a nvarchar(max). A quick google found this. It however doesnt explain what a solution is. How do i create something like Dictionary where the key and value are both strings and obviously the key must be ...

How to save multiple column in database

I have a text file.I need to get data from this text file and show on grid , 1)After this user can update information from gridview, 2)Click on save button save data on database. Before clicking on button data don't save on database.How to do that? ...

Performance using T-SQL PIVOT vs SSIS PIVOT Transformation Component.

Hi I am in process of building Dimension from EDW (source), wherein I need to pivot columns of source to load Dimension. Currently most of the pivoting stuff am doing is by using T-SQL PIVOT which further get used in my SSIS package to merge with Dim table This pivoting can also be achieved by SSIS PIVOT Transformation component. In ...

weekly Automatic running sql server script

I have sql server script and i want to automatic run it on the database every week. any help. i tried sql server agent job but i have alot of data bases on my server and i should make step to every database and it will run in the same day and same time. ...

Sum and average over null values SQL Server 2008 Analysis Services

I have a simple problem, I think, but I have googled and can't find the solution. I have a cube that has MeasureA, MeasureB and MeasureC. Not all three measures have values for each record, sometimes they can be null, it's depending if it was applicable. Now for my totals, I need to average but the average must not take nulls into acc...

Keeping SQL Server Dev Environment up to date

Hi All, I'm trying to figure out the best way to keep my Development servers synced up to the Production servers. Initially, I was just going to restore the backups from the production environment to the dev environment every week or so, however I realized that this would wipe out any actual development work that had taken place during ...