Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
phaze
Starting Member
42 Posts |
Posted - 2005-03-16 : 12:40:39
|
| create procedure COB_GetMotiveResults@motive varchar(10)asselect account, amount, motivefrom COB.dbo.transif @motive = nullraiserror 'There was a problem' where motive = @motiveand account!= 0and amount != 0and motive != 0i get a syntax error on the raiserror line. can you explain why? |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-03-16 : 12:45:00
|
well of course you did. you put it between a from and where.so what are you trying to do?Go with the flow & have fun! Else fight the flow |
 |
|
|
phaze
Starting Member
42 Posts |
Posted - 2005-03-16 : 13:07:51
|
| well this is my original scriptcreate procedure COB_GetMotiveResults@motive varchar(10)asselect account, amount, motivefrom COB.dbo.transwhere motive = @motiveI'm trying to learn how to make it not allow nulls and return non zeros.I would also like to learn how to make user friendly error messages if COB.dbo.trans doesn't exist. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-03-16 : 13:08:02
|
| create procedure COB_GetMotiveResults@motive varchar(10)asselect account, amount, motivefrom COB.dbo.transwhere motive = @motiveand account!= 0and amount != 0and motive != 0if @@ROWCOUNT=0raiserror 'There was a problem' maybe?Kristen |
 |
|
|
|
|
|