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

add a data to table from another table with sum function

hello everyone.İ have 2 tables calisanlar and Siparis_onaylanan.In calisanlar table there are calisan_no,adet and etc. columns.In Siparis_onaylanan table there are Siparis_id,urun,adet,calisan_no and...

View Article


converting binary value into Hex and vice-versa using t-sql

Hi All,Am trying to convert a 24 length binary value to hex & having tough time :(each bit represent every hour in  day so my binary value will be something like thisBinary value -->...

View Article


Split comma seperated values to multiple columns

Hello,I have the following scenario.  I have a column with comma seperated values in SQL table. Iwant the output to be split in multiple columns. Please help me with the SQl Query.Existing Column...

View Article

Use Aggregate Function

Hello,I have a question regarding an TSQL- Statement I want to build.Table Structure:Head- TablePersonalnumber (PK)DriveNumber (PK)LicenseNumberDetail-TablePersonalnumber (PK)DriveNumber (PK)PosNumber...

View Article

Deleting repeated data from a table

I have a table which has become corrupt causing data to be repeated. I need to be remove duplicate rows but leave 1 of eachselect * from allocation a1 inner join allocation a2 ON a1.SupplierUnitTypeID...

View Article


Is there way to get last updated column name/id in sql server ?

This is tableCREATE TABLE test(    id char(5) NOT NULL,name nchar(20) NULL, Mphone int NULL,Tel int NULL );insert into test values('e001','david',5456789,5456422);update test set MPhone =012345 where...

View Article

MS SQL query throws message as Ambiguous column name 'Category'.

When I run the select query "Select Category, Description, DirOrIndir, * From adaptivlive.dbo. Category Order By Category", sql throws the message "Ambiguous column name 'Category'" but the same query...

View Article

Image may be NSFW.
Clik here to view.

Help Please

This is my query SELECT TIME_FROM, TIME_TO,CASEWHEN W_CODE ='AAU'AND TEAM_CODE <>'AU'THEN1ELSE0ENDAS INLIER,CASEWHEN W_CODE <>'AAU'AND TEAM_CODE ='AU'THEN1ELSE0ENDAS OUTLIERFROM...

View Article


SFTP a file created on SQL Server with a Stored Procedure to a UNIX Server

I'm trying to create a SQL Server Stored Procedure to generate an XML file. Once the file is generated, it has to SFTP the file to a UNIX Server. I've never done the SFTP stuff before so here I'm...

View Article


Search and replace ID query with a twist

Hi I have a minor query issue I'm stuck with. I have a n-m table containing relations between contacts and lists. I need to do a search and replace contact A with B in the table however I may only...

View Article

Image may be NSFW.
Clik here to view.

Message: Msg 1018, Level 15, State 1, Line 94 Incorrect syntax near 'INDEX'....

I received SQL query to create a table in MSSQL Server.The file is generated from Oracle Server. Here i attach the query file and the error message.CREATE TABLE AMATS ( ARTICD VARCHAR2(8) DEFAULT ' '...

View Article

SQL-create Autoincrement manually

Hi All,I have a requirement where I have a table with Two Column. And I want to make 'COLA' as Identity\Autoincrement (to start with next value) When Ever new records comes in 'COLB'BELOW IS SAMPLE...

View Article

Generate Sql From Hierarchic Table

Hi, I have a Hierarchic  table  T like this : ID     Caption      Table        Id_Dim ----------------------------------------- 1         A           [DimA]         NULL 2         B           [DimB]...

View Article


Out-of-process use of OLE DB provider "SQLNCLI11" with SQL Server is not...

Hi guys,Iam trying to upload data thorugh a linked server.This is a job which was running fine from months and now suddenly throws a error..Out-of-process use of OLE DB provider "SQLNCLI11" with SQL...

View Article

Query help

Hi, I need help in getting this type of output: Create table T1 (Id int identity primary key, VoucherNo varchar(10), TransNo varchar(10) ) Insert into T1 values...

View Article


database back up file is not creating

 Hi ,I am doing back up for my database but back file is not creating in folder location.I done back up through GUI and command also both getting successful message but file is not creating.I have...

View Article

Image may be NSFW.
Clik here to view.

Multiple Grouping for ad-hoc Table

Hi,I want to write a T-SQL script to group "Field1" and "New Field2" columns in such a way to make them look like Table2 in the below snapshot. The elements in "Field1" must be regenerated according to...

View Article


Query errors because field name contains - character

Hi,I have a table with a field called 'notes-id', however if I do a query such as:select * from PUB_oa_sltrans where notes-id = '00712518118'I get the following errors:Msg 207, Level 16, State 1, Line...

View Article

Query not producing expected results

I am performing the query below, it is a simple query that checks for records in each month of the companies financial year, by branch but it is returning results that are in excess of the total for...

View Article

Long running stored procedure

Hi I'm fairly new to this so please be patient.I have the following stored procedure that takes best part of 10 hours to run!!!Table Motor.MTMIEARN has 16012916 recordsTable Motor.MTMIMTRF has 376358...

View Article
Browsing all 23857 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>