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 Articleconverting 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 ArticleSplit 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 ArticleUse 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 ArticleDeleting 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 ArticleIs 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 ArticleMS 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 ArticleHelp 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 ArticleSFTP 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 ArticleSearch 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 ArticleMessage: 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 ArticleSQL-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 ArticleGenerate 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 ArticleOut-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 ArticleQuery 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 Articledatabase 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 ArticleMultiple 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 ArticleQuery 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 ArticleQuery 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 ArticleLong 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