Viewing 15 posts - 16 through 30 (of 668 total)
declare @t table (tablename varchar(100))
insert into @t values
('dbo.mytable'),
('etl.dbo.table'),
('koagvakjnonsenseajg4648.dbo.RandomTableForSSChahfhaijfhfhf5664646'),
('nonsensetable')
select tablename,
Substring(tablename, charIndex('dbo.',tablename), len(tablename))
from @t
where charIndex('dbo.',tablename) > 0
January 5, 2022 at 5:00 pm
removed
January 5, 2022 at 4:53 pm
if you provide more relevant data, we can maybe help
December 29, 2021 at 7:58 pm
Try joining to it
Create table #table1 (PrintOrderNo int,
PayGroupID int,
LineNumber int,
CompensationDescription varchar(10))
insert into #table1 values
(1,1,1,'test1'),
(1,1,2,'test2'),
(2,1,1,'test3'),
(2,1,2,'test4'),
(3,1,1,'test1')
select
PrintOrderNo as "@PrintOrderID"
,PayGroupID as "@PayGroup"
,(
select
LineNumber as "@DetailNo"
,CompensationDescription as "@Description"
FROM #Table1...
December 29, 2021 at 5:02 pm
Remove the comp alias. Also, that nested select is returning all rows from Table1 for LineNumber and CompensationDescription regardless of which print order no it belongs to
Create...
December 29, 2021 at 3:20 pm
This is the best line, I'll make sure I skip over any of your questions. Glad you got it 'resolved'
Doing it with create scripts and DDL and all the bullshit...
December 29, 2021 at 3:12 pm
is c.name really = to 'x'?? what does this return?
SELECT CASE
WHEN
(
CS.replica_server_name IS NULL
OR CS.replica_server_name = ''
) THEN
N'NOTPRIMARY'
ELSE
CS.replica_server_name
END,
c.name
FROM sys.availability_groups_cluster C
INNER JOIN sys.dm_hadr_availability_replica_cluster_states CS
ON CS.group_id = C.group_id
INNER JOIN sys.dm_hadr_availability_replica_states RS
ON RS.replica_id =...
November 24, 2021 at 2:34 pm
I think you want to check the entre table for fields that are null or have an empty string. You can try something like this
DECLARE @tb nvarchar(512) = N'dbo.[salescube_export]';
DECLARE
November 18, 2021 at 8:49 pm
declare @NumRecords int = 1555201,
@NumInBatch int = 800,
@NumGroups int = 0,
@count int = 0
while (case when @Count = 0 then @NumInBatch else @NumRecords/(@count) end) >= @NumInBatch
begin
print('ID =...
October 27, 2021 at 3:24 pm
I believe that the fast forward cursor of SQL Server is a great tool to use if, and only if, multiple actions need to be taken on each record...
October 19, 2021 at 8:02 pm
Have you thought about how many rows are in the table to begin with? If 35m and you're deleting 30m, maybe a faster approach, to
begin with, is to insert 5m...
October 15, 2021 at 11:53 am
I echo what the others are saying. Can you provide some sample data as well as how you are determining the @DaysToAdd parameter for each date?
October 8, 2021 at 3:57 pm
You query produced the correct results. You need to use your reporting tool to handle the display that you want. SQL will not produce what you are looking...
August 5, 2021 at 5:05 pm
what is pk on these 3 tables?
[EES_App].[dbo].[co_ship]
[EES_App].[dbo].[coitem]
[EES_App].[dbo].[custaddr]
July 21, 2021 at 7:59 pm
Viewing 15 posts - 16 through 30 (of 668 total)