all groups > sql server programming > september 2005 > threads for saturday september 17
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
BCP Problem
Posted by Joe Delphi at 9/17/2005 10:55:05 PM
Hi,
I am trying to bulk copy a text file into a table and I get this error
message:
SQLState = 28000, NativeError = 18452
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'Test Login'. Reason: Not associated with a trusted SQL Server connection.
I am pretty su... more >>
SQL 2000: Select all records in Table except those in a certain View
Posted by J.S. at 9/17/2005 10:52:26 PM
I'd appreciate any advice regarding what SQL code could accomplish this:
SELECT UserID From Table1
except where the UserID is also a Part of View1
Thanks,
J.S.
--
... more >>
Permission ?
Posted by Ed at 9/17/2005 9:34:02 PM
Hi,
I have a user call "user1" and he is in the db_denydatawriter role.
I have a stored procedure called "Testing1" like the following
Create Procedure Testing1
as
Update customers set country = 'Mexicos' where country = 'Mexico'
Then I grant him permission
Grant Exec on Testing1 to... more >>
Is there a beter way to do this?
Posted by DazedAndConfused at 9/17/2005 7:09:22 PM
It seems that nulls reek havoc for queries using variables (you have to use
'is' instead of '=' for null).
My objective is to check if a record is already on file to decide if one
needs to be added or if it already exists before continuing the procedure.
I know I could try to insert it an... more >>
Getting most recent value
Posted by Ada at 9/17/2005 4:19:01 PM
Hello All,
I have a table with 6 column; week1-5 and month. Month column should be
equal to the most recent column within week1...to..week5 column. If there is
a value on week5 then month = week5, else week4....till week1.
There can be null, blank, 0 or values on any of the week columns.
... more >>
SQL Query Question
Posted by Peri at 9/17/2005 1:54:51 PM
I am having 3 tables Table1, Table2 and Table3 with the following schema and
values
CREATE TABLE Table1
(TableName VARCHAR(500),
FieldName VARCHAR(500),
UID INT,
TransactionNo INT)
GO
INSERT INTO TABLE1 (TableName, FieldName, UID, TransactionNo)
VALUES ('TABLE2', 'TABLE2.SecCode', 1, ... more >>
Does Table Exists
Posted by Mark Moss at 9/17/2005 12:17:56 PM
Gentlemen / Ladies
How can I check if a Temp Table exists, so that I can drop it?
Mark
... more >>
CREATE an INDEX when using CREATE TABLE?
Posted by DazedAndConfused at 9/17/2005 11:43:19 AM
Is there a way to create a index with create table when it is not a primary
key or unique?
Please see below, to see where I am getting lost.
I can create the index using the code below, but I can not see how to create
the index using CREATE TABLE.
drop table customer
-- Customer Table
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
t-sql join
Posted by Duncan Mole at 9/17/2005 11:27:01 AM
Hi,
Is it possible to join the result of a subquery? Something like;
SELECT * FROM EMPLOYEES EMP
JOIN (SELECT COUNT(*) FROM ORDERS WHERE EMP.EMPLOYEEID = O.EMPLOYEEID)
... more >>
Microsoft table design best practices
Posted by bshewan at 9/17/2005 10:50:02 AM
I remember viewing a Microsoft article (MSDN, i think) that gave a detailed
list of Microsoft's best practices for designing database tables. It
mentioned stuff like naming conventions, etc. but I'll be damned if I can
find it again.
Has anyone seen this article?... more >>
Stored Proc Question
Posted by Joe Delphi at 9/17/2005 9:35:14 AM
Hi,
I have a stored procedure, CLEAN_ACQ_REPORTS which calls another stored
procedure, SELECT_TPRD, both of which are shown below. The SELECT_TPRD proc
runs fine by itself and returns the correct string value. But when I nest
it inside of CLEAN_ACQ_REPORTS, it returns a NULL value. Why ... more >>
Like Query And Null Values
Posted by Rich at 9/17/2005 4:29:01 AM
I have a table on SQL Server where one column allows Null values (docMName)
and I'm trying to perform a like query using one parameter. When executed the
query fails to include rows with Null values for the docMName column. Is
there a way to include these missing rows? Any help would be greatl... more >>
Which is better? #temp tables or create/drop perm tables on-the-fly
Posted by Ali at 9/17/2005 2:00:15 AM
I have a web application where I often need to temporarily store data, do a
bunch of processing, counts, etc... and then the data is not needed anymore.
I know I could just use temp tables, but I'm wondering what are the
pros/cons of the alternatives. (Table variables are not an option in my
cas... more >>
Update Lock
Posted by Leila at 9/17/2005 1:51:33 AM
Hi,
In the description of Update Lock in BOL, it is mentioned that Update Lock
can eliminate deadlocks because only one transaction at a time can obtain
it.
Personally I'm not convinced by this logic. Can an Exclusive Lock be
obtained by two transactions at a time? What if there was such a rule... more >>
Assign T-SQL variables in dynamic SQL statement?
Posted by Joe at 9/17/2005 12:00:00 AM
I have a dynamic SQL statement in which I need to assign values to
variables.
SELECT @querystring = 'SELECT @rows = COUNT(*)
@pages = COUNT(*) / @perpage
FROM utbl' + CAST(@tableid AS VARCHAR(15)) + ' WITH (NOLOCK)'
EXEC(@querystring)
This doesn't work as it doesn't assign v... more >>
|