sql-server

Liferay on SQL Server suggestions

Hi, does anyone has any experience of installing Liferay using SQL Server as database ? Any particular problem with installation or performance ? Which version can I use? Maybe I have to use a legacy instance SQL Server 2000 Thanks ...

What would be the ideal way to do paging using a Infragistics WebDataGrid and SQL Server 2008

We have an application that is growing in users and the infragistics WebDataGrid and stored procedure are having performance issues. I'm looking into adding the ROW_NUMBER() function in the stored procedure, but I'm concerned with sorting. It looks like I would need to do change the procedure to have a dynamic order by case statement i...

What does this UN mean?

I wanted to do an insert into with a union, and someone suggested this: SELECT x INTO ##temp FROM (SELECT x FROM y UNION ALL SELECT x FROM z) UN It works, but what is the UN? Unfortunately, Googling for "t-sql un" isn't very helpful :p Note: I found out that you can just do SELECT x INTO ##temp FROM y UNION ALL SELECT x FROM b but I'...

SQL Server count(*) issue

Hello everyone, I am using SQL Server 2008 Enterprise. I am using the following statement in SQL Server Management Studio as a part of a store procedure, and there is following error (compile error when I press F5 to run the store procedure). But when I removed count(), all error disappears. Any ideas what is wrong with count()? Another...

Showing Parameters passed to a SP in Reporting Services 2000

Hello, Is there a way to put a report into a debugging mode? My situation is this. I'm changing the SP of a report to speed it up in a transition to 2005, in fact this is the same one where the funky from was from, and for some reason when I call the SP from SQL it takes 4 seconds. When the report runs, well its been 20 mins and its ...

Search Code in Project for Stored Procedures in the Database

Is there an easy way to run a search for all the stored procedures in the database to see if they are anywhere in C# code in Visual Studio? I am using Visual Studio 2008 (C#) with SQL Server 2005. I just want to query the database and return a list of all the stored procedures (I can easily do this). Then I want to search through an en...

SQL Server: Why would i add ";1" to the end of a stored procedure name?

i came across a compatibility issue today, as a customer upgraded from Windows XP to Windows 7. The (12 year old code) is calling a stored procedure on the SQL Server called ai_nextid Except that when it calls the stored procedure it is using the name: ai_nextid;1 Yes, with a ";1" appended. Apparently the SQL Server driver in Win...

how to connect to SQL Server from JSF

I have created a simple JSF application, now must to connect to SQL Server and perform CRUD operations on those tables from database. I was a .NET programmer and i don't know how to connect to SQL Server from JSF. I have read something about JNDI, but not understood well. My questions are: where should JNDI be defined: on Tomcat or my...

how to move data

I have a table with data as following: id col1 col2 1 c1 1 c2 2 b1 3 a3 4 e1 4 e2 Now I need to move this data in another table in such a way that the record that has same id goes as a single record in this new table. so the new table data would look like this: id col1 col2 1 c1 ...

query with case column

In a query, I have a column like this: case when X = 1 then case when Y <> 0 then YY else XX end else ZZ end as MyColumn Is there a way, in another column, to check the above column value referencing MyColumn instead of rewriting the case statement? I should value another column based on the MyColumn value. Thanks ...

How can I write an INSTEAD OF INSERT trigger that sets one column for any table?

Howdy, I am working on a legacy app that is being extended to run in a multi-tenant configuration. The basic architecture takes the old application and adds a StoreID column to every table. Each tenant then sees the legacy tables through a set of views that filter on store id, something like: create view AcmeBatWings.data as select ...

High Plan Count in SQL Server 2008 Activity Monitor

I have a MERGE query to create an upsert operation on my database with data entered through my application. When I go to call it to save my data on large transactions (>5000) it takes a very long time (~20-40 seconds). Here's my MERGE statement MERGE TestTable AS target USING (SELECT @Guid) AS source (target.Guid = source.Guid) WHEN M...

How to store a multiple or a list of values returned from sp_executesql ?

UPDATE : This is what I did - set @dyn_sql = ' select @UserName=UserName from ( select E.ID as EmployeeID, E.UserName as Username ...

SQL Server Fulltext Search contains phrase problem

I have a problem with SQL Server 2008 full text search I have the following query SELECT * FROM cigars WHERE CONTAINS(cigars.*, @Search ) @Search is a value that is passed in through a stored procedure. But, thats not the problem. What is is if someone searches for say 'Punch' it works fine and I get all cigars that match. Where the...

Performance of update statement inside DTS package

Hi, I have a DTS package, which after running daily with no problems for a couple of years, has started to play up. Originally it was inserting data into a table which would then fire an insert trigger. The trigger used [inserted] to update three columns in the table. Usually, it was updating about 500,000 rows of inserted data. When t...

Which charsets does varchar support? ie UTF-8

Google failed to give a definiative answer. So here goes Mr Stackoverflow... Which charsets does varchar support in MSSQL? i.e. ASCIII, UTF-8 etc... ...

Identifying Trending Stories in SQL Server

Hi guys, I am building a social news portal and and I am trying to figure out how will I be able to identify trending stories from thousands of news I fetch everyday? Is it through data mining? Any guidance would be highly appreciated ! Thanks. ...

Using Encrypt=yes in a Sql Server connection string -> "provider: SSL Provider, error: 0 - The certificate's CN name does not match the passed value."

Hi geniuses (is that genii?) I'm using 'Encrypt=yes' in a Sql Server connection string, because i need the tcpip traffic to be encrypted, but on opening the connection i get the error: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 ...

How to query on a column of datatype long storing datetime values?

I am working on a table which has a column called ccDate of type long which stores the date values in long format - for example 20021218. Actually it is a datetime value for 2002-12-18 (yyyy-MM-DD). Now i want to query records from this table comparing this datetime values. for example get all records where ccDate < todays's date. How c...

SQL Server like statement issue

Hello everyone, I am using SQL Server 2008 Enterprise. Now I have two patterns to implement the same function (to see if zoo1 or zoo2 or zoo3 column contains some text, in pattern 1, I merge content of zoo1, zoo2 and zoo3 to form a new column called zoo), I think the first pattern is always of better performance (I have made some experi...