2,935 Topics

Member Avatar for
Member Avatar for AngelicOne

Could I select a datetime record using date only? I need to show rows containing a particular date. I'm thinking to separate it into two column instead if I couldn't select only date from a datetime.

Member Avatar for Momerath
0
148
Member Avatar for Dracata

I'm making a fairly easy to edit and change public dictionary and am working on the viewer hooked to an SQL server. The problem I'm having is, isn't really a problem but I'm looking for a better solution, due to it possibly devolving into a huge mess of sorting a …

Member Avatar for Dracata
0
121
Member Avatar for deolalkar_pooja

Hi to all, I created following table ------------------------------------------------------------------- create table interiors(id integer, name varchar(20), type varchar(20) default 'baby cot', price integer) -------------------------------------------------------------------- but, when i doesn't inserted any value of 'type', by the definition of table, it should take default value. when i fetch all rows by 'select' query, it …

Member Avatar for BitBlt
0
105
Member Avatar for AngelicOne

How to select records with today's event? I have a column that is set to smalldatetime. I need to select those that have a row of today's event.

Member Avatar for Momerath
0
245
Member Avatar for divyakrishnan

Hi.. I want to take the max value of the substring of a varchar field having values as SN1,SN2....SN10.I used the query as following [CODE]select max(substring(st_no,3,4)) from tbl_st;[/CODE] I am getting the max value as 9.I want to get 10. If somebody knows please help me

Member Avatar for Momerath
0
111
Member Avatar for deolalkar_pooja

Hi to all, I created following table --------------------------------------------------------------------------- create table Interiors(no integer, name varchar, type varchar, dateofstock datetime, price decimal(6,3), discount numeric(6,2)) ----------------------------------------------------------------------------- i want to solve these two queries. 1. Display the type, sum of price and average of discount by grouping type as 'baby cot'. 2. Display the …

Member Avatar for Momerath
0
112
Member Avatar for deolalkar_pooja

Hi to all, i created following table ------------------------------------- create table employee(name varchar(20), dob datetime) ------------------------------------- I want to extract names of all months from 'dob'. for that i wrote following query ------------------------------------- select datepart(month, dob) from employee -------------------------------------- it works and shows all months but in number format, i want …

Member Avatar for Momerath
0
80
Member Avatar for tamsoft

Hi, am SQL beginner, now i trying to code student marks management so i came across to db i was confused. Please give idea to create such thing, i have students, mark tables as per the semester. then how i place the information according to register number. so that how …

Member Avatar for geoamins2
0
77
Member Avatar for moone009

How do you replace characters as in an update? Example I have an address field that contains '.' and '-' and I need to remove these characters. Anyone know of an update script to do so?

Member Avatar for moone009
0
78
Member Avatar for lttleastig

hey guys i get this error when trying to execute a stored procedure in my SQl DB [CODE] Warning: mssql_query() [function.mssql-query]: message: SELECT failed because the following SET options have incorrect settings: 'CONCAT_NULL_YIELDS_NULL, ANSI_WARNINGS, ANSI_PADDING'. Verify that SET options are correct for use with indexed views and/or indexes on computed …

Member Avatar for lttleastig
0
245
Member Avatar for Fortinbra

I need help troubleshooting a performance issue. I have a stored procedure that is selecting from 3 joined tables, and is hanging on the first time this procedure is running. Sometimes hanging so long that I get a timeout error. After the first run, it's faster, but still takes longer …

Member Avatar for Fortinbra
0
108
Member Avatar for lttleastig

Hello there i am having trouble on how to compare the password of the input and the one in the DB since the one in the DB is encrypted with the code below for registration i just used a stored procedure in the db and called it in the php …

Member Avatar for lttleastig
0
115
Member Avatar for gspeedtech

Sum of One and not the Other I have a requirement to query one figure and the sum of another. What I need is one query to produce the MonthPayment for each CompanyID for a given ContractID and the Sum of TotalPayment with matching CompanyID and ParentCompanyID for each CompanyID …

Member Avatar for gspeedtech
0
123
Member Avatar for moone009

I know sql provides us with LTRIM and RTRIM but is there anyway to remove the spacing in the middle. '123 Johnson St' should be '123 Johnson St. Anyone know of any functions or tricks?

0
46
Member Avatar for Rpower

MS SQL 5 vb.net asp.net I working on a new site that requires me to show a page with a single product and it's information. I have a Next and previous button that will take the user to the next item in that category / subcategory. basic Querey to show …

0
81
Member Avatar for moone009

Does anyone know if it is possible to modify the maintenance plans through t-sql and if so please provide the code to do so. THANKS!

Member Avatar for buddylee17
0
64
Member Avatar for moone009

I found this script online for full DB backups but I was wondering how to change this to also set differential backups? [CODE]DECLARE @name VARCHAR(50) -- database name DECLARE @path VARCHAR(256) -- path for backup files DECLARE @fileName VARCHAR(256) -- filename for backup DECLARE @fileDate VARCHAR(20) -- used for file …

Member Avatar for BitBlt
0
119
Member Avatar for maleke

Hello, I have a table of many rows, and some rows have a connection to other rows. A simplified example of the table I am trying explain is below. ID MYVar LinkedToMYVar 1 10 0 2 20 0 3 30 10 4 40 0 5 50 10 6 60 30 …

0
70
Member Avatar for seenusena

Hi Friends, i ve a doubt in sql.. want to display all dates between 2 dates.. for example if our input are 9/2/2011 and 12/2/2011 na, the output are 10/2/2011 11/2/2011 .. i need query for this..can u clear my doubts..

Member Avatar for debasisdas
0
37
Member Avatar for AngelicOne

I have a table that contains ID, lastname and firstname of a person. How to make my stored procedure handle the where conditions using only stored procedure. SELECT * FROM person where lastname = @lastname SELECT * FROM person where firstname = @firstname SELECT * FROM person where ID = …

Member Avatar for debasisdas
0
224
Member Avatar for vsmash

G'day Folks. This is a general question and not a request for code. I have a client with many DTS packages on their sql server 2000. Has anyone had to migrate these buggers to sql server 2005 or 2008? Was it difficult? - After substantial googling/searching I'm not sure I …

Member Avatar for vsmash
0
210
Member Avatar for jimbob90

MyTable: People who moved from Blah City, Blah State: Name Location Date Kids Jack LA 02/05/1999 0 Cindy Chicago 12/15/2005 2 Randy LA 06/19/2003 3 Jason Seattle 04/06/2002 0 1. Who moved to LA? [CODE] SELECT Name, Location FROM MyTable ORDER BY Location; [/CODE] Expected result: LA Jack, Randy What …

Member Avatar for BitBlt
0
103
Member Avatar for emaduddeen

Hi Everyone, I have a table that has a 2 column primary key. I set up the key where the 2nd column is an identity column. When I ran my VB application I discovered the ID (2nd column) did not increment the correct way. I was hoping it would increment …

Member Avatar for emaduddeen
0
181
Member Avatar for azharrumani09

USE [DIAMDBF] GO /****** Object: StoredProcedure [dbo].[STOCKREPORT] Script Date: 01/21/2011 11:32:40 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO ALTER PROCEDURE [dbo].[JEWELLSTOCKREPORT] @SELDBNM SYSNAME, @FILENO1 nvarchar(7), @FROMCODE nvarchar(20), @TOCODE nvarchar(20), @START nvarchar(12), @LAST nvarchar(12), @DATE1 nvarchar(12), @DATE2 nvarchar(12), @DATEFORMAT varchar(12), @GROUPCODE char(10), @FROMLOT nvarchar(10), @TOLOT nvarchar(10) AS Declare @execstring …

Member Avatar for BitBlt
0
218
Member Avatar for gmark@svs.com

I want to convert a kind of a large MSSQL table to text -- ideally CSV. One crude way would be to use SQL Developer to do a SELECT * and do a copy-and-paste. But there must be a more precise and efficient way of doing this. Perhaps SQL Developer …

Member Avatar for BitBlt
0
232
Member Avatar for Suzukaze

I have 3 tables; Group, MemberOfGroup and Graduates. GroupID is a primary key for Group and MatricNo is a primary key for Graduates. Both GroupID and MatricNo are composite key for MemberOfGroup. I want to show the group lists according to member size. Below is my sql. [CODE]Select g.GroupName, count(m.MatricNo) …

Member Avatar for BitBlt
0
115
Member Avatar for jlivvers

Hi, I have recently finished a windows desktop application for a client that connects to a sql server database. Throughout development while the server instance was on my local machine the application and server communicated fine with the connection string below [CODE] <add name="myString" connectionString="Data Source=myServerName;Initial Catalog=&quot;myDbName&quot;;Integrated Security=True" providerName="System.Data.SqlClient" /> …

Member Avatar for BitBlt
0
205
Member Avatar for novedturn

Here is a sample of my table: ID Name Codes 1 John D S12, S13, S89 1 John D S98, T12 2 Joe D X27, S28 3 Bob S F12, F13, X43 3 Bob S S44, X38, S90 4 Steve F D25 I want a query that will return the …

Member Avatar for Rkeast
0
69
Member Avatar for Mahesha999

Hi, I tried installing MS SQL server 2008 on win 7 Ultimate x86. It was slipstreamed installation with SQL SP1. I got 7 errors during installation. All of them are showing almost similar messages (but different event ids)except the 2nd error (which was about failure to open some registry). The …

Member Avatar for Mahesha999
0
465
Member Avatar for fawadkhalil

Hi i was installing sql 2000 on win 7 but it gave a message something like "sql have compatibility issues with this version of windows". I want to use sql 2000 with vs2005. Is it possible to run sql server 2000 on win 7? If yes how can i run …

Member Avatar for JemB
0
222

The End.