Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft SQL Server > Re: How can I a...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 4 Topic 10948 of 11409
Post > Topic >>

Re: How can I avoid using a cursor here?

by teddysnips@[EMAIL PROTECTED] Apr 9, 2008 at 07:33 AM

On 9 Apr, 13:08, "Dan Guzman" <guzma...@[EMAIL PROTECTED]
>
wrote:
> > Any thoughts on a better method?
>
> You can use a CROSS JOIN to insert a row per PinNo as a set. =A0For
exampl=
e:
>
> INSERT INTO tblTimesheetInputDetail
> =A0 =A0 (
> =A0 =A0 fldPinNo,
> =A0 =A0 fldPayrollYear,
> =A0 =A0 fldPayrollWeek,
> =A0 =A0 fldPayrollDate,
> =A0 =A0 fldEntryType
> )
> SELECT
> =A0 =A0 tblBatchTimesheetInputDetail.fldPinNo,
> =A0 =A0 fldPayrollYear,
> =A0 =A0 fldPayrollWeek,
> =A0 =A0 fldPayrollDate,
> =A0 =A0 fldEntryType
> FROM dbo.tblBatchTimesheetInputDetail.fldPinNo
> CROSS JOIN dbo.tblBatchTimesheetPinNos
>
> --
> Hope this helps.
>
> Dan Guzman
> SQL Server MVPhttp://weblogs.sqlteam.com/dang/

Superb - thanks very much.

Edward
 




 4 Posts in Topic:
How can I avoid using a cursor here?
teddysnips@[EMAIL PROTECT  2008-04-09 04:46:31 
Re: How can I avoid using a cursor here?
"Dan Guzman" &l  2008-04-09 07:08:32 
Re: How can I avoid using a cursor here?
teddysnips@[EMAIL PROTECT  2008-04-09 07:33:34 
Re: How can I avoid using a cursor here?
--CELKO-- <jcelko212@[  2008-04-09 13:49:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 15:25:42 CDT 2008.