c# Programming Glossary: tsql
Can you convince a DataContext to treat a column as always dirty? http://stackoverflow.com/questions/1560513/can-you-convince-a-datacontext-to-treat-a-column-as-always-dirty currentUser ctx.SubmitChanges uses auto generated TSQL This is fine but if the same user updates it twice in a row.. updates it twice in a row the UpdatedBy is a NOP and the TSQL will be roughly UPDATE dbo . Customers SET SomeRandomColumn..
Formatting numbers with significant figures in C# http://stackoverflow.com/questions/158172/formatting-numbers-with-significant-figures-in-c-sharp liked. Rounding to significant figures is a lot easier in TSQL where the rounding method is based on rounding position not.. the case with .Net math.round. You could round a number in TSQL to negative places which would round at whole numbers so the..
Capture Stored Procedure print output in .NET http://stackoverflow.com/questions/1880471/capture-stored-procedure-print-output-in-net in .NET Is it possible to capture print output from a TSQL stored procedure in .NET I have a lot of legacy Procs that use..
How can I programmatically check (parse) the validity of a TSQL statement? http://stackoverflow.com/questions/3084387/how-can-i-programmatically-check-parse-the-validity-of-a-tsql-statement can I programmatically check parse the validity of a TSQL statement I'm trying to make my integration tests more idempotent...
string to DateTime conversion in C# http://stackoverflow.com/questions/336226/string-to-datetime-conversion-in-c-sharp But that is fine since you should be using parametrized TSQL anyway so just add the DateTime as the value of a DbParameter.. unambiguous way don't use string concatenation to build a TSQL command DbParameter param cmd.CreateParameter param.ParameterName..
How to monitor SQL Server Agent Job info in C# http://stackoverflow.com/questions/3757335/how-to-monitor-sql-server-agent-job-info-in-c-sharp jobs using T SQL View and disable SQL Agent Jobs with TSQL The script will list out all your jobs on your database and..
Escape double quotes in SQL 2005/2008 http://stackoverflow.com/questions/387198/escape-double-quotes-in-sql-2005-2008 try. Personally I'd do this inside the DB since this is a TSQL implementation detail. Likewise ' needs to be doubled to ''..
LINQ to SQL using GROUP BY and COUNT(DISTINCT) http://stackoverflow.com/questions/448203/linq-to-sql-using-group-by-and-countdistinct ctx new DataClasses1DataContext ctx.Log Console.Out log TSQL to console var qry from cust in ctx.Customers where cust.CustomerID.. Console.WriteLine 0 1 row.Country row.Count The TSQL isn't quite what we'd like but it does the job SELECT t1 . Country..
C#, Linq2Sql: Is it possible to concatenate two queryables into one? http://stackoverflow.com/questions/569671/c-linq2sql-is-it-possible-to-concatenate-two-queryables-into-one and arr2 each only perform 1 database hit although the TSQL is different the first has an OR in the WHERE clause the second..
Compare nullable types in Linq to Sql http://stackoverflow.com/questions/586097/compare-nullable-types-in-linq-to-sql The first thing to do is to put on logging to see what TSQL was generated for example ctx.Log Console.Out LINQ to SQL seems..
How to get the TSQL Query from LINQ DataContext.SubmitChanges() http://stackoverflow.com/questions/637117/how-to-get-the-tsql-query-from-linq-datacontext-submitchanges to get the TSQL Query from LINQ DataContext.SubmitChanges I'm using Linq to..
Resolve: Use of SqlParameter in SQL LIKE clause not working http://stackoverflow.com/questions/665129/resolve-use-of-sqlparameter-in-sql-like-clause-not-working sample . In some ways it might be easier to have the TSQL just use LIKE @SEARCH and handle it at the caller command.Parameters.AddWithValue..
To return IQueryable<T> or not return IQueryable<T> http://stackoverflow.com/questions/718624/to-return-iqueryablet-or-not-return-iqueryablet the caller could add a non translatable function i.e. no TSQL mapping breaks at runtime the caller could add a filter sort..
What are C# lambda's compiled into? A stackframe, an instance of an anonymous type, or? http://stackoverflow.com/questions/8993426/what-are-c-sharp-lambdas-compiled-into-a-stackframe-an-instance-of-an-anonymo
Since there is no Sqlserver array parameter, what's the best way to proceed? http://stackoverflow.com/questions/1014571/since-there-is-no-sqlserver-array-parameter-whats-the-best-way-to-proceed doing all the processing work in the stored procedure in tsql This would involve combining all the values in the c# array.. into one comma delimited string and passing the string to tsql as a parameter then looping and breaking the string apart into.. rollback if necessary but very clumsy string processing in tsql. Or Option 2. Doing the looping in c# and passing the data as..
What is the connection string for localdb for version 11 http://stackoverflow.com/questions/10540438/what-is-the-connection-string-for-localdb-for-version-11 21 14 14 Instance pipe name np . pipe LOCALDB#B8A5271F tsql query This means that SqlLocalDb is installed and running correctly...
How to pass an array into a SQL Server stored procedure http://stackoverflow.com/questions/11102358/how-to-pass-an-array-into-a-sql-server-stored-procedure should be passed as parameter from C#. c# sql server tsql stored procedures share improve this question Since you..
What represents a double in sql server? http://stackoverflow.com/questions/1209181/what-represents-a-double-in-sql-server the responses so far. c# sql sql server sql server 2005 tsql share improve this question float Or if you want to go old..
Using StringWriter for XML Serialization http://stackoverflow.com/questions/1564718/using-stringwriter-for-xml-serialization the encoding to UTF 16 in the xml tag work then c# xml tsql serialization xml serialization share improve this question..
WHERE IN (array of IDs) http://stackoverflow.com/questions/182060/where-in-array-of-ids new SqlParameter @buildingIDs buildingIDs c# sql server tsql ado.net sqlparameter share improve this question You can't..
Passing List<> to SQL Stored Procedure http://stackoverflow.com/questions/209686/passing-list-to-sql-stored-procedure relates specifically with the code. c# sql sql server tsql stored procedures share improve this question If going to..
Check if Database Exists Before Creating http://stackoverflow.com/questions/2232227/check-if-database-exists-before-creating true catch Exception ex c# sql server 2005 tsql share improve this question As of SQL Server 2005 the old..
Pass Array Parameter in SqlCommand http://stackoverflow.com/questions/2377506/pass-array-parameter-in-sqlcommand @Age .Value sb.ToString .TrimEnd ' ' c# tsql share improve this question You will need to add the values..
How can I programmatically check (parse) the validity of a TSQL statement? http://stackoverflow.com/questions/3084387/how-can-i-programmatically-check-parse-the-validity-of-a-tsql-statement parameter in a stored procedure. c# .net sql server tsql ado.net share improve this question I think the command..
Asynchronous call of a SQL Server stored procedure in C# http://stackoverflow.com/questions/3288272/asynchronous-call-of-a-sql-server-stored-procedure-in-c-sharp forms for this I use http www.wisesoft.co.uk articles tsql_backup_restore_progress.aspx . Or should I use the Backgroundworker.. run the SP in a backgroundjob own thread c# sql server tsql ado.net asynchronous share improve this question In your..
Exclusive access could not be obtained because the database is in use http://stackoverflow.com/questions/4046708/exclusive-access-could-not-be-obtained-because-the-database-is-in-use database context to 'master'. How can I fix it c# sql tsql database restore share improve this question A restore can..
ado.net Closing Connection when using “using” statement http://stackoverflow.com/questions/4389506/ado-net-closing-connection-when-using-using-statement me I just don't want connection hanging open Thanks c# tsql ado.net share improve this question The using will take..
Is there a way to dynamically execute a string in .net, similar to eval() in javascript or dynamic sql in sql? http://stackoverflow.com/questions/508213/is-there-a-way-to-dynamically-execute-a-string-in-net-similar-to-eval-in-jav way to eval in javascript or using sp_executeSQL in tsql I have a string value in a variable that I want to manipulate..
How can I determine the parameters required by an arbitrary piece of T-SQL? http://stackoverflow.com/questions/5792507/how-can-i-determine-the-parameters-required-by-an-arbitrary-piece-of-t-sql be just string parsing to get the parameters... c# .net tsql reflection share improve this question You can use Microsoft.Data.Schema.ScriptDom..
C# calling SQL Server stored procedure with return value http://stackoverflow.com/questions/6210027/c-sharp-calling-sql-server-stored-procedure-with-return-value is needed please let me know. Thanks c# .net sql server tsql stored procedures share improve this question You need to..
Resolve: Use of SqlParameter in SQL LIKE clause not working http://stackoverflow.com/questions/665129/resolve-use-of-sqlparameter-in-sql-like-clause-not-working well. What is going wrong Any suggestions c# sql server tsql ado.net share improve this question What you want is tblCustomerInfo.Info..
SQL: Update a row and returning a column value with 1 query http://stackoverflow.com/questions/700786/sql-update-a-row-and-returning-a-column-value-with-1-query ExecuteScalar or ExecuteReader methods. c# sql server tsql ado.net share improve this question You want the OUTPUT..
|