Archived Months
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
all groups > sql server new users > march 2005

Filter by week: 1 2 3 4 5

Update at group
Posted by Philip L Holmes at 3/31/2005 2:08:22 PM
Is it possible to update for a group statement, I want to do the following but keep getting errors : CREATE PROCEDURE ARCustomerRebalance AS begin update cust_detail set curr_bal = (select(sum(ar_master.bal_amt)) from cust_detail, ar_master where (cust_detail.cust_code = ar_ma...more >>


add "order" col in query?
Posted by r at 3/31/2005 9:52:36 AM
How can I create a column in a query that simply creates an number listing the order of the rows? Row 1 would contain 1, 2 would contain 2, etc. I need to sort a table based on a bunch of fields and then "rank" the results. Thanks. ...more >>

Casting as datetime
Posted by Christoph at 3/31/2005 7:46:08 AM
I can do the following SELECT CAST( '20050331' as datetime) and I will get back 3/31/2005 How can I format the string being cast to include the time as well? I've tried SELECT CAST( '20050331T115959' as datetime) SELECT CAST( '20050331115959PM' as datetime) SELECT CAST( '2005033123...more >>

Querie & subquerie
Posted by Luiz Horacio at 3/30/2005 4:38:03 PM
Hi, I'm trying to create a subquerie but it is returning a weird result. Queries: Querie 1: select grupos_tipos from tipo where num_abs = 8 Result 1: 33010013,33010021,33010030,33010048,33010056,33010064 Querie 2: select mne from laudos_amb where codigo in ...more >>

Max() question
Posted by r at 3/30/2005 4:30:14 PM
I have a table with the following fields: ID SalesAmt SalesMonth Every month the table gets updated with sales values from the previous month. If a particular ID doesn't have sales, there is no record. I need a query/view showing ONLY the records for the latest month posted for each ID....more >>

how to refer to col names?
Posted by r at 3/30/2005 1:27:11 PM
I am creating a VIEW, and in it I can successfully create a column named YTD_OSO. The data in this column is created by doing calculations on two other fields that are money-type (in another test they were float). So far, so good. See snip of code below: CASE WHEN aipdn.D017_all.YTD_TotO...more >>

why cannot just backup the log
Posted by Michael at 3/30/2005 11:35:54 AM
When I tried to backup the log of the database, found the option for backup log is disabled, why this happened? ...more >>

Modify sp_helpdb output
Posted by isabelle at 3/30/2005 11:31:11 AM
Hi, Is there any way to modify the output of sp_helpdb? Sometimes I would like to run it and only see a few of the columns instead of the complete output so I can save to a file for reporting purposes. Is there anyway to specify what columns you want it to return instead of everything? ...more >>



error converting varchar to col of data type int
Posted by r at 3/30/2005 11:28:09 AM
I'm finally getting somewhere, but getting an error message and not sure how to get around it. I'm guessing it's a text/numeric issue, but not sure what to do to fix it. Anyone know what I can do? Here's the message: Server: Msg 245, Level 16, State 1, Line 1 Syntax error converting the v...more >>

Error handling
Posted by Ramakant at 3/30/2005 10:31:31 AM
hi, I am sort of new at this...is there a way of handling errors using try..catch in sql server? I know of @@error and @@rowCount but is there an option for try-catch kind of stuff? thanks in advance. Ramakant ...more >>

Cross-database relationships
Posted by TJ LaPierre at 3/30/2005 7:33:05 AM
Can this be done or do all of your company tables have to be put into one large database? I can't find anything in the SQL Help files. -- Hey, I've got some books and I'm doing my best......more >>

Best way to insert data to MSDE
Posted by Eli at 3/30/2005 2:01:02 AM
Hello. I'm creating a stand-alone windows application using the MSDE server. Performance issues in this application are big-deal to my client. I need to insert data to the database in rate of – 2MB / sec. Each insert action should insert ~ 10-40 MB to the database. My questions are: 1. Wha...more >>

help with CASE
Posted by r at 3/29/2005 9:48:36 AM
Hello, I posted yesterday not understanding why the sql from Access wasn't working in sql. As was explained, IIF doesn't exist in sql and I must use CASE. I have looked through the link that was provided, and see the samples use other statements like "Use" and "Go" and it doesn't look like I...more >>

SQL Server 2005 Hands-On Labs Material
Posted by AA at 3/28/2005 7:30:51 PM
I would like to download the SQL Server 2005 Hands-On lab material. I downloaded and installed SQL Server 2005 and the SQL Server 2005 Beta 2 Resource DVD. I never got the following directory structure that is referenced in the hands-on labs: C:\SQL Labs\.... The download location of the ...more >>

VIEW sql not translating from Access
Posted by r at 3/28/2005 6:10:36 PM
I am very new to sql, and have been managing by making queries in Access and tweaking the sql as needed. This one I can't figure out, though. It seems to not like my ">" or "<" . Getting "incorrect syntax near '<'." What's wrong?? Thanks in advance. SELECT TOP 100 PERCENT aipdn.Data0...more >>

Registering a server
Posted by JToledo at 3/28/2005 5:19:08 PM
Hello, I am totally new to SQL Server and need to learn from ground zero. So I downloaded the SQL Server 2000 Evaluation Edition, and would like to get a feel for the software. Can I work with this without having a dedicated server. I currently work with Microsoft Access and work off our co...more >>

moving up to SQL from A2k
Posted by JohnE at 3/27/2005 8:03:01 PM
I am a NEWBIE at this as I am stepping up from A2k. In A2k the autonumber used as the primary key allows formatting in which text can be used. Does MS SQL Server 2000 allow it as well? If so how does one go about it? Several A2k databases are also being considered for upsizing and they hav...more >>

PROBLEM WITH SQL QUERY STATEMENT
Posted by Radharaj at 3/27/2005 7:13:01 PM
Hi I am getting an error message from the following query using Crystal reports 8.5,win98OS,SQL Server 2000. Your help is really appreciated Error message : Syntax error near }. Can I use oj syntax twice in a query??? SELECT DISTINCT National_Oxygen_TEST_Customer."Name", Nation...more >>

Summary count
Posted by Phil Holmes - ITP at 3/26/2005 4:09:01 AM
Can anyone advise me of the syntax for getting a summary count ? This is a sample of the procedure if you can help, CREATE PROCEDURE PlannedPaymentas begin delete from pp_detail delete from pp_master insert into pp_detail(FULL_CHECK,VENDOR_CODE,TRANSACTION_NO, TRANS_AMT,disc...more >>

Rollback entire procedure
Posted by Phil Holmes - ITP at 3/26/2005 3:57:01 AM
Is it possible to add an instruction to rollback the entire procedure, if any part of the procedure fails ?...more >>

PROBELM WITH SQL SELECT QUERY STATEMENT
Posted by raj at 3/26/2005 1:51:01 AM
Hi i am running the following query generated using crystal reports 8.5 designet,win98,sql server 2000. i get the following error message. i am not sure where i could put the alias for the table "The column prefix sales_cr_memo_header does not match with a table name or alias used i...more >>

SQL Query Progress
Posted by -Ldwater at 3/25/2005 4:05:03 AM
Hi all, Im writing a product using MS-SQL, using a Magic as my programming language. When I execute a large process (such as a backup, or a long running query) through a Magic task, the user has to sit through a blank screen while it runs though processing. The problem is that the task ...more >>

New user SqlServer
Posted by Chemlali Fouad at 3/24/2005 4:47:02 PM
hi :) ! hello every body i want to learn Sql Server so plz i want to know how to do create a new table in sql server if any one help me and also give me site about sql server because i want to learn it and to be very well of sql Server ...more >>

Generating test data
Posted by James at 3/24/2005 11:09:23 AM
Are there any good tools in SQL Server 2000 for generating test data to populate a database? Or do I have to look for third party solutions? Any suggestions welcome. Jim ...more >>

How to change Database name in SQLServer?
Posted by zlf at 3/23/2005 4:38:01 PM
I want to change some Databases' name. But the only way I know is backup the database, and change another name when recovering it. Is there any other way that is easier than that below? thanks zlf ...more >>

SQL Enterprise manager.. <long text>
Posted by TriAdX NO[at]SPAM aol.com at 3/23/2005 11:19:03 AM
does anyone know how to get SQL Enterprise manager to display a field that currenly shows <Long Text>. Is there a Cache setting some where ... or another way to get it to display those fields with TONS of data? i want to edit the data through Enterprise manager but cant when it shows <long...more >>

Arithmetic overflow error - in a changed table!
Posted by volps NO[at]SPAM hotmail.com at 3/23/2005 7:23:17 AM
Hello. I had a table with identity column set to datatype [smallint]. I've reached near 32800 records. That's the limit for [smallint]. So, I've changed the identity datatype to [int], that SHOULD allow me to have more records. But the error continues. "Arithmetic overflow error convertin...more >>

Any good book on SQL server (and MSDE) ?
Posted by N Thorell at 3/23/2005 4:13:07 AM
Any thin good book as an introduction to the SQL Server? Particularly I need a manual for OSQL and for security under Windows XP Pro. I have problems with managing accounts, permissons and remote data connectivity....more >>

OPENROWSET returns only one row
Posted by RogerC at 3/22/2005 10:24:34 PM
Hi, I am trying to access data from a Sage Line 100 database to populate tables in SQL 2000. If I use the following syntax in Query Analyser I only get the first row of a table returned: select * FROM OPENROWSET ('MSDASQL','DSN=SageLine132',UID=admin;PWD=;','select * FROM STO_DEPOT_NA...more >>

SEARCH and REPLACE!
Posted by TriAdX NO[at]SPAM aol.com at 3/22/2005 3:09:02 PM
ok i am basically searching a field for a piece of text then replacing it with new text heres what i have (it works BUT) UPDATE tablename SET columnname = REPLACE ((SELECT CAST(columnname AS varchar(8000)) AS columnname), 'text looking for', 'new text') that will work.. however, t...more >>

How to work with Binary data
Posted by Jim at 3/22/2005 1:31:13 PM
Could anyone direct me to the " how to use binary data"? Thanks, Jim...more >>

Account problem when creating a new publication
Posted by DaveM at 3/21/2005 10:51:24 AM
I've got SQL Server Developer installed on my laptop. I'm trying to get merge replication to work, but when I try to create a new publisher, when I select the option to make SQL Server on my laptop its own distributor, I then get an error msg. saying I've chosen a local system account, and ...more >>

Change datas of a virtual column
Posted by elime4x NO[at]SPAM hotmail.com at 3/21/2005 10:47:35 AM
Hi all We created a virtual column in a SQL-VIEW. We now want to change some of the rows of this virtual column, but it doesn't work with a normal UDPDATE statement. Not sure why :( Question 1: Is it possible to change datas of a virtual column Question 2: What is the SQL-statement for that? ...more >>

How do I run a SQL script?
Posted by DaveM at 3/21/2005 10:33:26 AM
I have a *.sql file that will create a database. I've found how to create one, but how do I execute this file. Dbl-clicking will only open the file in notepad. ...more >>

Can't attach to database...
Posted by Homer J. Simpson at 3/21/2005 9:19:49 AM
Hi all, I have a small database file I created a few months ago--I don't remember the details of what happened when I created it, but suffice it to say, I've been using it without any problem. For some reason, the file doesn't have an .MDF extension (the filename is simply "toolbar"), and ...more >>

Sqlserver as workstation: when & for whom is this ever appropriate?
Posted by Frank B Denman at 3/21/2005 4:52:19 AM
I have a customer who needed SQL Server to support a new line of business application. SQL Server was terra incognita for me, but I read a couple of books and successfully installed SQL Server and the lob app on the existing Win2k server. Customer has one employee whose task it is to get al...more >>

Moving data between tables
Posted by Jason Williard at 3/20/2005 7:19:36 PM
I am currently using a stored procedure to delete users from our database who are considered inactive. This works great. However, we have decided that we want to archive these users to a identical (structure) table in the same database. To do this, I need to find an easy way to take the dat...more >>

backup copy of a table
Posted by ykffc at 3/20/2005 4:13:03 AM
What is the command (or steps) to make a copy of an existing table and how to restore it? Are there any tools at all that I could use to import external data (from a delimited text file, from an Excel file, from an Access Database) onto a SQL server Database?...more >>

which service pack my server has installed
Posted by ykffc at 3/20/2005 4:07:02 AM
It is nowhere in "about" menu choice. Can someone point me to the right direction? ...more >>

Invalid Object Name On DataAdapter
Posted by Arif Çimen at 3/19/2005 12:52:30 PM
Hi everyone, When configuring the dataAdapter, I see an error message. The SQL statement is: SELECT StokGiriþ.* FROM StokGiriþ The error message is: Invalid Object Name "StokGiriþ". What may be the reason? Thanks alot, Arif Çimen. ...more >>

Distributed databases
Posted by Reshma Prabhu at 3/19/2005 12:50:05 PM
Hello, I am new to distributed databases. I wanted to use stored procedures in distributed databases. If a view contains query in which tables from different servers are used, how should I reference them. For example Suppose me view is CREATE VIEW dbo.Example1 AS SELECT...more >>

Trying to use 'select if'
Posted by Philip L Holmes at 3/19/2005 11:03:16 AM
Can anyone tell me what is wrong with the following select if syntax ? insert into pp_detail(full_check,vendor_code,transaction_no,trans_amt, disc_amt,net_amt,disc_date, due_date,paid_amt,disc_tak, full_vend_inv,trans_type,sort_data) select full_check=bank...more >>

Null svrid in sysxlogin
Posted by Paul at 3/18/2005 3:17:02 PM
Somehow I have messed up my sysxlogin table in the master DB. the svrid for the 3 users I have is null and the name for the one login assigned a server is null. How can I fix this? ...more >>

Summary data
Posted by Philip L Holmes at 3/18/2005 10:51:07 AM
Is it possible to insert data into a table at group level with a count for the summary, for example : we want to create a summary record for customers in table customers, showing the name of the customer, and the total amount owed, and then a count no for the number of records added to the sum...more >>

Input command
Posted by Philip L Holmes at 3/18/2005 10:45:11 AM
Can anyone help me on the correct syntax to insert data from a text file into a table, using a stored procedure. In sybase we would have used the command : input into emp_interface from '\\\\itpsrv01\\multisoft\\reports\\pif.csv' format ascii thnks ...more >>

hands on labs material?
Posted by Luis Esteban Valencia at 3/18/2005 9:55:04 AM
Hello I just downloaded some hands on labs material of sql server 2005 but it references some files? Where can I get this? Note All of the code for this exercise is contained in the script file PIV_UNPIV.sql in the C:\SQL Labs\Lab Projects\T-SQL Lab directory. You can copy and pa...more >>

Generating a Post Script file from two tables in SQL Server 2000
Posted by Satish Chandrasekar at 3/18/2005 5:05:04 AM
Hi, I need to know how to generate a PS file from two table in SQL Server 2000. This is to generate printable bank statements for customers. The customer details are stored in one table and their corresponding transaction details are stored in the other. PS files are to be generated for t...more >>

raiserror problem
Posted by mporter at 3/18/2005 2:33:01 AM
I'm writing triggers and any occurance of RAISERROR that occurs after an update, insert or delete statement don't return an error to the calling application. I am talking to SQL Server through ADO. Mike......more >>

Trying to "merge" three tables
Posted by joeman at 3/17/2005 9:09:03 PM
How do I join three tables together that all have different columns? Viz: Table1 Table2 Table3 All have ID column There are many overlapping IDs in each table, but none of them matches perfectly (meaning all three tables have different numbers of records, some with the same ID acros...more >>

How to execute sp_addlinkedserver
Posted by TA at 3/17/2005 7:07:02 PM
Hi I am installing an application, that requires the SQL server name in a list, I know that the "local", is ussully used to get around this probelm but in this instance, my new application wants the name. The application gives me a message to run sp_addlinkedserver but this is a stored pro...more >>


DevelopmentNow Blog