sql-server-management-stu

SQL Server Management Studio: Import quietly ignoring 99.9% of data

The Problem i'm trying to import data into a table using SQL Server Management Studio's Import Data task. It only brings in 26 rows, out of the original 49,325. (Edit: That's where 99.9% comes from: (1-26/49325)*100 = 99.9% Using DTS in Enterprise Manager correctly brings all 49,325 rows. Why is SSMS not importing all rows, reporting ...

SVN client for SQL Server Management Studio 2005

I have installed Tortoise SVN and AnkhSVN, but neither one shows up in my SQL Server Management Studio 2005 under the Source Code Control options. I know they work because all my Visual Studio projects are working fine. Do I have to do install a different SVN client to integrate to SQL Server Management Studio? ...

Script table as CREATE includes recent column additions as ALTERs?

I'm running SQL Server Management Studio 2008 against a SQL Server 2005 back-end. SSMS just exhibited a behavior I have never seen before. I don't know if this is something new in SSMS 2008 or just a function of something else. Basically, what happened in that I added some new columns to an existing table. After adding those columns,...

How to set unique key in SQL Server 2005 .?

How to set unique key constraint in SQL Server 2005? Not through script or query. ...

How to set more than one primary key for a table?

Is it possible set more than one primary key for a table? If it is possible as composite key - so how it can be used with application?? ADVANTAGES .? ...

Same name tables under different schemas with SQL Server 2005 Management Studio Express

I know how to create a new schema and write a DDL script to create tables with the same name that reside in different schemas in the same database. I want to know how to do that using SQL Server 2005 Management Studio Express. To repeat, I want to know if I can create two tables having the same name but residing in different schemas of ...

How can I check if an SQL result contains a newline character?

I stored (or think I stored) some text from a textbox that is effectively 'lol\ncats' In SQL management studio it comes up in the description has 'lol cats' How can I check if the \n is there or not? ...

SQL Server Management Studio - adding foreign key confusing?

I always find it confusing to add foreign keys to primary table in Management Studio. Lets say I have a Table1 { ID int, -- Primary Key Table2ID int, -- Refers to Table2's ID } Table2 { ID int, -- Primary Key SomeData nvarchar(50) } I am adding a foreign key to Table1 by Right Click -> Relationships -> Table and...

Update rows in a related table based on condition in parent table.

I have a table TABLE1 (PARENT TABLE) with columns StaffID (PK) Name CategoryID (FK) I also have another related table TABLE2 (RELATED TABLE) with columns LeaveID (PK) StaffId (FK) StartDate What i want to do is write a T-SQL query to update StartDate column of all rows in TABLE2 whose CategoryID in TABLE1 = '3' TABLE2 is rela...

Money Data Type Precision - SQL Server (SSMS)

In sql server management studio, data type- money, when I enter an amount with a decimal it automatically adds on zeros to fill up to the hundredths. How can I determine the amount of spaces after the decimal? ...

Regex for a serial number in T-SQL

I'm a novice at regexs and am currently trying to come up with a simple regex that searches for a serial number in the following format: 0217103200XX, where "XX" can each be a numeric digit. I'm using SQL Server Management Studio to pass the regex as a parameter in a stored procedure. I'm not sure if the syntax is any different from ot...

Where are all those SQL Server sessions from?

After launching SSMS (2008 R2) on my dev machine, which I launch with "D:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe" -nosplash -S localhost -d testdata without doing anything, in Activity Monitor I observe some sessions (TestData is my default database) Details of session 51: select @@...