Viewing 15 posts - 91 through 105 (of 241 total)
Not sure about VB. From SQL I use syntax like below and it works fine. Provided, of course, that ACE driver is actually installed on the SQL Server, no one...
April 16, 2019 at 8:53 pm
You need to explicitly convert getdate(), for example:
CONVERT(CHAR(8), GETDATE(), 112)
April 16, 2019 at 8:21 pm
I was able to reproduce your problem when I added .01 to the original value. Maybe in the table you have 131281.01 but don't see it in the output?
April 15, 2019 at 9:57 pm
From SQL you can try to use ACE driver. Something like this:
INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Text;Database=C:\Temp\;HDR=YES;FMT=CSVDelimited',
'SELECT * FROM [FileName.csv]')
SELECT Field1, Field2, Field3
FROM MyTable
Please note that target file must already...
April 12, 2019 at 10:14 pm
Are we talking about nesting in CASE expression? If so, you can start another CASE after THEN. Something like this:
CASE lineid1
WHEN 'APPROVED'
THEN...
April 12, 2019 at 8:32 pm
Not sure if I got it correctly.... If you know sequence of characters you replacing use REPLACE() function. If you need to replace at certain positions, use STUFF() function.
April 12, 2019 at 7:14 pm
Which aggregate you use is up to you. You need count - use COUNT. You can also use SUM to count things in CASE. Other than that follow the technique...
April 12, 2019 at 6:32 pm
As Ben had shown, you can use Insert...EXEC in the procedure to capture xp_cmdshell output into table. Then parse it in the function.
You can do file manipulation in the external...
April 12, 2019 at 5:06 pm
Sure, if number of columns is unpredictable you'll need dynamic SQL. But inside that dynamic SQL you may implement one of the crosstab techniques. The only other way I can...
April 12, 2019 at 4:28 pm
Here is one way doing this:
SELECT
[COLUMNS] = 'TID',
[2019-01-01] = MIN(CASE WHEN LDate = '20190101' THEN TID END),
[2019-01-03] = MIN(CASE WHEN...
April 12, 2019 at 3:56 pm
Your desired output doesn't seem right. There is no 'user2' in FName column, there is no 'user1' in LName. How come they appear in respecting output rows. It's a crosstab...
April 12, 2019 at 3:25 pm
Also, if I'm not mistaken, default schema is ignored for sysadmins. They always get dbo.
April 10, 2019 at 10:08 pm
I don't think schema will be created in CREATE TABLE even if you grant CREATE SCHEMA permission to the user. You'll need separate statement for that.
April 10, 2019 at 9:41 pm
I attempted to answer today, May 27. Naturally selected #4....
This queston has timing issue. 🙂
May 27, 2015 at 3:57 pm
Viewing 15 posts - 91 through 105 (of 241 total)