Viewing 15 posts - 136 through 150 (of 496 total)
Not sure if this is the real code or not, but I would recommend using the complete column list instead of select *. What if someone adds a new column...
March 14, 2014 at 10:35 am
That is not enough information to go off of. Please give more details for the needs of the table. There isn't a one size fits all table design, so the...
March 14, 2014 at 8:55 am
Looks like you need to create a new database and start moving data.
March 14, 2014 at 8:52 am
Coalesce will return the first non-NULL value, so if the sum Previous_Year + Current_Year returns a NULL value it will go to the next value in the comma delimited list...
March 13, 2014 at 9:10 am
I would start with normalizing your tables appropriately. That would make this a lot easier to do. This should get you what you need:CREATE TABLE [dbo].[A_TABLE](
[A_ID] [varchar](40) NOT NULL,
[A_SOURCE] [varchar](10)...
March 13, 2014 at 9:02 am
You can use NULLIF and COALESCE to accomplish this. I would also use LTRIM and RTRIM to get rid of extra spaces i.e. coalesce(nullif(rtrim(ltrim(column)),''),0)
March 13, 2014 at 8:51 am
Sean Lange (3/12/2014)
March 12, 2014 at 1:49 pm
I would consider doing it with Powershell here is an article that discusses doing just that: http://www.sqlservercentral.com/blogs/everyday-sql/2013/02/12/t-sql-tuesday-use-powershell-to-restore-a-database-on-a-different-server/
March 12, 2014 at 9:18 am
You want to make sure that you are only performing a metadata operation and not a data move operation. There are best practices around what you are trying to do....
March 12, 2014 at 9:08 am
BTW Shan, Sean is one of the SQL Ninjas 😀
March 12, 2014 at 9:02 am
Now look for one of the SQL Ninja's on the forum to give you something cleaner and better, but this should work for now.with Employee as
(
select 'ABC' as Surname, 'x.yz'...
March 12, 2014 at 8:57 am
SELECT log_reuse_wait_desc, * FROM MASTER.sys.databases
Not sure how many databases you have on your server so you might want to limit the results that are coming back to only the database...
March 11, 2014 at 8:48 am
I would check the maintenance plan, or some other job that might be doing maintenance, to see if your recovery model is getting changed thus breaking you backup chain. During...
March 11, 2014 at 8:44 am
shahgols (3/10/2014)
exec msdb.dbo.sp_start_job @job_id =...
March 10, 2014 at 9:16 pm
It looks like you just need a Left Outer Join on the two tables between ID, DOW and checking the StartTime vs. the Resettime:WITH SampleData (PERSON,[DATE],[HOURS],[STARTIME],[ENDTIME],
,[ID],[DOW]) AS
(
...
March 10, 2014 at 9:05 pm
Viewing 15 posts - 136 through 150 (of 496 total)