sql-server

Is there any way to extend the editor in SSMS?

Can the SQL Server Management Studio text editor be extended? If it's possible, what kind of work & tools are involved? I find myself frequently jumping to other editors for certain kinds of text manipulation, and then jumping back to SSMS. If it were possible to extend the SSMS editor, I might do so. The first feature I would add wou...

Computed Column cannot be Persisted

I have function which I am using in one of the SQL Job (see function below). I am trying to created a persisted column on this function based on existing column on the same table. It is giving me following error. Computed column 'FormattedSSN' in table 'SomeTable' cannot be persisted because the column is non-deterministic. ...

TSQL Cascade delete for child records?

I have a parent/child table (simple tree) table structure (ID, ParentID), where I want to delete (and get the ID of) all children for a given parent ID - similar to this post http://stackoverflow.com/questions/1433808/sql-server-cascade-delete-and-parent-child-table . During the loop, where I've got the current ID, I will also be perfor...

Parameterizing Dynamic SQL issue with SQL_VARIANT datatype.

I've been refactoring a huge dynamic SQL statement, and think I may have hit a roadblock. The goal has been to parameterize it. I'm using SQL Server 2005. I have an int variable (@i) that determines what column I need to update. Here's what I've been doing: if @i = 1 begin set @updateClause = 'Column1 = @newValue'; set @updateClau...

Index and Insert Operations

I have one job with around 100K records to process. This job truncates the destination tables, and then insert all the records "one at a time", not a batch insert, in these tables. I need to know how indexes will take affect as these records are inserted? Whether cost of creating index during the job will be more than benefit from using...

Asynchronous processing in SQL Server vs. .NET Asynchronous processing

What's is the advantage of using Asynchronous processing in SQL Server over .NET Asynchronous processing? Aren't they the same? I have a hard time to understand what is the benefit of using Asynchronous processing in SQL Server instead of .NET APM. I can easily wrap a SQL call in a lambda expression and do a BeginInvoke(...). Can someon...

sql joins and getting used to them

Hi, I had a big interview that I screwed up when the interviewer asked me to join three tables. I can verbally describe the different types of joins, but I froze up. I'm looking for something that gets me used to these types of problems so I can anticipate how to solve them. Anybody have any SQL excercises they could possibly recommen...

How to get the list of java processes along with their PID(process id) that are running on UAT server under a specfic account?

Problem: A jar file was failed to deploy on a UAT server. Reason: Because when we are trying to rename it,it is showing "cannot rename the file it is been used by another user". step choosen in order to solve the problem log on UAT server(xxx). we need the list of java processes along with the PID on our UAT server which is r...

What is Knowledge Discovery and Data Mining?

I suppose SQL queries fetch "raw data"... Is there any good point to start regarding data mining in SQL server? Are there any available KDD ready-to-go, algorithms in MS-SQL server 2005, 2008? ...

Is this way of using Excel 2007 Pivot table for BI scalable ?

Hi all, Background: We need to consolidate sales data across the country to do analysis Our Internet connection/IT expertise/IT investment is not quite strong, therefore full BI solution is out of question I tried several SaaS BI solution (GoodData, ZohoReports) and while they're good, they seem not to fully support what we need We'r...

How to ALTER the Table Value Parameter

i am not getting option like 'ALTER To' when am right clicking on TVP ...

how to select n rows

i have a database about several companies which include their name, price of share, %age change: NAME PRICE % CHANGE ------------------------------------------------- a 67 11 b 23 6 c 456 5.89 d 112 ...

Remove and split data into multiple columns in select statement.

I have data like following table I want to remove Titles ( Mr. Miss, Dr etc) from name and want to split data into First name and last name if two names exists. I want this in select statement. I can remove title using CASE statement but unable to split name into tow in same case statement. I want data like this but in select statem...

Getting the Whole Time

How can I get the whole time like this datediff(time, logindate, logoutdate) I know this built-in function doesn't accept time argument but how can I get the whole time rather than minute, millisecond, second etc. ? logindate datetime2 logoutdate datetime2 I want something like 1:05:45 rather than portion of it. ...

What is the Equivalent syntax of mysql " LIMIT " clause in SQL Server

What is the Equivalent syntax of MySQL " LIMIT " clause in SQL Server . I would like to use it for doing paging of my results. (want to show records5 to 10 ) ...

What's the best method to do paging in my ASP page

What's the best method to do paging in my ASP page when displaying a list of items? I knew that there is no equivalent to MySQL's LIMIT clause present in SQL Server, either 2000 or 2005. How can I retrieve some particular records (Records 20 to 30) from the DB? Do i need to fetch all the records from the database and do something in...

aspnet_regsql - Creating the Application Services Database for mysql or postgresql database

Hello, I know that it is possible (and straightforward) to create an application services database using a SQL Server database. However, I would like to use another database technology such as MySQL or PostgreSQL for my authenticaton/role management. I was wondering if there is a similar command to do so for non-mssql databases or if the...

Need help with web application settings

Hi all expert, Pls give me the solutions for this two problem, which i was asked recently in interview. Prob1: Suppose I have application with 10 admin, so they can change the data anytime their having own userid and password. For example, one user retrieve one data from database table, while retrieving it value was 2, after retrievin...

SQL Server 2008 DB recovery: does it actually work?

Today I have rebooted my Win2008 Server with SQL Server 2008 running on it. After rebooting SQL Server marked my database as "In recovery", so I can't use this database until recovering finished. The question is - how much dose it takes to finish recovery process and does it actually do the recovery (or SQL Server just lock my db and not...

How to get a set of rows from an array of id's ?

In C#, I have an array of integers, that represent the primary keys of rows in a Table in SQL Server. I need to select all these rows from SQL Server by executing a single Select command - preferably through a stored procedure. There may be from a few to hundreds of ID's in the array, and the solution needs to work on SQL Server 2005 an...