473,554 Members | 3,024 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Microsoft SQL Server Forum

Microsoft SQL Server database RDBMS - Ask questions about MSSQL administration, queries, errors, xml, data access, transact-sql, tools, mirroring, integration, setup, stored procedures, merging and more.
2
39,417
thread by: Gunnar Vøyenli | last post Jul 20 '05 by: Gunnar Vøyenli
Hi! For the sake of simplicity, I have three tables, Employee, Department and Work Employee >---- Department \ / \ / ^ ^ Work
5
39,343
thread by: Lachmayya | last post Feb 1 '08 by: bxchen
Dear All, I have created two databases in SQL-SERVER 2000 called Shop1 and Shop2. Both database has the table 'Sales' with fields "Item","Rate","QTY","Price" I would like to append data from Shop2 Sales to Shop1 Sales table. Your suggestions will be highly appreciated. Thank you. Lachmayya Siddanmane
5
39,321
thread by: James Foreman | last post Oct 3 '06 by: Hugo Kornelis
Hi, I'm coming back to Sql Server after 4 years away, using other RDBMS, and there's a few things I'm struggling to remember how to do (if I could do them in the first place...) Main amongst those is EXCEPT syntax. In DB2, if I have two sets of data and I want to exclude the second set from the first, I can do:
3
39,263
thread by: laurenq uantrell | last post Oct 3 '05 by: laurenq uantrell
I am trying to install SQL Server 2000 on a Win2K OS machine but I get this error message: "A previous program installation created pending file operations on the installation machine. You must restart the computer before running setup." I see others have had this problem but have fixed it using the solution in:
4
39,157
thread by: Chris | last post Jan 26 '06 by: Chris
Hello, I am attempting to build a MS SQL query that will return data from "today"; today being current day 8:00AM-10:00PM today. My goal is to return the data from a table that is written to throughout the day, the query will provide the current grade of service in our call center. I am having difficulty defining my where clause: - I...
1
39,141
thread by: Marcus | last post Jul 20 '05 by: Simon Hayes
I have a database containing my own tables and data and I wanted to be able to query this against an accountancy program which has an ODBC driver. This was never a problem with MS Access and Jet but I hit Jet's limitations and have moved to SQL. Creating my own SQL database was no problem, but I was unsure of the best way to be able to be...
6
39,133
thread by: Dave | last post Jul 20 '05 by: mswida
I have a stored procedure in sql 2000 that requires steps to be fully completed before moving to the next command in the procedure. I have tried to place the word "GO" after each statement. When I create the procedure then take a look at it through em, it only shows the code up until the word "GO". Example: CREATE PROCEDURE mytest as...
8
38,992
thread by: pratha | last post Aug 19 '09 by: fadhilomer
Hi, i have a problem received from my client saying that she received an error that say : An exception occurred while executing a Transact-SQL statement or batch. There is no error code given in the error message. There is a additional infomation given: Timeout expired. timeout period elapsed prior to completion of the operation of the server...
2
38,805
thread by: chudson007 | last post Jul 23 '05 by: chudson007
I've got a data set on which I'm trying to perform the same as excel's vlookup formula using SQL, but do not know how. Can anyone help? If you picture me having two tables Table_A and Table_B and they look like this; Table_A Name Sport John Football John Rugby Steve Cycling
3
38,769
thread by: Arielle | last post Mar 27 '08 by: ryan0223
Greetings! I'm using classic ASP and an insert statement to save bulletin messages to a database that can be updated or viewed later. At first I thought it worked perfectly so I took some sample messages and one of them kept erroring out. I've pretty much determined that it hates the ' character.. and I'm sure it'd hate other special...
1
38,577
thread by: Justin Wong | last post Jul 20 '05 by: Simon Hayes
CREATE PROCEDURE dbo.Synchronization_GetNewRecords ( @item varchar(50), @last datetime ) AS SET NOCOUNT ON
4
38,542
thread by: Dave | last post Nov 2 '05 by: Hugo Kornelis
Can you create a unique constraint on multiple columns, or does it have to be implemented as a unique index? If possible can someone please post some sample code? Thanks,
2
37,749
thread by: T.S.Negi | last post Jul 20 '05 by: T.S.Negi
hi, I have data like 0, null or some value in one column. I want to use this column for devision of some other column data. It gives me devision by 0 error. how can I replace all 0 and null with 1 in fly.
2
37,632
thread by: raghutumma | last post Oct 12 '07 by: Dan Guzman
Hi, How can we execute SQL Scripts using Batch file??? i think Batch file should contain Username,Password,Database and Scripts... Using that file scripts should run... How can i give UserName,Password,Database and all those things?
2
37,614
thread by: jbmccluskey | last post Jul 23 '05 by: jbmccluskey
I'm a newbie so please be gentle. In attempting to run a restore I get the following error message: "Exclusive access could not be obtained because the database is in use." However, it doesn't appear that there are any connections to the database. At the suggestion of another thread, I ran sp_who2 and there are no connections to the...
2
37,603
thread by: Abdul N K | last post Jul 23 '05 by: Erland Sommarskog
I need help in T-SQL. I am using DATEADD function and I want to add 6 months to a date. But it does not return me the rusults, which I want e.g. SELECT DATEADD(m,'20040630') returns 20041230 which is logical correct? But I want it to return end of month (i.e. 20041231) Any help in this context will be highly appreciated
13
37,542
thread by: BobLewiston | last post Jul 15 '09 by: MrMancunian
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 have installed SQL Server...
1
37,536
thread by: George Hill | last post Jul 20 '05 by: Simon Hayes
Hi I am trying to import several master detail records from files to ms sql server. I have orders file and order_items file that has several rows for each order. If I insert programmatically these records how can find out which order ID was the last inserted, so that I can attach the subsesquent row items to a proper order.
7
37,311
thread by: sukeshchand | last post Mar 23 '10 by: jtipsword
any body have an idea abou how to wirte a function for formating a numeric field. Ex: In my table the TotalAmout is a numeric field. if i use (Select TotalAmount from Table1) then query will return numbers like Totalamount ---------------------- 12232.88 23233.22 23559.99 32434.99
3
37,156
thread by: KathyB | last post Jul 20 '05 by: Shervin Shapourian
Hi, I have 2 tables: tblStations StationID Station tblStationUser RecordID UserName Station I'm trying to come up with a dataset that contains the
3
37,080
thread by: ree32 | last post Jul 20 '05 by: Hugo Kornelis
For a SQL statement in an Alias column I am am combing several columns. But I am having problems with one column as it is a smallint. I get this error Syntax error converting the nvarchar value to a column of data type smallint My Sql statement "
12
37,047
thread by: sukeshchand | last post Feb 11 '10 by: Mc1brew
I want to exicute a Query that stored in a variable. and the Query is used to get a given value to a variable. I tried to use exec command but that returns an error. i cant get an idea for how to do the SQL commands are given bellow This line is used to generate the required query and stored to a variable @mnvcSQL select @mnvcSQL='Select...
11
37,010
thread by: serge | last post Jan 27 '06 by: Hugo Kornelis
When i debug a trigger is it possible to add a WATCH on the INSERTED or DELETED? I think not, at least I couldn't figure out a way to do so. Does someone have a suggestion on how I can see the values? I did try to do something like INSERT INTO TABLE1(NAME) SELECT NAME FROM INSERTED
2
36,964
thread by: Eric Bragas | last post Oct 23 '06 by: Eric Bragas
Hi, I've installed SQL 2005 and failed to change the default data location during installation. Now I want to change it. Can I do this without having to uninstall and reinstall? And furthermore, is there a system stored procedure I can use to move existing data and log files (master, msdb, AdventureWorks, etc.)? I seem to remember doing...
14
36,958
thread by: Andre | last post Aug 25 '05 by: Hugo Kornelis
Hello Can anyone help me translate this from access so that it can work in mssql (i need to get next value, but cannot use identity as if row is deleted, another must get new next column number which would be same as deleted one) Access; INSERT INTO table SELECT (IIF(code<>Null,MAX(code)+1,1) AS code, 0 AS usercode FROM table

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.