sql

Vim SQLComplete OMNI completion in Windows

I've recently started using VIM (7.2) in Windows and have been trying to use the OMNI completion feature when editing SQL. When at the start of a new line it appears to work fine. For example, if I am in insert mode and type: se <C-C>a then the word 'select' appears. If I then try and use OMNI completion on any other word on the sam...

Convincing an IT Manager to allow SQL Server instead of Access

An IT Manager is not allowing the use of SQL Server with an ASP.NET website being developed. The current setup being replaced is a php site connecting to a Microsoft Access database. I have a few reasons of my own as to why SQL should be used, but would like as many strong arguments as possible (student vs. IT Man.). Does anyone have a...

C# Using LIKE to see if X contains Y

Hi All, I've inherited the code below but I'm puzzled as the code works just fine but I'm not convinced it's correct. I've not used LIKE before so I can't decide if I should bother changing this. How does this look to you? The code is for a filter in a db it checks if X value contains Y value, find X* in X (e.g. Match would be F* in Fu...

MySQL: Finding rows that don't take part in a relationship

I have two tables: 'movies' and 'users'. There's an n:m relationship between those, describing what movies a user has seen. This is described with a table 'seen' Now i want to find out for a given user, all the movies he has not seen. My current solution is like this: SELECT * FROM movies WHERE movies.id NOT IN ( SELECT seen.movie...

From a Query Window, can a Stored Procedure be opened into another Query Window?

Is there command inside a Query Window that will open a stored procedure in another Query Window? i.e. MODIFY dbo.pCreateGarnishmentForEmployee I am using SQL Server management Studio 2005 and Red Gate's SQL Prompt. Currently I have to do the follwowing multiple steps: Open Object Explorer Navigate Programmability | Stored Procedure ...

Ways to Search for a Pattern in all Stored Procedures and then Open it to be Altered

How can you search all the Stored Procedures for a Pattern and then open the stored procedures to be edited? Is there anything built inside of SQL Server 2005? Or are there any 3rd party addins that will do this searching? I am also using Red Gate's SQL Prompt but I have not noticed that option. Currently I am using the following co...

Best Schema to Persist User Generated Functions?

My project requires users to create some basic math functions, I need to store these in a ms sql databse to use on datasets in my business logic. The functions will be similar to: when (value1 between 20 and 40) then value2 = value 2 * 37.8 What is the best schema to store something like this ? And what is the most efficient way...

Writing a query ordered by the number of associations between objects

It's time to implement sorting on my blog-like web application. In addition to browsing by creation date, I want users to be able to sort by the number of replies, too. Given that I have two tables blog_posts and replies, and that replies has a field called blog_post_id (a foreign key for the blog_post it's a reply to), how do I write ...

T-SQL Pattern matching

I am trying to find a way to query rows of data by using a "multivalue" pipe delimited column in another table as a WHERE clause. SQL SERVER 2005 This is my best description of the problem: Imagine a pipe delimited column set to a variable like @LIST = 'Bob|Mary|Joe' then I am trying to find a match like this Select * from Users...

How to Split Sql Int Value into Multiple Rows

Lets say I have the following table in MS SQL 2000 Id | description | quantity | ------------------------------- 1 my desc 3 2 desc 2 2 I need to display multiple rows based on the quantity, so I need the following output: Id | description | quantity | ----------------------------- 1 my desc 1 1 ...

Mistaken mass deletes and updates -- design error?

Why didn't the designers of SQL require a keyword (e.g. "All") for any Update or Delete statements that don't have a Where clause? Was it just an oversight on their part? They would have saved so much grief (not to mention jobs!) if they had done that! ...

can any one please tell me how the flow of records took place in this query in accordace with the output generated.

SQL> select * from employee; ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION ---- ---------- ---------- --------- --------- ---------- ---------- --------------- 03 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer 03 Alison Mathews 21-MAR-76 21-FEB-86 13323.56 Vanco...

Programming fundas

Would some one suggest me the best method to start learning the fundas of programming. I would be involved in SQL and SAS related technologies involving databases. Please advice ...

How can I do search efficiently data in Database except using fullsearch

I want to search a sentence (word combination of) in some table or view of DB. I dont want to use Fultext search property of DB. Is there any alternative efficient way? ...

MSSQL Service broker activation "Execute as SELF"

I have a service broker activated stored procdedure that runs fine when executed in management studio. However, when it is activated on the queue, the sql server error log shows the following message: "The activated proc [dbo].[FileUploadAsyncWorker] running on queue AsyncProcessing.dbo.FileUploadRequestQueue output the following: 'You...

Is it possible to restore Sql Server 2008 backup in sql server 2005

Is it possible to restore a backup of a SQL Server 2008 database onto an instance of SQL Server 2005? I need to work on an sample application for which database backup is in sql server 2008. But I'll not be able to install 2008. So is it possible to restore that back up in 2005? ...

How to disable word stemming in SQL Server Full Text Search?

I need to do a Full Text Search with NO word stemming...I tried to wrap the term I'm searching in double quotes, but no joy... I still get results like "bologna" when I search for '"bolognalo"' Any help is appreciated.. ...

TSQL command to connect to another server (SQL Server 2005)

Is ther a TSQL command to connect to another server? Or when you are in a Query Window, what are the Keyboard shortcuts to connect to another server and have a Query Window show up? I have seen Ctrl+N pop up the Connect to Server dialog in some screens but when I am in a Query Window already and hit Ctrl+N it just opens up another Quer...

Advise regarding static data in an application and testing

I am working on a pretty typical asp.net web site and using sql server 2005 as database. I have created a Model dll holding the applications typical business logic. The application is dependent of some static data which is stored in the db in lack of a better persistent storage, but since the application is dependent of this data in ord...

How can I convert text with a localized number format into a number in MS SQL Server?

Let's say I have a number in the german number format "1,00" which is equal to 1.0 in the en-US locale. Is there a built-in way to convert this text in T-SQL to the corresponding number? It seems like CONVERT and CAST accept only numbers with '.' as the decimal separator and I see no way to tell them otherwise. I was thinking about sim...