SQL Sever, NewID ()

M

mr.Hyde

Hi,
I am working with mscrm database. the Accounts has UniqueIdentifierID,
so I am trying to use as parameter value in sqlcommand "NewId();", it doesnt
works becouse,
ExecuteNonQuery pass my parameter as "NewId();" - with quotas. How I can
remove quotas from this command?

Regards
Hyde
 
J

Jester98x

mr.Hyde said:
Hi,
I am working with mscrm database. the Accounts has UniqueIdentifierID,
so I am trying to use as parameter value in sqlcommand "NewId();", it doesnt
works becouse,
ExecuteNonQuery pass my parameter as "NewId();" - with quotas. How I can
remove quotas from this command?

Regards
Hyde

mr.Hyde,

Could you provide a snippet of code for us to look at? Without seeing
how you are coding this it's not easy to suggest a solution.

Cheers,
Steve
 
B

bruce barker \(sqlwork.com\)

you can't because sqlserver doesn't allow expressions or fuction as
parameters. newid() is just a guid, so you can let the clr do it. define the
paramter as a UniqueIdentifier, and set its value to Guid.NewGuid()


-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top