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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 basic query

Author  Topic 

sqlneofito
Starting Member

16 Posts

Posted - 2010-03-29 : 15:39:35
Hello all,
I'm new to sql2008, Sorry for this I know it should be easy but can't do it, I'm trying to write a procedure that inserts new records to the the AAA table I've created two character parameters, how can I do to check if @parameter1 and @parameter2 check ok compared to a column in a BBB Table.
Thank you so much in advance.

namman
Constraint Violating Yak Guru

285 Posts

Posted - 2010-03-30 : 14:04:53

I've created two character parameters, how can I do to check if @parameter1 and @parameter2 check ok compared to a column in a BBB Table.


Could you explain more detail?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-30 : 14:21:54
seems like

INSERT INTO AAA (columns...)
SELECT columns...
FROM BBB
WHERE Col1 = @Param1
AND Col2=@Param2

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -