I have the premium version of LINQPad 6
do you know the steps to convert sql code to linq ?
LINQPad doesn't support it
Linqer support it,but if it's complex sql then converter sometime will convert slowquery LINQ-SQL.the logic is like you can convert C# data to json,but when you try to convert json to C# class it will not convert 100% perfect .
PS:
Linqer's link : Linqer | SQL to LINQ converter
Related
I have MS Access query and try to convert to SQL Server query.
Please someone can help me.
UPDATE AppReferrals
SET AppReferrals.DeviceID = CLng(Val(Left(IIf([AppReferrals].[DeviceID] Like '0',[AppReferrals].[ActionID],[AppReferrals].[DeviceID]),9)));
Good I think I'm very old
I worked with Visual basic in my first job 20 years ago
basically what you are doing is taking a value "first 9 digit" (DeviceID) and this is null the alternative (ActionID) and converting it to an Long value
using the following functions
CLng
Val
Left
IIf
Like
Example in visual basic net the function
I know I can do the conversion very easily using C# or any other number of programming languages, however, I want to know if I can do the conversion of a column that has EBCDIC encoded text so that the result of the query is in a readable string such as ascii encoded.
Ultimately, I will import the data into SQL Server and I know SSIS can do it, but before I do that, I want to exhaust any paths that are not SQL language.
For example a little know combination of built in functions available in DB2 SQL or SQL-Server 2008
Here is an example of data
Data as stored in DB2: 0xC6C3C3C1E3C5D9D7C9D3D360F8F840
Text: FCCATERPILL-88
The C# conversion is so easy so I included it here:
System.Text.Encoding ei = Encoding.GetEncoding(37);
textBox1.Text = ei.GetString(allBytes.ToArray())
I'm not an AS400 admin so I'm not sure what to do with what is being suggested in the comments.
I am using SQL server - 2008.
Column Datatype - VarBinary
RTF File is compressed and saved to this varbinary column.
Now how to access and view data in RTF file using SQL ?
it's returns this: 㠰た㠴弰巎楛㵤㠵㜸ㄲ㠴. etc.
Sample Tried Code here:
http://rextester.com/YOFHK34016
any solution to this.
in 2008 Decompress and compress function not work.
how i can get RTF file as it is to text.
That's works for me:
select convert(varchar(max),convert(varbinary(max),bv.value)) from blobValue bv
Instead using nvarchar try to use varchar.
But I shuld say that this will return rtf formated text, something like:
"{\rtf1\ansi\ansicpg1251\deff0\deflang1049{\fonttbl{\f0\fnil MS Sans Serif;}{\f1\fswiss\fcharset0 Arial;}"
To get actual text from it you can use .Net dll to convert it.
You can add .net dll to your database and than call it's functions from Sql script. More detailed about it: Call dll function from sql stored procedure using the current connection
It worked for me, thanks a bunch.
I used:
SELECT convert(nvarchar(max),convert(varbinary(max),[FORMULATEXT]))
I am interested in converting a date value to CYYMMDD using native SQL Server 2012 functions.
I checked here:
http://www.sql-server-helper.com/tips/date-formats.aspx
and couldn't find anything.
Anyone know?
C stands for century I guess...
Have you looked at the new FORMAT function in SQL Server 2012?
http://msdn.microsoft.com/en-us/library/hh213505.aspx
You should be able to use something like this:
SELECT FORMAT(YourDateColumn, 'yyyyMMdd')
or whatever you really want to use - basically, the same formatting options as in C# / .NET are available when using FORMAT
I was wondering if there any program that can convert ArgoUML files into sql code?
Thanks
Try argouml-db. It uses this plugin for argo.