Viewing 15 posts - 4,126 through 4,140 (of 8,731 total)
If Gender is a non nullable column, it will work.
I'd usually go for something like this:
Delete T
FROM Event_Temp_Lead_Screen T
WHERE NOT EXISTS( SELECT 1 FROM member M WHERE ...
September 24, 2015 at 10:21 am
Variable lose scope inside the EXECUTE(), you would need to send them as parameters using sp_executesql or concatenate them in the string as I did.
Generally speaking, using parameters with sp_executesql...
September 24, 2015 at 9:31 am
YB already showed an example on how you should post sample data. For instructions on how to do it in a simple way, visit the following articles for 2 options:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
http://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/
Here...
September 24, 2015 at 9:26 am
The problem is that DB_Type and DB_ENV don't have a data type assigned. Every column in your queries needs a data type defined.
September 24, 2015 at 9:04 am
Let's go step by step.
The following code generates 10 rows. I don't care about the contents, so it's a simple column with zeros.
SELECT n FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(n)
Then I use a cross...
September 24, 2015 at 9:02 am
Here's a different idea. Remove the IF
SELECT @@servername AS Instance,
b.database_name...
September 24, 2015 at 6:47 am
Do you seriously have the dates stored as strings like that? Or that's the display used? Dates should be treated as dates. SSIS can identify a date/time value in the...
September 24, 2015 at 6:39 am
You can also define the columns as the Primary Key.
ALTER TABLE OrderDetails
ADD CONSTRAINT PK_OrderDetails PRIMARY KEY (InvoiceID, LineitemNumber);
September 23, 2015 at 1:14 pm
Here are 2 options to get your desired results. There might be others available but these where the first I could think of.
--Option 1
SELECT m.keyvalue,
otherdata,...
September 23, 2015 at 11:56 am
Try by casting the literals in your second select statement. Another good idea is to use EXISTS for your condition.
IF EXISTS(select 1 from msdb..backupset)
BEGIN
select @@servername as...
September 23, 2015 at 10:40 am
Development/Testing/QA/Production
I'm not sure about the T, but the letters define the different environments used. The RTO and RPO will differ from environment to environment.
September 23, 2015 at 9:44 am
You'll need another ROW_NUMBER function.
WITH CTE AS(
SELECT *,
ROW_NUMBER() OVER ( ORDER BY DateTimePressed) - ROW_NUMBER() OVER ( PARTITION...
September 23, 2015 at 9:40 am
Ok, be sure to understand what's going on in here and ask any questions that you might have. You can't blame me if something goes wrong and you're not sure...
September 23, 2015 at 9:28 am
This problem and its solution is explained in here: http://www.sqlservercentral.com/articles/T-SQL/71550/
The only difference is that the article uses days instead of minutes.
CREATE TABLE #RedButtonPress(
Name ...
September 23, 2015 at 9:22 am
That's possible with minor changes to the code that I posted. Based on your OP, it could look like this:
CREATE TABLE dbo.tblReps(
id int
);
INSERT INTO tblReps VALUES(1),(2),(3),(4),(5);
DECLARE
@startDate...
September 23, 2015 at 8:58 am
Viewing 15 posts - 4,126 through 4,140 (of 8,731 total)