Viewing 15 posts - 301 through 315 (of 686 total)
Did the number of rows per day dictate a certain method for export?
February 11, 2022 at 2:28 am
10,000 of thousands I expect for each of the 3 files...
February 9, 2022 at 1:22 pm
not sure I understand the question, but I'm looking all records from previous day that gets split out using:
CASE WHEN datepart(hour, dt.dt_stamp) < 8 THEN 1
WHEN datepart(hour, dt.dt_stamp) < 16...
February 8, 2022 at 9:07 pm
I was looking back at this example you sent:
$queryResults = Invoke-SqlCmd ...;
Then something like this would be one option (probably better options are available):
$queryResults | ? {$_.Category -eq 1} |...
February 8, 2022 at 8:29 pm
wanted more of a script approach maybe a little easier for maint and debug down the road.
February 8, 2022 at 8:23 pm
I'm not opposed to xp_cmdshell, and was wanting the csv files to be pipe(|) delimited. These 3 files will be used in a P/S import
process to SQL as kind of...
February 8, 2022 at 12:09 am
It started with grouping records by week to see the amount of data, and once I saw that I needed it to break down by day in 8 hour increments....
February 7, 2022 at 8:04 pm
something like this?
#Variables - details of the connection, stored procedure and parameters
$connectionString = "server=ServerName;database='DatabaseName';trusted_connection=true;";
$storedProcedureCall = "exec dbo.GetFileNames @param1";
$param1Value = "SomeValue";
#SQL Connection - connection to SQL server
$sqlConnection...
February 7, 2022 at 1:17 am
Thanks for comments and understand..
Jeffrey,
Would this method work to get my 3 output files?
function ConnectToDB {
# define parameters
param(
...
February 4, 2022 at 8:58 pm
Thanks..
Could you crave out a template to get me started?
February 3, 2022 at 8:58 pm
how could I wrap the S/P in Powershell to accomplish that task?
February 3, 2022 at 8:47 pm
Would I be able to create different output files based on in the SP?
,CASE WHEN datepart(hour, dt.dt_stamp) < 8 THEN ..... Create output file1
WHEN datepart(hour, dt.dt_stamp) < 16 THEN .......
February 3, 2022 at 8:28 pm
Would I be able to give each row a Label?
,CASE WHEN datepart(hour, dt.dt_stamp) < 8 THEN 1
WHEN datepart(hour, dt.dt_stamp) < 16 THEN 2
ELSE 3
END as 'HrReported'
Instead of having a 1,2,3 ...
February 1, 2022 at 8:47 pm
Not having any luck trying to Insert The CASE into previous query.
CASE WHEN datepart(hour, dt.dt_stamp) < 8 THEN 1
WHEN datepart(hour, dt.dt_stamp) < 16 THEN 2
ELSE 3
END
Like to see the break...
February 1, 2022 at 12:51 pm
Viewing 15 posts - 301 through 315 (of 686 total)