Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 19th, 2005, 07:38 AM
Authorized User
 
Join Date: Aug 2005
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL Procedure problem

Hi,
I'm making a procedure that should insert text into a database.
how do I call a table named user.

User is built in command in sql. It didn't work with "user" how should I do it
 
Old September 19th, 2005, 11:45 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Don't use reserved names. Change the name of the table.

mmcdonal
 
Old September 19th, 2005, 12:36 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

If you must use reserved names (mmcdonal is correct - don't do it), you can enclosed them in brackets:
Code:
INSERT INTO [user] ...
While this will work, it really isn't a good idea, and I can guarantee that the use of a reserved word as an identifier will cause you a problem, someday, somewhere, and it is almost virtually certain it (or some unintended side effect) will occur at 2:00 am ...

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't See SQL tables and Stored Procedure azambee SQL Server 2000 1 October 24th, 2008 01:03 PM
PL/SQL Procedure madhav007 Oracle 1 May 29th, 2005 01:22 AM
procedure in SQL kBusby SQL Language 1 January 26th, 2005 10:44 AM
Sql server Stored procedure ranakdinesh BOOK: Professional C#, 2nd and 3rd Editions 2 May 29th, 2004 12:08 AM
SQL Stored Procedure... babloo81 SQL Server ASP 1 December 8th, 2003 03:38 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.