Feb 21, 2011

Execute SQL Action (Advanced SharePoint Designer 2010 Workflow Actions)

Execute a SQL statement from within a SharePoint Designer 2010 Workflow. The action and its source can be downloaded here.

Add “Execute SQL” Action to a SharePoint Designer 2010 Workflow


Configure the Action

  • SQL: The SQL statement that you want to execute. You could also use stored procedures e.g. “EXEC [test_Proc] @var1=N’test’ ”-You can use two special tokens in the statement that can not be inserted via the UI: [WebUrl] and [WorkflowInstanceId].
  • Provider: The .NET ADO Provider. Default is MS SQL Server (System.Data.SqlClient). You can use other providers like ODBC, Oracle…
  • Connection: The connection string e.g. “Server=localhost\SQLExpress;Database=test;User ID=sa;Password=P@ssw0rd”. Integrated Security is for security reasons not supported! You could either specify the password  in clear text or encrypted like described in [Encrypt Passwords for SharePoint Designer Workflow Actions].
  • Result: The first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
  • AppId: The The Secure Store Application ID. The Secure Store App have to define 2 Fields. One of type “User Name” and one of type “Password”. The Field Name doesn’t matter, important is the Field Type! You have to map the credentials of the SharePoint Service Accounts (AppPool/owstimer.exe). The secure store option will only works with SharePoint Server not with Foundation! In order to use the credentials in the Connection String you can use the token {0} for the User Name and {1} for the password. E.g. “Server=localhost;Database=test;User ID={0};Password={1}”


Simple insert statement.
Configuration of “Execute SQL”
  • SQL: INSERT INTO MyTable (Column1, Column2) VALUES ([%Current Items:ID%],’[%Current Items:Title%]’)
  • Provider: System.Data.SqlClient
  • Connection String: Server=localhost; Database=MyDatabase;User ID={0}; Password={1}
  • Secure Store AppId: DBCred ({0} in the connection string will be replaced with User Name and {1} with Password defined in the Secure Store App)
  • Output: Workflow Variable “Result” (will return 0)
Wiki Documentation


olive said...

First I would like to appreciate you for the valuable information sharing with us. Thanks for making informative blog.SharePoint designer 2010: Provides the designers with their tools of choice for rapid development of SharePoint application

Brian said...

Hi Christian,
Is it possible to use the execute SQL WF action to update a documents content type? For example I have all of my content types in a choice column. I want to set the actual content type to the value in that choice column. Is that possible? I keep getting syntax errors and everything looks right. Thanks.

Anonymous said...

i have deploy the wsp as global but i neither see ilovesharepoint feature to active nor in my sharepoint designer action

Christian said...

Seems that something with the deployment went wrong. Any log entries?

Simon said...

Hi Christian,

Is it possible to execute a workflow that contains this action automatically (on list item creation or update) or does it have to be manually started? Thanks!

Web Designer said...

I am really impressed by this blog!Very clear explanation of issues is given and it is open to everyone.It contains true and fair information. Your website is very useful.

Seo Expert Web Services said...

The information and the detail were just perfect. I think that your perspective is deep, its just well thought out and really fantastic to see someone who knows how to put these thoughts down

digital signature software said...

It's wonderful that you devote time to articles like this where so many people can truly benefit. Thanks !

Xj Cheng said...

Even added difficult to chanel replica ascertain are what is frequently referred to as "frankenwatches." These timepieces,which cover Citizens,are accumulated from apparatus of different watch brands.The Rolex Oyster Perpetual is a archetypal watch that never goes out of style.This is a time section that has been to the acme of Mount Everest,sunk into replica watches the Pacific Ocean and broiled to 500 degrees F,and it still looked and performed great.Retail amount for a Rolex is $5,000 to $10,000,so bethink the adage,"You get what you pay for" if your acquaintance tells you he can get you one for just $1,000.One of the a lot of affecting realities about online replica handbags is louis vuitton replica that they are alleged as the affluence artist replica handbags.Replica handbags or actor handbags appeal is ascent these canicule maybe because the abridgement is still down or there are abounding barter that do not wish to absorb their money on cher affluence artist brands.Today,these kinds of handbags can be begin just gucci replica about anywhere there are even accessible in beating off food and arrangement stores.Surely,replica handbags attending like the 18-carat designs of affluence accoutrements that they wish to archetype or imitate.The decidedly cheaper amount of actor accoutrements is usually one of the affidavit why there are abounding humans abnormally the women buy them.Anyway,some replica handbags are superior backpack and a lot of of them are able-bodied fabricated and actor the attending of the branded ones.

Hug Day said...

hug day 2016 Images
happy hug day 2016 Date SMS Messages Quotes
Hug day Celebration Ideas For Him/Her
hug day sms for gf

dongdong said...

stephen curry shoes
canada goose jackets
michael kors outlet
michael kors uk
nike tn
babyliss flat iron
michael kors outlet
michael kors watches
coach outlet
polo ralph lauren outlet
michael kors outlet online
oakley sunglasses
nike air max
coach outlet online
coach outlet
burberry outlet
christian louboutin uk
reebok uk
michael kors outlet
coach factory outlet
christian louboutin uk
hermes belt
hollister co
cartier glasses
pandora jewelry
fitflops shoes
louis vuitton outlet online
oakley store
valentino store
hollister sale
canada goose uk
coach outlet online
louis vuitton outlet
jordans shoes
coach outlet
kate spade outlet
toms shoes
armani exchange

风骚达哥 said...

20160423 junda
air jordans
cheap oakley sunglasses
kate spade outlet
adidas stan smith
ray ban sunglasses
michael kors outlet
nike air max shoes
cheap omega watches
yeezy boost 350
michael kors outlet online
michael kors outlet online
nike free runs
air jordan uk
michael kors outlet online
pandora charms
ray ban outlet
calvin klein outlet
fitflops sale clearance
toms outlet
nike huarache white
sac longchamp
toms outlet
michael kors outlet clearance
bottega veneta outlet
armani watches
gucci handbags
nike blazer
oakley sunglasses
true religion jeans
cheap jordans
ray bans
bottega veneta handbags
jimmy choo outlet
oakley sunglasses
prada outlet
reebok shoes
true religion
burberry outlet

Desty Lilian Rosana Putry said...

model meja belajar anak minimalis
warna cat rumah minimalis
model rak tv
model meja makan
taman kolam air
model pintu kamar mandi
model tangga rumah minimalis
warna cat pagar
desain tiang dan keramik teras
kursi sofa ruang tamu minimalis
model tempat tidur bayi
warna cat dapur
model atap rumah minimalis
model plafon minimalis
warna gorden ruang tamu
warna cat rumah tipe 45
model rumah idaman type 36

Libin Huang said...

20160426libinhollister clothing store
oakley sunglasses
michael kors handbags
tiffany outlet
ray-ban sunglasses
gucci outlet online
ray-ban sunglasses
burberry outlet online
coach outlet canada
ray-ban sunglasses
herve leger outlet
ray ban sunglasses sale
air max 90
oakley sunglasses
adidas wings shoes
michael kors outlet
michael kors factory outlet
louis vuitton bags
michael kors online outlet
nba jerseys
ralph lauren pas cher
oakley sunglasses
toms shoes
nike air max 90
nike tn pas cher
air max 90
lululemon outlet
nike air force 1
true religion outlet
michael kors outlet
burberry outlet store
ray ban sunglasses
kobe shoes
true religion outlet
discount michael kors handbags

Yuanyuan Lin said...

7.14llllllyuan"hollister shirts"
"true religion canada"
"true religion outlet"
"beats by dre"
"nike tn pas cher"
"ray ban sunglasses"
"tory burch outlet"
"mulberry handbags"
"prada outlet"
"michael kors outlet"
"tiffany outlet"
"louis vuitton neverfull"
"louis vuitton handbags"
"giuseppe zanotti shoes"
"nike uk store"
"michael kors wholesale"
"tiffany jewelry"
"michael kors outlet"
"ralph lauren pas cher"
"mulberry bags"
"nike air force 1"
"police sunglasses for men"
"gucci outlet online"
"ray ban sunglasses"
"jordan shoes"
"asics,asics israel,asics shoes,asics running shoes,asics israel,asics gel,asics running,asics gel nimbus,asics gel kayano"
"cheap jordan shoes"
"basketball shoes"
"fitflops sale"
"prada outlet online"
"ralph lauren polo"
"nike air max 90"
"omega outlet"
"lacoste shirts"
"longchamp outlet"

Fangyaya said...

fitflop sandals
polo ralph lauren outlet
rolex submariner price
michael kors outlet
christian louboutin wedges
ralph lauren polo
louboutin shoes
abercrombie and fitch outlet
coach outlet canada
michael kors outlet
gucci outlet online
cheap louis vuitton handbags
ray bans
cheap oakley sunglasses
copy watches
adidas nmd
michael kors handbags
oakley canada
cheap rolex watches
ray ban sunglasses wholesale
hollister kids
true religion outlet
burberry sale
nfl jerseys
burberry scarf
cheap air jordans
replica watches
coach outlet
oakley sunglasses wholesale
oakley outlet
michael kors uk
ray ban sunglasses
adidas outlet store
rolex watches for sale
cheap oakley sunglasses
adidas originals store
rolex watches
cheap true religion jeans
ralph lauren outlet
kobe 11 shoes

Justin said...

Number of keeping money organizations give school credits to help learners figure out how to pay for their scholarly costs. Before considering private school credits however, an understudy ought to attempt to profit by government school advances because of endowment. https://www.usacheckcashingstore.com/san-diego

marko said...

Be it for educational costs, paying lodging expenses, convenience, books and devices like PCs, for instruction and so forth. There is no confinement on the use of advance as long it is identified with the training itself. https://www.usacheckcashingstore.com/san-diego

Paulo said...

The requirements have an extremely contract definition that incorporates not more than essential necessities. For every single other need, understudies need to rely on upon outer sources like companions and moneylenders. https://www.usacheckcashingstore.com/san-diego

dada24 Xu said...

christian louboutin
true religion jeans
cheap mlb jerseys
nike store
longchamp handbags
cheap jordans
ralph lauren outlet
louis vuitton outlet
red bottoms shoes
louis vuitton bags

Studio 45 Wedding said...

An impressive share! I’ve just forwarded this onto a co-worker who
has been conducting a little homework on this. And he actually bought me dinner
because I stumbled upon it for him… Ahli dan Pakar SEO di Indonesia lol. So allow me to reword this….
Thank YOU for the meal!! But yeah, thanks for spending some
time to discuss this subject here on your web page.

John said...

michael kors outlet canada
kd shoes
longchamp handbags
north face jackets
ralph lauren uk
coach outlet store online
christian louboutin sale
burberry outlet
pandora bracelet
ugg outlet
ray ban sunglasses outlet
canada goose coats
coach factory outlet online
coach factory outlet online
yeezy boost
red bottom shoes for women
longchamp outlet store
gucci outlet online
canada goose jackets
true religion uk
cheap nike shoes
pandora charms sale
burberry outlet online
nike air force
ugg outlet online
cheap ray ban sunglasses
cheap oakley sunglasses
polo ralph lauren
true religion outlet store
ugg boots outlet
mlb jerseys

Meiqing Xu said...

ugg boots on sale
converse outlet
rolex daytona
polo ralph lauren outlet online
coach outlet
cheap nfl jerseys
timberland boots outlet
rolex watches
true religion jeans
gucci outlet

chenmeinv0 said...

michael kors
nike air max 2017
longchamp handbags
timberland boots
adidas trainers
converse shoes
mizuno running shoes
ray ban canada
true religion outlet
cheap jordan shoes