Wednesday, April 10, 2013

[SQL Server] how to query MySQL from SqlServer 2K8R2

[SQL Server] how to query MySQL from SqlServer 2K8R2


how to query MySQL from SqlServer 2K8R2

Posted: 10 Apr 2013 10:05 AM PDT

Hi all,Could someone please share a link or article to help me setup a way to query MySQL database from SqlServer?Thanks,

ISNULL question

Posted: 10 Apr 2013 06:53 AM PDT

I have difficult understanding this line of codewhere ISNULL(myfield, 'N') = 'Y'Does this mean where myfeild is NULL or myfield = 'N' or myfield = 'Y'

Trace file error

Posted: 09 Apr 2013 03:36 PM PDT

Dear all I am getting following error "Encountered an error or an unexpected end of trace file 'c:\Program Files\Microsoft SQL Server\MSSQL10_50.LOCAL2008EXPRESS\MSSQL\Log\log_31.trc'."How do i correct it?I get it when i run following script -DECLARE @filename NVARCHAR(1000);DECLARE @bc INT;DECLARE @ec INT;DECLARE @bfn VARCHAR(1000);DECLARE @efn VARCHAR(10);-- Get the name of the current default traceSELECT @filename = CAST(value AS NVARCHAR(1000))FROM ::fn_trace_getinfo(DEFAULT)WHERE traceid = 1 AND property = 2;-- rip apart file name into piecesSET @filename = REVERSE(@filename);SET @bc = CHARINDEX('.',@filename);SET @ec = CHARINDEX('_',@filename)+1;SET @efn = REVERSE(SUBSTRING(@filename,1,@bc));SET @bfn = REVERSE(SUBSTRING(@filename,@ec,LEN(@filename)));-- set filename without rollover numberSET @filename = @bfn + @efn-- process all trace filesSELECT ftg.StartTime,te.name AS EventName,DB_NAME(ftg.databaseid) AS DatabaseName ,ftg.Filename,(ftg.IntegerData*8)/1024.0 AS GrowthMB ,(ftg.duration/1000)AS DurMSFROM ::fn_trace_gettable(@filename, DEFAULT) AS ftg INNER JOIN sys.trace_events AS te ON ftg.EventClass = te.trace_event_id WHERE (ftg.EventClass = 92 -- Date File Auto-growOR ftg.EventClass = 93) -- Log File Auto-growORDER BY ftg.StartTimeThere are 4 trace files _31/_32/_33/_34

Please tell me how can I write one query to resolve this problem.

Posted: 09 Apr 2013 04:39 PM PDT

Let say I've two tables:Plates table with fields:-Start plate ( unsigned long type)-Stop plate ( unsigned long type)Plates row1: 1 12Plates row2: 15 23Broken plates table with fields:-Start plate ( unsigned long type)-Stop plate ( unsigned long type)Broken plates row1: 3 7Broken plates row2: 15 18Broken plates row3: 21 22Please tell me how can I make the remaining plates query?Remaining plates query row1: 1 2Remaining plates query row2: 8 12Remaining plates query row3: 19 20Remaining plates query row4: 23 23Best regards.

No comments:

Post a Comment

Search This Blog