all groups > sql server programming > february 2007 > threads for saturday february 24
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
Simple question.
Posted by Rudy at 2/24/2007 9:40:00 PM
Hello All!
Seem to be having a little problem with a syntax error on this.
UPDATE Bankroll
IF UserID IN (SELECT USERID FROM tblUserID WHERE Pass = '1')
SET NewCredit = Credits + Cast(@win as int)
ELSE
SET NewCredit = '0'
SQL tells me incorrect syntax near IF and near "="
Any though... more >>
trying to use sql server authentication
Posted by Bob at 2/24/2007 9:17:03 PM
.......but I'm getting this message...
Login failed for user 'sa'. The user is not associated with a trusted
SQL Server connection. (Microsoft SQL Server, Error: 18452)
Can anyone help?
... more >>
SQL how to ?
Posted by Rob at 2/24/2007 8:07:30 PM
I would like to know how to add the "RANK" column in the output of a view...
RANK Code Location SellDate C2 C3
1 ABC 01 2/1/2007 blah1 blah2
2 ABC 01 2/1/2007 blah30 blah40
3 ... more >>
restore trans log to another database
Posted by DBA at 2/24/2007 7:55:00 PM
I am having trouble restoring a trans log from mone database to another. I am
getting the following error:
Server: Msg 3135, Level 16, State 2, Line 1
The backup set in file 't:\formbkp\SRE0223TRANS.trn' was created by BACKUP
LOG and cannot be used for this restore operation.
Server: Msg 3013... more >>
Getting Max value of a common column after a JOIN
Posted by sanjusunny NO[at]SPAM gmail.com at 2/24/2007 6:23:45 PM
Am I missing something really obvious here? I have a couple of tables
each with a ModifiedDate column. My objective is to get the
Max(ModifiedDate) across all these tables after JOINing them based on
their FK relationships. How do I forumulate this query??
I'm lookig for something like:
SEL... more >>
Transact SQL
Posted by Jim Pockmire at 2/24/2007 5:34:18 PM
...looking for a recommendation for a book on learning Transact SQL (have
some familiarity through VBA).
... more >>
sp_helptext to single column with intentiation
Posted by Ganesh at 2/24/2007 3:55:10 PM
Hi there
Is there a way to store sp_helptext output to a table with all intentiation
which contains id field and text field.
it works if i use
insert into CaptureSpHelpText(desc) exec sp_helptext sp_name, but the stored
procedure stores in a single line rather than separate lines in th... more >>
Queryplan differs with simple values
Posted by Bobstar at 2/24/2007 3:00:02 PM
Hello...
Im having a hard time finetuning my queries. Im using SQL2000 Enterprise
with SP3.
I've a table with approximately 500.000.000 rows in and for some strange
reason I get different queryplans according to similar where clauses, take a
look at this:
The Table1 has 2 indexes:
noncl... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
About subqueries?
Posted by Mervin Williams at 2/24/2007 1:01:33 PM
How can I sort the outer query of a query that includes a subquery in the
select clause? I need to step through the outer query by the descending
date. How do I do this?
Mervin
... more >>
If statement within Stored Procedure
Posted by vncntj NO[at]SPAM hotmail.com at 2/24/2007 12:30:45 PM
I want to create a procedure that applies the variables only if they
are passed. As it stands now, I have three variables, but only one
variable might be passed. Within the Stored Procedure, can I place
conditional statements for declared variables
Alter PROCEDURE ps_EmployeeSearch
@dep... more >>
query cost
Posted by Bob McClellan at 2/24/2007 11:04:09 AM
If 'AnswerA', 'AnswerB' & 'AnswerC' are the only possible params.
is
Where MyField <> 'AnswerA' more costly
than
Where MyField = 'AnswerB'
Or MyField = 'AnswerC'
....Does it make a difference?
thanks,
bob.... more >>
File details from sql server 2005 SP?
Posted by jobs at 2/24/2007 10:06:31 AM
I'm looking for a way to get file information for a non-database file.
Is master..xp_cmdshell the only way to do this in SS 2005?
There use to be something called getfiledetails or something.. what
happened to it?
... more >>
select last record for each customer
Posted by zmsaadeh at 2/24/2007 7:28:51 AM
I have table with many recodrs as this table:
customerID Date Stock1 Stock2 Stock3 Stock4
112105222 22/01/2006 5 6 2 1
112105222 23/05/2006 4 8 6 7
112105222 01/02/2007 6 9 ... more >>
Dynamic SQL
Posted by morphius at 2/24/2007 7:16:00 AM
In the code below, the DatabaseName and table_id are variables. The table_id
is OK with the @table_id. But, how do I make DatabaseName equal to @db so
that I can pass it to the parameter @database. In other words, how do I
concatenate so that it will be something like this @db.dbo.tblName. Wi... more >>
Source for SQL Server syntax
Posted by Jim Pockmire at 2/24/2007 12:00:00 AM
...looking for a concise source of SQL Server ssyntax (functions, structure
to create a select statement for a query and stored procedure)..have worked
a lot with MS-Access and VB but find that SQL Server is quite different.
... more >>
|