2,935 Topics

Member Avatar for
Member Avatar for Lethugs

Hi, Im trying to extract data from sql server where conditions are multiple and variying I have a datagridview with 2 columns ID and Name I need to create Select Query to extract data where condition is 'ID should be equal to the value or values in Datagridview ID Column. …

Member Avatar for Lethugs
0
267
Member Avatar for amishraa

Is there a way to get a total counts from the resultset of two unions? This will be for DB2. select count(*) from ( select count(*) from xyz where abc='1' union all select count(*) from x1y1z1 where abc='1' )

Member Avatar for amishraa
0
177
Member Avatar for morfious90

I'm implement if else in stored procedure with and oprator . If both Conditions are true the if statement should return 1 else -1. here username and email should not be duplicate please review query below. alter proc spUserdetailss @name Nvarchar(50), @passwords Nvarchar(100), @emailadd Nvarchar(50), @Gender nvarchar(50) as begin declare …

Member Avatar for pclfw
0
415
Member Avatar for Amr_Mohammad_R

This function I have created to return all recorded Stock numbers in the Table "ContributorDeeds" the table contains only the start number of the stocks and the end number of the stocks (e.g, from number - to number) I need to get all the numbers between within that range. The …

Member Avatar for Taywin
0
228
Member Avatar for rony001

hello friends I have two tables with column A and column B. I want to update column B of table2 with column B of table1 . I have trying this query in ms access from Vb.net. update table1 t1 LEFT JOIN table2 t2 on t1.a = t2.a SET t2.b = …

Member Avatar for isozworld
0
281
Member Avatar for G_Waddell

Hi, I have to correct some data in SQL Server 2008 R2 database for an accounting system that was accidently over written. Basically I've to take stock items with fixed prices and compare those fixed prices against Sales Order Transactions for the stock item and correct entries where the transaction …

Member Avatar for isozworld
0
159
Member Avatar for jarp

I have written a SQL query to find product information in a c# program and it doesn't seem to work at all! I have tested a variety of other queries with my C# code and it works fine, but this throws an exception every time. SELECT TOP (1) CONVERT(varchar, tmpRptAssetEvent.EventTimeStamp, …

Member Avatar for BitBlt
0
202
Member Avatar for Maideen

Hi I have an issue in below stored procedure. below Store procedure is working fine. But fixed the Year. Any one know How can do the year dynamically select by user? SELECT * FROM ( SELECT salesEXE,SalesEXEName,name,gross,YearNo FROM vw_Pivot_Month_ALL) TableYearNo pivot (Sum(gross) for [yearno] in ([2008],[2009],[2010],[2011],[2012],[2013],[2014],[2015],[2016],[2017],[2018],[2019],[2020]) )pivotTable pls advice Maideen

Member Avatar for isozworld
0
280
Member Avatar for AmrMohammed

Greetings, I'm facing a problem with the SQL Server and this problem concerning numbers when compared each other and these numbers are stored in the columns of data type NVARCHAR or VARCHAR. For example, if I'm having a column with data type NVARCHAR and it contains such values: 1 2 …

Member Avatar for isozworld
0
267
Member Avatar for Gaurav arora

Hi all, I have created a table in which i have a DateTime Column . i need that i dont want to insert values in that column from the front end. i have created a trigger for that purpose. whenever i insert a row in that table the dateTime column …

Member Avatar for Timothy_3
0
212
Member Avatar for Amr_Mohammad_R

What is meant by the bold part of the below paragraph An index is a copy of select columns of data from a table that **can be searched very efficiently that also includes a low-level disk block address** or direct link to the complete row of data it was copied …

Member Avatar for pritaeas
0
82
Member Avatar for spowel4

I have this query as part of a stored procedure, and this query as it is listed here works: INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 8.0;Database=G:\KF\GBSData.xls;', 'SELECT * FROM [Sheet1$]') SELECT * FROM [KWF_GBSData].[dbo].[tblKWF_WorkTable2] WHERE invoiceNumber IN ( SELECT invoiceNumber FROM [KWF_GBSData].[dbo].[tblKWF_WorkTable2] WHERE stockNumberShipped LIKE 'CCCOMBO%' ) I would like to change …

Member Avatar for askme_1
0
558
Member Avatar for lefteris.gkinis

I have a code behind in my web pages and I'm trying to write Greek characters in my SQL 2010 Tables. I write in my Tables but what I get is ????? why is that? What I have to do in my SQL in order get the Greek characters? Thank …

Member Avatar for lefteris.gkinis
0
214
Member Avatar for devendradighe

Hi, I want to create a trigger to increment value of my VisibleNo field if it gets duplicate value. My Application is my multiple users at same time . When at first suppose two users open application it gets same visible no and it saves duplicate number. I want use …

Member Avatar for devendradighe
0
176
Member Avatar for Sizwe_1

i am trying to check availability of a room i have the following code: ALTER procedure [dbo].[CheckAvailability] @checkIn datetime, @checkout datetime as Select r.RoomName, RoomNO, [Description],Location, RoomPic, Price from [Room-Type] t , Room r, Booking b where r.TypeNo= t.TypeNo AND r.RoomName Not IN( Select b.CheckinDate from Booking b where ( …

Member Avatar for ChrisHunter
0
242
Member Avatar for rpv_sen

HI Please help. how to solve this I am using the below code. insert is working fine. but i am having problem in edit session i edit page i can able to display both values from Database. If i am changing the textbox1 value i am not able to get …

0
115
Member Avatar for Jay_7

can any body help me or give me an sample code on how to create a very simple log in system using php and mssql..tnx in advance.

Member Avatar for MikeJones_1
0
13K
Member Avatar for Santanu Das

I use SQL Server2008 R2. From yesterday, I get a problem to open it. When I try to open it by Microsoft SQL Server Management Studio an error is occurring. And I also get the same error when I call it from vb.Net2010. I am attaching here the error picture. …

Member Avatar for Santanu Das
0
171
Member Avatar for mokshi

I have to pass two values to sp first value is nvarchar and second value is Int in SQL server,but i am not getting values, is my code is correct.Please help me out $query = mssql_init("courseofferedbyprof", $dbhandle); mssql_bind($query,"@facultyID",&$facname,SQLVARCHAR,false,false,50); mssql_bind($query,"@count",&$year,SQLINT2,false,false,50); $result=mssql_execute($query);

Member Avatar for diafol
0
146
Member Avatar for AmrMohammed

Greetings I want to optimize a SQL Query. The problem I have a database full of such Queries and I need help for optimizing those Queries the problem with the Query is that it contains dozens of CASE blocks and within those CASE blocks there are calculations the Query results …

Member Avatar for pritaeas
0
215
Member Avatar for gbhs

Hi if myTable has a column like Col 10 7 3 5 9 4 How can I select three smallest numbers? my resultset should be 3 4 5 I don't prefer the following; with myT as (select col from myTable order by col) select top(3) from myT Any better idea? …

Member Avatar for gbhs
0
248
Member Avatar for amishraa

How do I get average of the duration for multiple weeks. Currently I get something like Student Avg completion time Week Year STUDENT 1 0 1 2013 STUDENT 1 5 1 2013 What I want is Student Avg completion time Week Year STUDENT 1 2.5 1 2013 <code> select a.student,avg(a.duration) …

Member Avatar for adam_k
0
166
Member Avatar for Vb.Netter

I have a simple sql table with four columns The data types are Athlete nvarchar(30) Mydate date Mytime varchar(8) Session nvarchar(40) Sample Data **Athlete Mydate Mytime Session** Jerry 14/07/2014 00:00:32 200M Jerry 14/07/2014 00:00:31 200M Jerry 16/07/2014 00:00:59 400M Jerry 16/07/2014 00:00:57 400M Jerry 16/07/2014 00:00:58 400M Now what i …

Member Avatar for adam_k
0
191
Member Avatar for HunainHafeez

I am receiving a Code in sms like "yyyy/mm-digit" (digit increments with every message). so i want to ensure that the code sent by user is exactly in that format otherwise another action. So how ? Here is my code to check but it always execute else block, why ? …

Member Avatar for adam_k
0
192
Member Avatar for Mike Bishop

I am trying to calculate days between two dates so that I can find out if they fall in the 30 / 60 / 90 day bracket The calculation I am using is working fine ` DATEDIFF(day, dbo.TblReturnDetails.RcvdDate, { fn NOW() })` what I am trying to do now is …

Member Avatar for Mike Bishop
0
239
Member Avatar for Lethugs

Hi, I need to compare record using sql ce I have this data, can be thousand rows ID Type Date Time 02-0009 I 01/02/2014 8:00 02-0009 O 01/02/2014 18:00 02-0009 O 01/03/2014 18:00 02-0009 I 01/04/2014 8:00 02-0009 O 01/04/2014 18:00 For every date there should be a 'I' and …

Member Avatar for kgariando
0
317
Member Avatar for someoneelse

i am trying to figure out the syntax to do a SQL inner join from 2 different databases... The sameple code looks like this: select * from database1.dbo.table1 t1 join database2.dbo.table2 t2 on t1.field1 = t2.field2 but I dont know how to refernce the " database1.dbo" and "database2.dbo" parts.. can …

Member Avatar for kgariando
0
229
Member Avatar for AmrMohammed

I need to setup SQL Server Express using the command line and also make the installation unattended I tried many command lines however each one of them did not work here is the last one: Setup.exe /ADDCURRENTUSERASSQLADMIN="True" /AGTSVCACCOUNT="NT AUTHORITY\NETWORK SERVIC" /AGTSVCSTARTUPTYPE="Disabled" /ASBACKUPDIR="Backup" /ASCOLLATION="Latin1_General_CI_AS" /ASCONFIGDIR="Config" /ASDATADIR="Data" /ASLOGDIR="Log" /ASPROVIDERMSOLAP="1" /ASSVCSTARTUPTYPE="Automatic" /ASTEMPDIR="Temp" /BROWSERSVCSTARTUPTYPE="Disabled" …

Member Avatar for kgariando
0
307
Member Avatar for radiancebox

I'm using MS SQL 2012 - trying to LEFT JOIN 3 Pivots - but am running into issues within a query variable that I'm not sure how to debug. Each Pivot works on it's own - but the actual Joining is causing the issue. Any help is appreciated. First time …

Member Avatar for kgariando
0
3K
Member Avatar for Maideen

Hi I have database in structure like below Newspaper State1 state2 state3 state4 ABC 1000 5684 5687 246 DEF 879 2547 2578 2357 But I need to the structure like below How can i change this Newspaper State copies ABC State1 1000 ABC State2 5684 ABC State3 5687 ABC State4 …

Member Avatar for kgariando
0
305

The End.