3,481 Topics
![]() | |
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 = … | |
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 … | |
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 … | |
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 … | |
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 … | |
![]() | 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 … |
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. … | |
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 … | |
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. | |
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 … | |
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. | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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". … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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! | |
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... | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
-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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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? | |
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 … | |
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'. " | |
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 … | |
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 | |
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? … | |
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 … | |
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 … | |
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], … | |
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 … | |
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 … | |
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 … |
The End.