3,481 Topics

Member Avatar for
Member Avatar for tonief

Hi I'm new at this I have created a database Person with (ID,Name,address) in MS SQL an d I have the following code [CODE]protected void Button1_Click(object sender, EventArgs e) { System.Data.SqlClient.SqlConnection conn =new System.Data.SqlClient.SqlConnection(); conn.ConnectionString ="integrated security=SSPI;data source=SQL Server Name;" +"persist security info=False;initial catalog=northwind"; try { conn.Open(); string sql = …

Member Avatar for mail2saion
0
91
Member Avatar for kujoy

Hiya, Im looking to set up an events schedule, and i'm unsure where to start. Basically this will take a Startdate then insert a row in a table then a add 7 days to the inserted row date and insert another row etc until a specified date. I've looked at …

Member Avatar for vicky_rawat
0
98
Member Avatar for bozkurt

Hi, I am new. I have two table like this [code] create table1( ID VARCHAR(10), CONSTRAINT PKeyt1 PRIMARY KEY (ID) ) create table2( ID1 VARCHAR(10), ID2 VARCHAR(10) ) [/code] I want to add foreign key to table2 which ID1 and ID2 is different but referenced same column ID and ON …

Member Avatar for Ramy Mahrous
0
104
Member Avatar for wowawiwa

Hi All, First of all, thanks for taking time! The problem i've got is the following: I am trying to do an update to a range of data in a field: I've got some products stored in database like this l-aa223221 l-aa2243232fe32 l-aa224322ddew23 I would like to transforms these multiple …

Member Avatar for mail2saion
0
92
Member Avatar for poparosa

Hi. Intel Xeon CPU 2.40Ghz -- 2GB Ram Windows 2003 R2 Standard edition - (SP 2 applied) SQLServer 2008 Management Studio 2008 (v 10.0.1600.22) I am trying to add a maintenance job using the wizard to perform a backup and I get almost to the end and then I see …

Member Avatar for poparosa
0
79
Member Avatar for goodfellaNW

Hello, I have the following tables: tbl_Products, tbl_Categories, tbl_CategoryFields, tbl_ProductDetailsText tbl_Products houses basic product data, such as ID, CategoryID, Title, Description, Body, Date, Status, etc... tbl_Categories has ID, ParentCategoryID, Title, etc... tbl_CategoryFields has custom fields that the user can add in a CMS for specific categories. For example, Category A …

Member Avatar for saurav.prasad28
0
150
Member Avatar for Kusno

Dear all, I have 2 tables : [CODE]create table test ( FieldA varchar(10), FieldB varchar(10), FieldC varchar(10) ) and create table test_trigger ( FieldA varchar(10), FieldB varchar(10), FieldC varchar(10) )[/CODE] I create Insert Trigger in test table. Every time test table is inserted new row, automatically inserted in test_trigger table. …

Member Avatar for Westchaser
0
263
Member Avatar for alexstrong29

Hi, I recently posted a thread asking a certain way to loop through some products in a products table and then recording 4 other (recommended) products for each single product, in a new table. I have done this using a cursor but have been advised that there should be a …

Member Avatar for mail2saion
0
79
Member Avatar for fawadkhalil

Hi all Convert(decimal(10,1),(taxid*10)/100) as tax value in taxid is 1. And also im getting .0 result but it should return .1 Plz help me..........why im getting wrong answer.

Member Avatar for fawadkhalil
0
71
Member Avatar for Meros

Hi. I'm new to daniweb and i saw that people had the same problem as me and they got their problems fixed. I ran HJT and got this log. Logfile of Trend Micro HijackThis v2.0.2 Scan saved at 12:02:59 PM, on 4/12/2009 Platform: Windows XP SP3 (WinNT 5.01.2600) MSIE: Internet …

Member Avatar for jholland1964
0
193
Member Avatar for Declan123

Does anyone know if it possible to access an Ms-OLAP-Cube and use an MDX-query through JAVA without using XMLA, JPivot or Mondrain. Thanks Declan.

Member Avatar for amoon
0
74
Member Avatar for rgothard

OK.. I'm trying to write a query which combines data from two tables. (I'm pretty novice at SQL Queries, so bear with me!) However, I want to exclude duplicate data (based on just one column -- an address field). Basically, I want to only have one result per address. The …

Member Avatar for rgothard
0
21K
Member Avatar for Summerston

What SQL statement would I need to join the employees/work orders tables to create the desired output (below)? ++++++++++++++++++++ + employees + ++++++++++++++++++++ + id | name + ++++++++++++++++++++ + 1 | Jim Smith + + 2 | Susie Helms + ++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++ + Work Orders + ++++++++++++++++++++++++++++++++++++ + id …

Member Avatar for Summerston
0
128
Member Avatar for BobLewiston

Could someone please give me the simplest possible C# code snippets / SQL queries to determine whether: * a given SQL database exists, * a given existing SQL database is accessible, and * a given table exists within a given existing SQL database? Thanks for whatever help anyone can provide.

Member Avatar for Ramy Mahrous
0
96
Member Avatar for f0rb35

Hi. I'm a newbie to PHP. I am looking for a PHP login script which uses MSSQL. I've come across a ton of tuts and guides for MySQL, but unfortunately, I do not have an option. [B]I have to use MSSQL.[/B] All the login script has to do is allow …

Member Avatar for darkagn
0
67
Member Avatar for drynish

Hi! Is it possible to run trigger as another user? I'm using trigger to obtain insert info from a database run and to transer the information to our main db. I'm using this automated action just to not having to run a script at determined time or anything, I wanted …

Member Avatar for darkagn
0
64
Member Avatar for JoeJonnyBoy75

Hello all, I'm currently trying to setup a SQL View that's going to be used to pull info from a table and output it onto a label... Long story short the only piece I need help with is having the SQL view remove leading zeros from one column called "Reference". …

Member Avatar for JoeJonnyBoy75
0
105
Member Avatar for LeMa50

Well, I'm new here but you can halp me also. I have pretty big problem. I need to store large text (more than 8000 charaters) in variable inside of procedure and then execute that query with EXEC command. Problem is that varchar supports up to 8000 characters and text and …

Member Avatar for dickersonka
0
184
Member Avatar for redhunt

I have a couple of servers. Everyday thousands of records have to be moved to another server. A temporary table is available for each table in the 1st server. Data is copied from the main tables to these temp tables using triggers. I am using a Windows NT service to …

0
45
Member Avatar for sparques

Hello, Being fairly wet behind the ears with Crystal Reports, I've been struggling with an issue of authentication. I have a Report, that is created in version 8.5....interfacing with a Sql Server 2000 database. I access the report through our company's internal web site. (The website was created in Coldfusion …

0
61
Member Avatar for shahzadhard

I have a database named newbase and columns are 1. Itid 2. Itname 3. Itprice 4. Itquantity I get the sum of the price using itname and the query is [code=sql] select SUM(itprice)as total from trick where itname=’a’[/code] I got the result but now problem is that I want to …

Member Avatar for shahzadhard
0
77
Member Avatar for andresasongko

Hi all, In a table column, I have this address value: "Muehlgasse 1 86637 Wertingen GERMANY" I want to get only the GERMANY part on my SELECT code. I've tested this code: [code=sql]SELECT right('Muehlgasse 1 86637 Wertingen GERMANY',7)[/code] It works, but the '7' has to be calculated, because we have …

Member Avatar for andresasongko
0
93
Member Avatar for krm08

Hello friends, I want to get the row position a table with respect to the primary key.How can I do that?.Please help me!

Member Avatar for freshfitz
0
69
Member Avatar for almis

Hi! I have this table: id table #people 1 ...1 .........3 2 ...1 .........5 3 ...4 .........2 4 ...3 .........5 5 ...1......... 2 i want to obtain the sum of people sitting per table. hope you can help me...

Member Avatar for almis
0
110
Member Avatar for chad_jensen71

I am trying to write a SQL update query for a database column containing an incorrect value. In the JobHistory table (whose primary key = JobID), the ModifiedDt column contains an invalid value, specifically it contains a value from a pickup stop, but I need to use the value for …

Member Avatar for chad_jensen71
0
156
Member Avatar for BobLewiston

I saved a few stored procedures in SQL Server Management Studio. The default Save location, which I accepted, was C:\Documents and Settings\BobLewiston\My Documents\SQL Server Management Studio\Projects. (And yes, each stored procedure was in the form of an .sql file, and I assigned each file name root to be the same …

Member Avatar for BobLewiston
0
276
Member Avatar for airbourne

I know this is a beginner question, but my SQL experience is very limited so I'd like some clarification before I pull the trigger on this. I have a SQL 2000 database who's owner has been deleted. From the looks of it, a long time ago. So now I cannot …

0
75
Member Avatar for Smithy963

Hi guys, I've been programming for quite a while now and just jumped in to SQL and Stored Procedures due to a Uni project I have due in. I have a table called [B]tblWebsiteMember[/B] and tblWebsiteMember has 2 Columns - [B]ID[/B] and [B]Name[/B] [CODE]CREATE PROCEDURE CreateWebsiteMember @wbmName AS Insert into …

Member Avatar for Stylish
0
177
Member Avatar for BobLewiston

I've written a few SQL stored procedures in a text editor. But how do I actually "store" them in (add them to?) a database using SQL Server 2008 Management Studio Express? I've tried to research this topic in Management Studio's onboard Help, but apparently Help assumes I know more about …

Member Avatar for dickersonka
0
90
Member Avatar for Enrgy

Hi Everyone. Im new in this forum. i need some help about sql, im working in a large company and we have many construction yards in the world we made a program and we are taking backup and restoring test machine, but now we need a automatic system what can …

Member Avatar for dickersonka
0
75
Member Avatar for pezza

Hi, I have managed to get a nested query to work partly, but i need to somehow add another nest, which i cannot get to work. To explain more, i wanted to firstly find records that did not exist in another table, to which i used the following [CODE] SELECT …

Member Avatar for pezza
0
111
Member Avatar for drynish

Hello! :) I have a small issue with an AFTER UPDATE Triger I implemented on one table of my db. In my trigger, I do some validation and update others (not in inserted or deleted) rows of my table. Thoses rows are updated but are not triggering my trigger (similar …

Member Avatar for drynish
0
118
Member Avatar for bajanpoet

This set of code below shows all SQL Server Agent jobs that have failed for the date 200.03.29. The run_date column is an integer, but I want to run the code in such a way that the resultset is automatically generated for the day before the current date. The code …

Member Avatar for bajanpoet
0
145
Member Avatar for blackbr

-I am using vs2008's table adapters for a DAL for several tables. -I have a computed field (FirstLastName) in my Lead table. -If I try to generate insert/update logic, the sql aborts when it tries to update the computed field. -So I dropped the field from the primary select, with …

0
64
Member Avatar for BobLewiston

Some of you may have seen my earlier thread “PasswordHash NULL problem”. I’ve started a new thread because investigation has shown that the problem is actually quite different than I previously stated. Also please note that this is unrelated to another of my previous threads, “dataAdapter.Update problem”, which incidentally has …

0
54
Member Avatar for BobLewiston

When I try to save a new (inserted) record in an SQL database, I get the following System.Runtime.InteropServices.ExternalException message: [QUOTE]Cannot insert the value NULL into column 'PasswordHash', table 'AdventureWorks.Person.Contact'; column does not allow nulls. INSERT fails. The statement has been terminated.[/QUOTE] I have to either find out how to insert …

0
62
Member Avatar for BobLewiston

When I try to save a new (inserted) record via the following code: [CODE]DataRow row = dataTable.Rows [currRec]; // update data in DataSet from data entry WinForm row.BeginEdit (); row ["Title"] = txtTitle.Text; row ["FirstName"] = txtFirstName.Text; row ["MiddleName"] = txtMiddleName.Text; row ["LastName"] = txtLastName.Text; row ["Suffix"] = txtSuffix.Text; row …

0
42
Member Avatar for BobLewiston

Most databases have multiple users. For these databases it is a good idea to auto-increment the identity column. I understand that an SQL identity column is not incremented until the newly-created record is inserted. I guess this means the identity column is incremented when you actually reconnect to the database …

0
43
Member Avatar for debeginin

I just got started with ms sql server2000,and I need a big favor from the the house,which is:please what softwares do I really need to install to get started?

Member Avatar for debeginin
0
72
Member Avatar for freshfitz

I need to merge 2 notes fields in a sql database This select script gets me what I need how do I merge notes into Technote, I have a function to filter out the characters in the phone number that's what the stripped is [CODE]Select db1.dbo.customer.cust_no, db1.dbo.customer.Phone_home, db1.dbo.customer.technote,db2.dbo.customers.notes from db2.dbo.customers …

Member Avatar for dickersonka
0
92
Member Avatar for yorockk

hiii all, iam doing a project in asp.net and the back end is sql server. so when i tried the connection code it gives me an server error "Cannot open database "C:/Program Files/Microsoft SQL Server/MSSQL.1/MSSQL/Data/projdb.mdf" requested by the login. The login failed. Login failed for user 'YOGESH\Owner'. "

Member Avatar for greeny_1984
0
176
Member Avatar for BobLewiston

Using Visual C# 2008 Express and SQL Server 2008 Express, I would like to insert new records into database "AdventureWorks", table "Person.Contact". To my surprise, this table's int-value identity column "ContactID" does not appear to be auto-increment. I don't know how to confirm for sure that this is so. (I …

0
55
Member Avatar for jchandramouli

Hi, I got a table with datas that has alphanumeric values like : 1230-544,15C5487,132DE78. Now i need to extract only integers fomr these datas and convert to bigint. The other characters have no impact in my query. Is there way to produce a data like that? Thanks in advance. Mouli

0
51
Member Avatar for ntk

I have an existing table: [code=sql]CREAT TABLE Course (CourseNo int NOT NULL PRIMARY KEY, CourseName varchar NOT NULL StudentNo int NOT NULL REFERENCES Student (StudentNo)) [/code] Is it possible to code the following change in T-SQL: Introduce a new column called CourseID (int NOT NULL) and make it the PK? …

Member Avatar for urtrivedi
0
66
Member Avatar for emilio

hi i would like to write a trigger for the basic operations on a table : insert, delete, update. i know the basic syntax: [CODE=sql]create trigger on tbl_MyReports for insert,delete,update as[/CODE] my question is how can i know which rows changed ? if i inserted or deleted or updated a …

Member Avatar for urtrivedi
0
156
Member Avatar for BobLewiston

I can read in an SQL table ("Person.Contact") from AdventureWorks and step through it one row at a time, but when I try to save a record, either one I'm inserting or one I'm editting, I get the following exception: Incorrect syntax near ','. Must declare scalar variable "@ContactID". Here's …

Member Avatar for BobLewiston
0
141
Member Avatar for harcaype

hi. my thread title seems strange but its really about comparing unlike values as an output. I want all values that are not LIKE the other values. To make things clearer. Here's my query: [ICODE]SELECT Records.[Officer ID], Records.[Plate Number], Records.[Violation Commited], Violations.[Violation Code], Records.[Street Name], Records.[City of Apprehension], Records.[Vehicle Category], …

Member Avatar for edgarlip
0
160
Member Avatar for cmwslw

Hello everyone! This is my first post on DaniWeb. Recently I have been working on a chart tracking system that utilizes MSSQL for a doctors' office. Now that I have finished it, I need a good way to deploy it across 50-100 computers in the office. The program will certainly …

0
56
Member Avatar for danarashad

I am getting the following error sometimes. When the user load gets heavy I'll receive the following error. Would puting cftransaction around my update statements work? ODBC Error Code = 40001 (Serialization failure) DiagnosticsODBC Error Code = 40001 (Serialization failure Microsoft ODBC SQL Server Driver SQL Server Transaction (Process ID …

0
101
Member Avatar for Lido98

HI I am very pleased to join this forum I am new to SQL programming , I am facing a challenge I need to copy the data from one table in one sql server to the same table in enother SQL Server From Server A table (Employee) To Server B …

Member Avatar for Lido98
0
1K

The End.