Skip to content

Tag: sql-server

Counting totals on two separate SQL tables

I have two (identical for this purpose) tables ToDoList DoneList I’m trying to get a count from each of these per [ItemBatch] but not sure if that’s actually possible in one query? Separately I’d just do and assign to variables in the front-end so I could get the following: Is there a query …

String formatting issue for creating the SQL query for BCP

I want to use some of the static data to the new BCP query and export the extracted data to CSV. The static data are generated as a result after running some BCP command earlier. But I have been facing string formatting issue for creating the SQL query using those variables and generate a SQL command. I simpl…