sql-server

Return CLR SQL Server UDT from SQL Server to client app?

Can this be done? Or are all CLR UDTs in SQL Server just utilized in SQL Server? ...

SQL Server Cursor Reference (Syntax, etc)

I don't use SQL Server Cursors often but when I do, I always have to look up the syntax and options. So I wanted to ask, what is the best SQL Server Cursor reference on the web?. I'm looking for a reference that explains all of the (major?) options (I.E. FAST_FORWARD) and also shows quick snippets of how to use it. (I.E. How to impl...

SQL Query help -- update many records from 1 record in same table

We've got a table of places. The same place may occur multiple times in our table (bad design, not our choice). We had someone go through and find addresses for each of these places. They only updated one of the many instances of each place. Here is a query that does NOT work, but I think shows what I am trying to do. update places ...

How to automatically store data from Oracle in SQL Server (according to a schedule)

Hello, I'm new here, so sorry, if my question is too basic. However, maybe you have some advice, example, links, which could help me... I'm trying to find something helpfull for few days, but no results as for now. I'm working in a distributed environment. I have a Oracle server hundreds of miles away and a MS SQL server close to me. I'...

How to tell who is in SQL Server

I am designing an application and I'm looking for the best way to tell who is currently logged into SQL server. I will use the Activity Monitor built into SSMS, which shows a list of all processes accessing the server - very cool. However, if in my .NET code it uses a separate connection each time I access the database then how will I b...

SQL Server Management Studio - using multiple filters in table list?

In Management Studio, you can right click on the tables group to create a filter for the table list. Has anyone figured out a way to include multiple tables in the filter? For example, I'd like all tables with "br_*" and "tbl_*" to show up. Anyone know how to do this? Thanks ...

SQL Server Index on VarChar(50) - Is this fulltext? Or what?

What exactly happens when I create an index in my SQL Server 2008 DB on a VarChar column. This is obviously a text column. Will it be automatically fulltext indexed or does it create a different kind of index? ...

SQL Injection

Possible Duplicates: What is the best way to avoid SQL injection attacks? XKCD sql injection - please explain SQL injection on INSERT What is SQL injection? I have been reading about SQL injection, but I am not able to understand it. Can anyone tell me the real issues about SQL injection? ...

SQL Server 2000/2005 - Maintaining Development Version and Production Version

I am used to using Oracle Designer by creating database object definitions, then creating DDL SQL required by connecting to a database instance. For eaxmple, when adding a new column to a table, first I add it to the table definition, then generate the DDL SQL against the development version and run it, then after testing I point to the...

Which files from a VSTS Database Edition GDR R2 project should be excluded from source control?

I'm getting ready to setup a Visual Studio Database Edition GDR R2 project with source control. Which files (if any), should be excluded from source control? ...

XML question in SQL Server

In one of my sql scripts, I need to execute a stored procedure with the following xml string <Collection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <Field> <Attributes> <Attribute Name="CODE1" IsRequired="true" Order="1" IsVisible="true"/> <Attribute Name="...

SQL Server 2000 Deadlock

We are experiencing some very annoying deadlock situations in a production SQL Server 2000 database. The main setup is the following: SQL Server 2000 Enterprise Edition. Server is coded in C++ using ATL OLE Database. All database objects are being accessed trough stored procedures. All UPDATE/INSERT stored procedures wrap their intern...

Is there a way to select a database from a variable?

Is there a way to select a database from a variable? Declare @bob as varchar(50); Set @bob = 'SweetDB'; GO USE @bob ...

Is there a way to persist a variable across a go?

Is there a way to persist a variable across a go? Declare @bob as varchar(50); Set @bob = 'SweetDB'; GO USE @bob --- see note below GO INSERT INTO @bob.[dbo].[ProjectVersion] ([DB_Name], [Script]) VALUES (@bob,'1.2') See this SO question for the 'USE @bob' line. ...

Data mining with SQL Server, how should I begin?

I have to study about data mining with SQL Server, but I don't know how to begin. Can you suggest me some books written in this subject? some sources of knowledge studied in it? Thank you in advance. ...

Noise Words in Sql Server 2005 Full Text Search

I am attempting to use a full text search over a series of names in my database. This is my first attempt at using full text search. Currently I take the search string entered and put a NEAR condition between each term (i.e. entered phrase of "Kings of Leon" becomes "Kings NEAR of NEAR Leon"). Unfortunately I have discovered that this t...

How to display user databases only in sqlserver?

Hi how to display user databases in sqlserver i queried as select sys.databases it displays all including msdb temp and all. i need only user cretaed databases. is there any query like : select * from sys.databases where type='u' ?? Help me. Thanks in Advance ...

Error using Merge Replication to SQL Compact 3.5

We are getting the following error when syncing with sql server (2005 SP3): Initializing SQL Server Reconciler has failed. Try again.; The merge process could not connect to the message file from Subscriber '{F238C7BC-E13B-40E4-99F2-F11A203BD65A}:W:\http_content\Secure\SECURE_PROD\data_merge\30.18F5D9B4BCC7_B1415013-9FB7-424A-AB45-643A0...

Using TSQL, can I increment a CHAR(1) column by one and use it in a LEFT OUTER JOIN without a CASE statement?

This question is similar to my last question. Except this time I'm using letters rather than 6 digit integers. I want to find the out of sequence "letters". Let's say I have the following data: id | Date | Letter ----------------------------- 01 | 5/1/2009 | X 02 | 5/1/2009 | Y 03 | 5/1/2009 | Z 04 | 5/1/2009 | A 05 | 5/1/2009 | B 06 ...

database design asking for advice

Hello everyone, I need to store entries of the schema like (ID:int, description:varchar, updatetime:DateTime). ID is unique primary key. The usage scenario is, I will frequently insert new entries, frequently query entries by ID and less frequently remove expired entries (by updatetime field, using another SQL Job run daily to avoid dat...