Thursday, April 25, 2013

[Articles] Flight Data

[Articles] Flight Data


Flight Data

Posted: 24 Apr 2013 11:00 PM PDT

Travel can be stressful and complicated. As much as computer systems have made things easier, when they fail, your trip can turn awful in a hurry.

[SQL 2012] Converting MS Access Query to SQL

[SQL 2012] Converting MS Access Query to SQL


Converting MS Access Query to SQL

Posted: 25 Apr 2013 02:46 AM PDT

I admit I am really green with SQL. I signed up with Access Hosting for a trial of SQL 2012 to test out with a database I am writing. It works great in Access 2013, but now we are looking at a couple users that would be on the road connecting to it, besides the 3-5 in the office. I posted this on Utteraccess got an initial response but still am kinda stuck. So this was my initial post;[quote]I am having a problem with one of my queries that has the following 4 DLookups.4 DLookups are;ACost: (DLookUp("[Cost]","tblArboristType","[ArboristType] = 'A'"))*[A]AaCost: (DLookUp("[Cost]","tblArboristType","[ArboristType] = 'Aa'"))*[Aa]AtCost: (DLookUp("[Cost]","tblArboristType","[ArboristType] = 'At'"))*[At]GlCost: (DLookUp("[Cost]","tblArboristType","[ArboristType] = 'Gl'"))*[Gl]They are in a query that is essentially the recordset for a form. The 4 costs are used in conjunction with the A, Aa, At and G fields in the form where people put in a value which is then all used to calculate out a suggested cost.Here is the whole query. I can't link the ArboristType table to the query because their is no reference, it's just strictly there for costing.[/quote]This is how the query looks in Access[quote]SELECT tblTrees.TreeID, tblTrees.TreeSort, tblTrees.ContractNo, tblTrees.Species, tblSpecies.Species AS Tree, tblTrees.TreeQty, tblTrees.Location, tblTrees.Landmark, tblTrees.PlantHealth, tblTrees.DBH, tblTrees.Height, tblTrees.BD, tblTrees.Buttress, tblTrees.FGOther, tblTrees.FGOtherNotes, tblTrees.SMTrunk, tblTrees.Distance, tblTrees.EquipAccess, tblTrees.TTvsB, tblTrees.Haz_PI, tblTrees.Haz_EC, tblTrees.Haz_Pests, tblTrees.Equip_Bobcat, tblTrees.Equip_Bobcat_Cost, tblTrees.Equip_Crane, tblTrees.Equip_CraneHrs, tblTrees.Equip_Crane_Cost, tblTrees.Equip_Lift, tblTrees.Equip_LiftID, tblTrees.Equip_Lift_Cost, tblTrees.Equip_Lift_Time, tblTrees.Equip_Stump, tblTrees.Equip_Stump_Cost, tblTrees.GM, tblTrees.A, tblTrees.Aa, tblTrees.At, tblTrees.Gl, tblTrees.WorkHrs, Round((([ArbCosts]+[VehCost]+40)/(1-[GM])*[WorkHrs])+([Equip_CraneHrs]*[Equip_Crane_Cost])+([Equip_Lift_Cost]*[Equip_Lift_Time]+[MaterialsCost]),0) AS SuggTreeCost, tblTrees.ProposalTreeCost, tblTrees.ConfirmationDate, tblTrees.Veh_CTC, tblTrees.Veh_CTC_Cost, tblTrees.Veh_PT, tblTrees.Veh_PT_Cost, tblTrees.Veh_1T, tblTrees.Veh_1T_Cost, tblTrees.Veh_Int, tblTrees.Veh_Int_Cost, (DLookUp("[Cost]","tblArboristType","[ArboristType] = 'A'"))*[A] AS ACost, (DLookUp("[Cost]","tblArboristType","[ArboristType] = 'Aa'"))*[Aa] AS AaCost, (DLookUp("[Cost]","tblArboristType","[ArboristType] = 'At'"))*[At] AS AtCost, (DLookUp("[Cost]","tblArboristType","[ArboristType] = 'Gl'"))*[Gl] AS GlCost, [ACost]+[AaCost]+[AtCost]+[GlCost] AS ArbCosts, ([Equip_Bobcat_Cost]+[Equip_Stump_Cost]+[Veh_CTC_Cost]+[Veh_PT_Cost]+[Veh_1T_Cost]+[Veh_Int_Cost]) AS VehCost, tblTrees.HazNotes, tblTrees.OnProposal, tblTrees.CustObj, tblTrees.CustObjDesc, tblTrees.TOWID, tblTrees.Transfer, tblTrees.Timing, tblTrees.Equip_Lift_Time, tblTrees.MissDig, tblTrees.MissDigNo, tblTrees.Haz_Poop, tblTrees.Grouping, tblTrees.GroupedCost, tblTrees.MaterialsCost, tblTrees.Materials, [Equip_CraneHrs]*[Equip_Crane_Cost] AS CraneCosting, tblTrees.MethodNotes, tblTrees.InvoiceNoFROM tblSpecies INNER JOIN tblTrees ON tblSpecies.SpeciesID = tblTrees.Species;[/quote]This is the response I got, which still worked in Access but I get an error when trying to import into SQL 2012;[quote]Below saved as qArboristRates;TRANSFORM Max(Cost) as TheCostSELECT 1 as BogusRowHeaderFROM tblArboristTypeGROUP BY 1Pivot "Rate" & ArboristTypeBelow is the query that refers to the above query;SELECT tblTrees.TreeID, tblTrees.TreeSort, tblTrees.ContractNo, tblTrees.Species, tblSpecies.Species AS Tree, tblTrees.TreeQty, tblTrees.Location, tblTrees.Landmark, tblTrees.PlantHealth, tblTrees.DBH, tblTrees.Height, tblTrees.BD, tblTrees.Buttress, tblTrees.FGOther, tblTrees.FGOtherNotes, tblTrees.SMTrunk, tblTrees.Distance, tblTrees.EquipAccess, tblTrees.TTvsB, tblTrees.Haz_PI, tblTrees.Haz_EC, tblTrees.Haz_Pests, tblTrees.Equip_Bobcat, tblTrees.Equip_Bobcat_Cost, tblTrees.Equip_Crane, tblTrees.Equip_CraneHrs, tblTrees.Equip_Crane_Cost, tblTrees.Equip_Lift, tblTrees.Equip_LiftID, tblTrees.Equip_Lift_Cost, tblTrees.Equip_Lift_Time, tblTrees.Equip_Stump, tblTrees.Equip_Stump_Cost, tblTrees.GM, tblTrees.A, tblTrees.Aa, tblTrees.At, tblTrees.Gl, tblTrees.WorkHrs, Round((([ArbCosts]+[VehCost]+40)/(1-[GM])*[WorkHrs])+([Equip_CraneHrs]*[Equip_Crane_Cost])+([Equip_Lift_Cost]*[Equip_Lift_Time]+[MaterialsCost]),0) AS SuggTreeCost, tblTrees.ProposalTreeCost, tblTrees.ConfirmationDate, tblTrees.Veh_CTC, tblTrees.Veh_CTC_Cost, tblTrees.Veh_PT, tblTrees.Veh_PT_Cost, tblTrees.Veh_1T, tblTrees.Veh_1T_Cost, tblTrees.Veh_Int, tblTrees.Veh_Int_Cost, RateA *[A] AS ACost, RateAA *[Aa] AS AaCost, RateAt*[At] AS AtCost, RateG1*[Gl] AS GlCost, RateA *[A] +RateAA *[Aa] + RateAt*[At] + RateG1*[Gl] AS ArbCosts, ([Equip_Bobcat_Cost]+[Equip_Stump_Cost]+[Veh_CTC_Cost]+[Veh_PT_Cost]+[Veh_1T_Cost]+[Veh_Int_Cost]) AS VehCost, tblTrees.HazNotes, tblTrees.OnProposal, tblTrees.CustObj, tblTrees.CustObjDesc, tblTrees.TOWID, tblTrees.Transfer, tblTrees.Timing, tblTrees.Equip_Lift_Time, tblTrees.MissDig, tblTrees.MissDigNo, tblTrees.Haz_Poop, tblTrees.Grouping, tblTrees.GroupedCost, tblTrees.MaterialsCost, tblTrees.Materials, [Equip_CraneHrs]*[Equip_Crane_Cost] AS CraneCosting, tblTrees.MethodNotes, tblTrees.InvoiceNoFROM qArboristRates, tblSpecies INNER JOIN tblTrees ON tblSpecies.SpeciesID = tblTrees.Species;[/quote]I get an error when I try to import the Cross Tab Query using the SQL Server Migration Assistant. I get A2SS0042: Crosstabe query cannot be converted because it is not supported.If I try to manual add the view I get "Unable to parse query text." Then when I went to save it, ignoring the error I get "Incorrect syntax near 'TRANSFORM'. Incorrect syntax near keyword 'Pivot'. Any help would be greatly appreciated.ThanksJIM

BI MCSE

Posted: 24 Apr 2013 11:51 PM PDT

Hi,I want to become certified in SQL Server 2012 BI.I'm now reading the Self Passed Training Kit "Implementing a Data Warehouse with Microsoft SQL Server 2012 (exam 463)"I cann't find other self passed training kits to complete my studies in this subjet (BI).The exams that I need training kits are:466, 467Can someone tell me if there are self passed training kits for this exams?Thank you.P.S - The only BI certification in SQL Server is the MSCE BI?

Cannot create a new Service Broker in read-only database "msdb"

Posted: 24 Apr 2013 10:54 PM PDT

Hi I am unable to install DB Engine on SQLServer2012TITLE: Microsoft SQL Server 2012 Service Pack 1 Setup------------------------------The following error has occurred:Cannot create a new Service Broker in read-only database "msdb".ALTER DATABASE statement failed.For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=9775&ProdVer=11.00.3128&EvtType=0x7590AFD6%25400x9A41B222------------------------------BUTTONS:OK------------------------------

Distributed Replay Controller

Posted: 24 Apr 2013 05:03 AM PDT

I started an installation of SQL Server 2012 and I encountered the screen to specify the Distributed Replay Controller.Does the Distributed Replay Controller need to be a dedicated server?From what I read I would need to start SQL Server Setup to install Distributed Replay Controller on another machine before I can continue with the SQL Server Installation.Any help would be greatly appreciated.

[SQL server issues] Commented Issue: AdventureWorksDW2008R2 DimDate table has missing dates [13383]


Hello,
Is this been taken care? If so, please share the latest data for DimDate. I'm working on some POC which requires dates in between 2008 and 2010 as well. If it is not already done, can someone let me know is there is any way I can generate the data for those missing dates in that table?



.

sqlserversamples.codeplex.com

[SQL server issues] Created Issue: New to datawarehousing...and want to know how the Adventurework and AdventureworkDW has been developed [17881]




description



New to datawarehousing...and want to know how the Adventurework and AdventureworkDW has been developed..
how the OLTP data has been extracted to AdventureworksDW..datawarehouse system and need some design documents....what to know how the DIM tables are created...and everything







.

sqlserversamples.codeplex.com

[SQL server issues] Created Issue: SQL Server 2008 Developer edition sample database install error [18174]







description



I'm trying to install Adventureworks sample dB and i get an error.
I successfully downloaded the mdf file however when attach, add and click OK from SSMS I get the error:
 
Msg 5172, Level 16, State 15, Line 1
The header for file 'C:\Program Files\Microsoft SQL Server\AdventureWorks2012_Data.mdf' is not a valid database file header. The FILE SIZE property is incorrect.







.

sqlserversamples.codeplex.com

[T-SQL] how pick value from database on sql server2000?

[T-SQL] how pick value from database on sql server2000?


how pick value from database on sql server2000?

Posted: 24 Apr 2013 11:32 PM PDT

Hai friends, I m creating one sample application its has two dropdown boxes ddl1 and dd2if i choose dd1 in air to reflect value of economy ,business ll show on dd2how to create the code for that.

Recursive CTE

Posted: 25 Apr 2013 01:03 AM PDT

Hi,I have a query below I'm doing recursive CTE.The logic behind it is, Client(John) can be linked another Client(Mary). And Mary can also be linked to another Client(Smith). All this clients has Client Numbers. Now when a user input a Client's Number let's say (1-23) which is John's, the query supposed to return all Clients linked to John, and if those Clients are linked to other Clients, show them as well. I hope it makes sense.Now the problem I have is, when I input Mary's client Id, which is (1-33), I get all clients linked to her and other clients in the linking chain, except for one client linked to John(1-23), that client is Diana(1-14)I hope I've been able to explain this very well. Can one spot out my error and help me.Below is my code to attempt it:--create PR_LINK_INV_HST temp table--Create TABLE #PR_LINK_INV_HST (CLIENT_ID varchar(15), NAME varchar(15), LINK_CLIENT_ID varchar(30))--insert into PR_LINK_INV_HST temp table--Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-23','John','1-14')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-23','John','1-33')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-14','Diana',null)Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-17','Pope','1-19')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-16','Smith',null)Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-33','Mary','1-16')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-33','Mary','1-17')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-19','Thabo',null)Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-50','Josh','1-23')DECLARE @CLIENT_ID VARCHAR(15)SET @CLIENT_ID = '1-33' -- This CTE search for the linked client(child)--;WITH pr_linked(CLIENT_ID, NAME, LINK_CLIENT_ID, [LEVEL])AS(SELECT CLIENT_ID, Name, LINK_CLIENT_ID, 1FROM #PR_LINK_INV_HST WHERE LINK_CLIENT_ID = @CLIENT_IDUNION ALLSELECT HST.CLIENT_ID, HST.Name, HST.LINK_CLIENT_ID, LNK.[LEVEL] + 1FROM #PR_LINK_INV_HST HST JOIN pr_linked LNKON LNK.CLIENT_ID = HST.LINK_CLIENT_ID)SELECT * INTO #RESULTSFROM pr_linked-- This CTE search upwards for the linked client(parent)--;WITH pr_linked(CLIENT_ID, NAME, LINK_CLIENT_ID, [LEVEL])AS( SELECT CLIENT_ID, Name, LINK_CLIENT_ID, 0 FROM #PR_LINK_INV_HST WHERE CLIENT_ID = @CLIENT_ID UNION ALL SELECT HST.CLIENT_ID, HST.Name, HST.LINK_CLIENT_ID, LNK.[LEVEL] - 1 FROM #PR_LINK_INV_HST HST JOIN pr_linked LNK ON HST.CLIENT_ID = LNK.LINK_CLIENT_ID)INSERT INTO #RESULTSSELECT * FROM pr_linked-- display resultSELECT *FROM #RESULTSdrop table #RESULTSdrop table #PR_LINK_INV_HST

Need help on creating Left outer Join

Posted: 24 Apr 2013 06:30 PM PDT

Hi All,Need your help to create a Left Out join on 2 tables, which will be based on the Period Code.Below are the tables, not that challenge is that, we need to get the Max of the Period From table 2 which should be Less than or equal to the Table 1 Period - 6 Month.Example: Row ADS 01.2013 should have the row in table 2 with ADS and Period in (01.2013,12.2012,11.2012,10.2012,09.2012,08.2012)Table1:Name PeriodABD 01.2013BCD 02.2013ADS 03.2013AZD 04.2013Table 2:Name PeriodABD 02.2013ABD 08.2012BCD 02.2013ADS 04.2012Please need help on the same....!AZD 04.2013

Delete other than top 2 rows for each foreign key element in table.

Posted: 24 Apr 2013 10:04 PM PDT

I have a table like that MemberId(F.K) ! Event ! Event Date1 'Test Event1' "2012-03-20 05:39:51"1 'Test Event1' "2012-03-21 05:39:51"1 'Test Event1' "2012-03-22 05:39:51"3 'Test Event3' "2012-03-23 05:39:51"2 'Test Event2' "2012-03-24 05:39:51"2 'Test Event2' "2012-03-19 05:39:51"1 'Test Event1' "2012-03-23 05:49:51"3 'Test Event3' "2012-03-23 05:49:51"4 'Test Event4' "2012-03-27 05:39:51"3 'Test Event3' "2012-03-21 05:39:51". . . . .and what i require is to keep only two latest events for each members and to delete the rest ones.i.e.1 'Test Event1' "2012-03-23 05:49:51"1 'Test Event1' "2012-03-22 05:39:51"2 'Test Event2' "2012-03-24 05:39:51"2 'Test Event2' "2012-03-19 05:39:51"3 'Test Event3' "2012-03-23 05:39:51"3 'Test Event3' "2012-03-23 05:49:51"4 'Test Event4' "2012-03-27 05:39:51"I have an idea of doing like that by using CTE or by using RowNumbers and Partitions but i have to avoid the power of DBMS , Cursors and to write a pure SQL for that , any help will be appreciated.Thanks.

The maximum recursion 100 has been exhausted

Posted: 24 Apr 2013 09:57 PM PDT

HiI have this query below, CTE code. and I get this error: The statement terminated. The maximum recursion 100 has been exhausted before statement completion.Can someone please look at the query and see what am I doing wrong and help.Create TABLE #PR_LINK_INV_HST (CLIENT_ID varchar(15), NAME varchar(15), LINK_CLIENT_ID varchar(30))Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-23','John','1-14')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-14','Diana','1-23')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-23','John','1-33')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-33','Mary','1-23')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-17','Pope','1-19')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-19','Thabo','1-17')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-16','Smith','1-33')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-33','Mary','1-16')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-33','Mary','1-17')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-17','Pope','1-33')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-50','Josh','1-23')Insert into #PR_LINK_INV_HST (CLIENT_ID,NAME,LINK_CLIENT_ID) values('1-23','John','1-50')DECLARE @CLIENT_ID VARCHAR(15)SET @CLIENT_ID = '1-23' -- This CTE search upwards for the linked client(child);WITH pr_linked(CLIENT_ID, NAME, LINK_CLIENT_ID, [LEVEL])AS(SELECT CLIENT_ID, Name, LINK_CLIENT_ID, 1FROM #PR_LINK_INV_HST WHERE LINK_CLIENT_ID = @CLIENT_IDUNION ALLSELECT HST.CLIENT_ID, HST.Name, HST.LINK_CLIENT_ID, LNK.[LEVEL] + 1FROM #PR_LINK_INV_HST HST JOIN pr_linked LNKON LNK.CLIENT_ID = HST.LINK_CLIENT_ID)SELECT * INTO #RESULTSFROM pr_linked--select * from #RESULTS-- This CTE search upwards for the linked client(parent);WITH pr_linked(CLIENT_ID, NAME, LINK_CLIENT_ID, [LEVEL])AS( SELECT CLIENT_ID, Name, LINK_CLIENT_ID, 0 FROM #PR_LINK_INV_HST WHERE CLIENT_ID = @CLIENT_ID UNION ALL SELECT HST.CLIENT_ID, HST.Name, HST.LINK_CLIENT_ID, LNK.[LEVEL] - 1 FROM #PR_LINK_INV_HST HST JOIN pr_linked LNK ON HST.CLIENT_ID = LNK.LINK_CLIENT_ID)INSERT INTO #RESULTSSELECT * FROM pr_linked-- display resultSELECT *FROM #RESULTSdrop table #RESULTSdrop table #PR_LINK_INV_HST

What is "cost"?

Posted: 24 Apr 2013 04:31 AM PDT

When the Query Analizer estimates the cost of a query as 5.2837628, is that 5.2837628 of something? Or is it just a number to use for comparison to the cost of other versions of the query?

Max or Top 1 more efficient

Posted: 24 Apr 2013 04:12 AM PDT

I have a table with a month value and year value both ints.I need two things, the latest date and the date 24 months before.I came up with these to get the latest date and trying to find the most efficient.[code]SELECT MAX(CONVERT(smalldatetime, CAST(MonthValue AS varchar) + '/01/' + CAST(YearValue AS varchar))) AS ValueDateFROM dbo.myTable[/code]This gets me a plan ofStream Aggregate (Aggregate) -Cost 7%Compute Scalar - Cost 1%Clustered Index Scan - Cost 91%The other option is:[code]SELECT TOP 1 CONVERT(smalldatetime, CAST(MonthValue AS varchar) + '/01/' + CAST(YearValue AS varchar)) AS ValueDateFROM dbo.myTableORDER BY ValueDate DESC[/code]Sort (top N Sort) -Cost 92%Compute Scalar - Cost 0%Clustered Index Scan - Cost 8%Which one is the most efficient? The costs seem equivelant.The whole query (depending on which select I use) would be:[code]DECLARE @ValueDate smalldatetimeSELECT @ValueDate = (SELECT TOP 1 CONVERT(smalldatetime, CAST(MonthValue AS varchar) + '/01/' + CAST(YearValue AS varchar)) AS ValueDateFROM dbo.myTableORDER BY ValueDate DESC)SELECT DATEADD(month, -23, @ValueDate)[/code]Thanks,Tom

Dynamic query providing wrong output

Posted: 24 Apr 2013 01:52 AM PDT

I have a table data_profile_stats which contains all possible information about all the tables and columns in the DB. I have a cursor running over data_profile_stats which goes line by line, picks up a table name, column name and creates a dynamic query. This query is used to count number of blank values in that column. For some reason, instead of an INTEGER number, I am getting '*' as output which is wrong. Here is the query:SET @QUERY='SELECT @BLANK_COUNT= COUNT(*) FROM ['+@DB_NAME+'].['+@SCHEMA_NAME+'].['+@TABLE_NAME + '] WHERE ['+@DB_NAME+'].['+@SCHEMA_NAME+'].['+@TABLE_NAME+'].['+@COLUMN_NAME + ']='+''''+''''EXEC SP_EXECUTESQL @QUERY, N'@BLANK_COUNT INT OUTPUT', @BLANK_COUNT=@BLANK_COUNT OUTPUTSET @QUERY='UPDATE [dbo].[Data_Profile_Stats] SET BLANK_COUNT='+''''+CAST(@BLANK_COUNT AS VARCHAR(5))+''''+' WHERE [DB_NAME]='+''''+@DB_NAME+''''+' AND SCHEMA_NAME='+''''+@SCHEMA_NAME+''''+' AND TABLE_NAME='+''''+@TABLE_NAME+''''+' AND COLUMN_NAME='+''''+@COLUMN_NAME+''''exec sp_executesql @QUERY Example of queries are:SELECT @BLANK_COUNT= COUNT(*) FROM [TEST].[dbo].[TBL_1] WHERE [TEST].[dbo].[TBL_1].[TCode]=''UPDATE [dbo].[Data_Profile_Stats] [red][b]SET BLANK_COUNT='*'[/b][/red] WHERE [DB_NAME]='TEST' AND SCHEMA_NAME='dbo' AND TABLE_NAME='TBL_1' AND COLUMN_NAME='TCode'As you can see, Blank_Count is getting set to *..can someone please help me out here

Is it possible to run a query to return the members of a database User group?

Posted: 24 Apr 2013 01:22 AM PDT

Is it possible to run a query to return the members of a database User group?

[SQL server issues] Created Issue: AdventureWorksDW2012 Download file corrupt [19063]

There seams to be an issue with the AdventureWorksDW2012 Data file download. When I try to run this SQL statement:

CREATE DATABASE AdventureWorksDW2012 ON (FILENAME = 'E:\MSSQL11.SQL02\MSSQL\DATA\AdventureWorksDW2012_Data.mdf') FOR ATTACH_REBUILD_LOG;

This is the error I get:

Msg 5172, Level 16, State 15, Line 1
The header for file 'E:\MSSQL11.SQL02\MSSQL\DATA\AdventureWorksDW2012_Data.mdf' is not a valid database file header. The FILE SIZE property is incorrect.

Thanks,Dan

There seams to be an issue with the AdventureWorksDW2012 Data file download. When I try to run this SQL statement:

CREATE DATABASE AdventureWorksDW2012 ON (FILENAME = 'E:\MSSQL11.SQL02\MSSQL\DATA\AdventureWorksDW2012_Data.mdf') FOR ATTACH_REBUILD_LOG;

This is the error I get:

Msg 5172, Level 16, State 15, Line 1
The header for file 'E:\MSSQL11.SQL02\MSSQL\DATA\AdventureWorksDW2012_Data.mdf' is not a valid database file header. The FILE SIZE property is incorrect.

Thanks,Dan


.

sqlserversamples.codeplex.com

Search This Blog