Quantcast
Channel: Transact-SQL forum
Browsing all 23857 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

T-SQL Trying to pivot data in a SELECT STATMENT, results not being grouped by...

I'm trying to extract data from the vJCJobRoles table which has the following columns:vJCJobRoles.Job (INT, not null, Key Field)vJCJobRoles.Role (CHAR, not null, Key Field)vJCJobRoles.VPUserName (CHAR,...

View Article


Memory configuration For SQL Server 2005

Please guide us on following scenario :      we have one server on that server MS SQL 2005 enterprise is installed and that server containg8 gb of RAM and intel xeon processesor with Windows server...

View Article


How to combine several records into one

Hi All,I have the following recordsMemberId,StartDate, EndDate, Status1,2013-1-1, 2013-5-1 , Close1,2013-5-11, 2013-6-1, Close1,2013-6-23, 2013-9-1, OpenI want combing all the records into one, the...

View Article

update date range table based on date

Hi,I need some help writing some sql... bit difficult to explain but here goesI have two tables, see below for example. I need to update the DateRange table and set the flag to 1, if the date from the...

View Article

SQL Query

Hello All, Please help in below query, I have a table structure like below,I need the out in below format show weight against each ItemID where there  is matching ItemID there value of that ItemID...

View Article


Unable to Make querry for Online examination System Project

CREATE TABLE [dbo].[tb_question]( [Id] [int] IDENTITY(1,1) NOT NULL, [Question] [varchar](500) NULL, [Status] [bit] NULL, [Complexity_Id] [int] NULL, CONSTRAINT [PK_tb_question] PRIMARY KEY CLUSTERED (...

View Article

An aggregate may not appear in the set list of an UPDATE statement.

Hi,I receive the above error message if i run this query UPDATE   EDW.Planning.TEDW_F_TRANSACTION_CHANNEL_OPS_GOAL  SETOPS_GOAL = SUM(TEDW_F_STORE_OPS_GOAL.OPS_GOAL) FROM...

View Article

Update Statement not working in SQL

Hi,I need to update a column from the table when the datekey and tranchannel key matches, and as i am using sum i cannot directly do it i am using a subquery like thisUPDATE...

View Article


MERGE Query

Hi,Scenario is, our SSIS - SCD is taking a quiet bit of time to process.We have source table + destination table + history table.Data comes through source > gets compared against destination...

View Article


Get tables from sql statment

Hello,I need to find out all of the tables that any sql statement is dealing with.So: Select * from PersonWould return "Person"I would also like:SELECT column_name(s)FROM table1INNER JOIN table2ON...

View Article

Help converting problem to sql solution

HiI cannot seem to find a proper sql query for my problem.Input: (small set)TicketNr|CustomerKey|11 | 111 | 222 | 122 | 333 | 433 | 544 | 655 | 766 | 777 | 888 | 888 | 9Output:CustomerKey|NewKey1 | 12...

View Article

Difference between value and value_in_use in sys.configurations

Hi, Was wondering of the difference between the columns 'value' and 'value_in_use' in sys.configurations. According to MSDN doc (http://msdn.microsoft.com/en-us/library/ms188345.aspx), 'value' =>...

View Article

requirement for bulk insert

Please help.... Thanks in advanceData in CSV FileID, Name ,Phone 100983, "Jones, Frank",555-1212 118928,"Joe",5 mngh 55-1313 115454,,555-1414Using Bulk insert data is going like thisID          Name...

View Article


insert dynamically and return @identity value

Dear All, this is my coding which inserts some value into User_log table and returns @identity value . please help me. thanks in adv. Declare @NewDB varchar(max); SET @NewDB='ta.dbo.user_log (...

View Article

How to Sum multiple Column with multiple value with SQL?

I am looking for a solution to the following: Go in to the users table and find a user who has listed items on the site. In this users table, there is no column about auctions. Instead, it is...

View Article


Need help for tuning SQL query which is using like

Hello Membersi need all of yours help to tune this query Currently my Database Size is after indexing column 50 GB My Current Server Configuration is DUAL XEON 5506 RAM : 32 GB HDD: 150 GB RAID 10 RAM...

View Article

Split a string at the last space before 30 characters

I am working on a project to convert data from an old ERP system to a new ERP system.  The issue I am having is that in the old system, the product description is a varchar(255), although we don't have...

View Article


calling multiple sql udf's from a stored proc to look up data

I have a sp that needs to show some lookup values from another table that stores custom field labels and values.I wrote a couple table valued inline udf's as below: This one retuns a custom value based...

View Article

ON clause that refers to 3 tables

Hi,In a stored procedure at work, there is an ON clause that uses 3 tables, rather than 2, which doesn't look right.  Below is some code which attempts to simulate the situation.  The part that doesn't...

View Article

Executed as user: NT SERVICE\SQLSERVERAGENT. Cannot initialize the data...

Hi,I have the following SQL working perfectly in SSMS 2012 - 64 Bit.INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0; Database=C:\Temp\Results.xls', 'SELECT X, Y FROM [Sheet1$]') SELECT...

View Article
Browsing all 23857 articles
Browse latest View live