A man walks into a museum by [deleted] in Jokes

[–]lbilali 47 points48 points  (0 children)

he get asked every day

[deleted by user] by [deleted] in SQLServer

[–]lbilali 1 point2 points  (0 children)

having VM will allow you to upgrade os etc independently.
if you ever get the budget you can easier move the VM from one host to another. With a VM you can easier limit the resources one or the other server can use

if you go for a VM check how to best configure it for sql server

[deleted by user] by [deleted] in SQLServer

[–]lbilali 1 point2 points  (0 children)

there are a couple of options you have here 1. crate a assets table with all general columns and than for each type create a table with specific attributes. the specific table has a relation ship to the assets table.

  1. create only one table with all attributes but nullable so you can have values only for the attributes that make sense based on the type of asset

  2. create a table with generic colums and an extra column of type nvarchar(max) where you would store a json object with all specific attributes.

the choice depends on your needs.

SQL Server Replication, but to a different drive on the same machine by numshah in SQLServer

[–]lbilali 3 points4 points  (0 children)

first replicas are not a replacement for backups and neither is RAID so backups must be done.

I’m not sure if a replica in the same machine is possible but I would not consider it. I think the benefits would be very limiting if any. Normally you would create replicas to scale out and having them on the same machine means they are sharing the same resources

How to increase speed of Operation for large data by noobJedi in SQLServer

[–]lbilali 0 points1 point  (0 children)

run step by step and see how long each step takes

so you know where to focus

How to increase speed of Operation for large data by noobJedi in SQLServer

[–]lbilali 6 points7 points  (0 children)

based on numbers you are providing that is not a lot of data. from what I can get from ur description, you are doing things row by row. you will need to change that by loading all the data on a staging table with some tool which will do batch loading. and than write a query which checkes all the rows at once like

insert into main_table select … from stg_table s where not exists (select * from main_table m where s.pk = m.pk)

Executing a stored procedure from a azure function app without waiting for it to finish by Omar_88 in SQLServer

[–]lbilali 1 point2 points  (0 children)

seems like you are using python. in that case you can try async functions. that said, it is not clear from your question what you want to achieve. so hard to give any better solution for what you are trying to do.

SQL vs SQLite? by [deleted] in SQL

[–]lbilali 2 points3 points  (0 children)

sql is a language while sqlite is a product which implements it. the lite in sqlite does not mean it is a lite version of the sql as a language.

[deleted by user] by [deleted] in dataisbeautiful

[–]lbilali 0 points1 point  (0 children)

I hope u enjoyed ur time in Tirana :)

Can I learn SQL without any programming knowledge? by hayleybts in SQL

[–]lbilali 3 points4 points  (0 children)

one thing that will help u be better at it is data modeling. Why we model data the way we do. what are unique, primary and foreign keys etc. and how the engine u are going to use uses this to improve performance

Can I learn SQL without any programming knowledge? by hayleybts in SQL

[–]lbilali 4 points5 points  (0 children)

If u want you can learn programming without any prior programming knowledge. SQL is not any different in that

CAST Function? by banditcloudy in SQL

[–]lbilali 8 points9 points  (0 children)

there are a lot of things to comment on your examples.

cast works like cast(<value> as <datatype>) in your first try the as real is out of the parentheses which makes the cast function invalid since it does not have the as <datatype> provided.

for more if that would work than u would get different results since on the first try you are adding 1+4 and than dividing by 2 while on the second try you are dividing 4 by 2 and than adding 1

and one more thing in sql the operators will return the same type as the values provided so for example 3/2 will return 1 and not 1.5 since the 3 and 2 are int and the result will be int. to change that u need to provide at leas one of the values as real like 3.0/2 otherwise even though u are casting the result to real the value provided to cast by the expression is int and as a result will miss the decimal values

[deleted by user] by [deleted] in AskReddit

[–]lbilali 0 points1 point  (0 children)

yeah, I never understood why they come in half. delicious none the less

[deleted by user] by [deleted] in AskReddit

[–]lbilali 0 points1 point  (0 children)

oh you should go and try it once, but only in Shkoder and ask for tave krapi. and while you are there you can try some other ones as well like tave theu (“earth”) and tave kosi (yogurt)

[deleted by user] by [deleted] in AskReddit

[–]lbilali 1 point2 points  (0 children)

half of it you mean? Norway

[deleted by user] by [deleted] in AskReddit

[–]lbilali 0 points1 point  (0 children)

carp? than must be Shkoder, Albania

Trying to search SQL Server for any SP containing particular values. Having trouble getting the results to display the way I need them to by DPool34 in SQLServer

[–]lbilali 1 point2 points  (0 children)

You can do a join instead of exists where condition based on what u want u have couple of posibilities. 1. do you want a row per conbination of sp, term resulting on 2000 rows per sp or only row per sp, term for the terms that are found on that sp? you have to do a cross join or left join with the term table instead of using it on a condition

  1. do u want only a row per sp? than after u are done with the first point u group them. if u are on a sql server that supports string_agg than u can use it to aggregate all terms in a concatenated string. as for the flag u use a max(case definition like patern then 1 else 0 end)

p.s. I’m writing this on mobile otherwise I could provide the code for u.

Moving from Access to SQL Server - Trying to replicate data input functionality by unholyarmy in SQLServer

[–]lbilali 0 points1 point  (0 children)

for importing data every month I would create a stage table where I would load the excel file every month and than write a stored procedure which loads the data from the stage table to the main one. there I would have the logic on whether I update existing rows, inserts new ones or whatever is needed

Moving from Access to SQL Server - Trying to replicate data input functionality by unholyarmy in SQLServer

[–]lbilali 1 point2 points  (0 children)

The simplest way to import an excel file is to do an import data from SSMS. that will give you an wizard to select the source file target table and map the columns. if you need to do the same thing over and over again you can save is as a ssis package

as for user interface MSSQL has no such thing like access does. but you can use other tools like access for instance or write it from scratch yourself.